Latest Entries »

I was surfing around on SuperUser today, and found a mention to a tool from Apple that I hadn’t heard of before. It’s called the iPhone Configuration Utility, which allows you to examine logs from your iPhone or iPod Touch, to apply configuration and provisioning profiles, and more. The tool is very interesting! [Download: Windows|Mac]

Every month, StackOverflow, the brilliant and completely open question and answer site for programmers, releases a Creative-Commons licensed dump of their database. You can download this huge dump yourself, but it’s typically a very large file, and then comes the hassle of getting the XML files into a database of your choice. Now, there is a way to get around those inconveniences, by simply bypassing the whole download procedure and querying the data dump in the cloud! That’s what StatOverflow is for. Just go to the sandbox, enter an SQL query, and voila! Also, there’s a  quite helpful meta.stackoverflow post which explains the anatomy of the dump, so that querying it is much easier. Enjoy!

(Almost) Destroying Explorer.exe, AGAIN

Today, somehow or other, I stumbled upon the distributed processing app called GIGRIB. Developed by Pingdom, “Pingdom GIGRIB is a unique, distributed website monitoring service. GIGRIB users can add websites they want monitored, and in return their computers become a part of the GIGRIB monitoring network.”

So, I fired it up, inputed the domains I wanted it to monitor for me, and let it run. Of course, I became curious in how the app is uploading data back to Pingdom, how it’s checking uptimes (well, duh, it’s just going to the page and looking for a response), and more, so I opened my HTTP packet sniffer/web debugging proxy of choice: Fiddler. However, GIGRIB’s requests weren’t displaying there and I was too lazy to change the configuration to avoid this problem, so I decided to take revenge on GIGRIB. Naturally, when wanting to make a mild impact (meant for hilarity) on an application, the tool of choice is Resource Hacker (not that it only does mild impacts, it can do LOTS of stuff – I love ResHacker, it rocks!).

I hadn’t used ResHackONoez instead of starter in some time, so I didn’t bother trying to find it on my drive. Instead, I got the latest version, which turned out to have some cool new features – it visualizes the GUI of the app you’re editing and lets you change all aspects of the layout with ease, it provides a more streamlined “compile scripts” action to quickly apply changes to the file, and more! I was intrigued by these new additions, so I decided to try them out.

After changing some of the text, GUI positioning, icons, and more in GIGRIB, I got a little bored, because GIGRIB doesn’t have too big a UI (really, there’s only like two windows that have info in them – settings and about). For some reason, I had a sudden urge to mess around with some Windows configuration files. My (first) target of choice: the text of the Start button on the taskbar.

Yes, that may sound lame, but I guess I was just playing around with Start Menu customization before the hack, which is probably where the idea came from. I opened up %windir%\explorer.exe in ResHacker, and browsed to “String Tables –> 37 –> 538″ and changed the string from “start” first to “ocrap”, and then decided to switch it to a 6-letter phrase instead. After saving this final version (“ocrap” worked perfectly), I killed explorer.exe and tried to restart it thru Task Manager, when I get an error: “C:\Windows\explorer.exe in not a valid Win32 executable.” I tried re-saving, switching it back to “start” and saving again, but it did not help. Thankfully, I knew that ResHacker saves backups automatically, so I had a backup called C:\Windows\explorer_original.exe. I ran this one to fix the problem. In the C:\Windows directory, I tried again and again to undo the changes and restore to the backup, but Windows would keep resisting. After a few attempts, I thought that changing the files around in Safe Mode would do the trick, but as I was rebooting, I had a thought: Windows has many fail-safes, so why can’t this be one of them? If explorer.exe gets corrupted, would it be restored with a restart?

Well, it worked! This is why I love Windows – if something is messed up, there’s always a way to recover it, however simple or difficult.

Start menu button string location in %windir%\explorer.exe:

String Table –> 37 –> 1033 –> 578 = Windows XP default theme

or

String Table –> 38 –> 1033 –> 595 = Windows Classic theme

Note: I have nothing against GIGRIB or Pingdom, as I believe that both company and product are useful, intriguing, and helpful. I am an avid user of GIGRIB, and my experimentation with it was in no way a signal of protest against it, nor does it affect its functionality in any way. GIGRIB is a very generous program that I enjoy, so I must thank Pingdom for creating it.

Disclaimer: I am not in any way responsible for any uses (and their consequences) of the method outlined above. This is for informational use only.

The anti-trust community is all over Google, these days, says an article in the August 2009 issue of Wired Magazine. Fred Vogelstein tells readers that the search giant is the new Microsoft – remember that huge antitrust lawsuit against Microsoft for packaging their browser with Windows? Now they’re interested in the advertising and business ideas of Google, as Google has a huge market share in the advertising and search market, which gives them an enormous amount of data about users. After all, why do they give their excellent software away for free? This is because the more users that their applications have, the more data they have about them, about their interests, their personal identity, and much much more. Effectively, many companies have access to such huge amounts of personal info – take Facebook for example, which acquired FriendFeed yesterday. They can (and do, for all I know) use all the data that users submit about their interests, identity, preferences, and more, to target advertisements, to circumvent identities (in malicious situations), to sell the data to marketing agencies, and more. Or look at Twitter. Look at how much detail Twitter has, even though mostly all of it is accessible by anyone (except of course for preferences, Direct Messages, and protected updates). I rather like Twitter, but what if they (or someone else, possibly someone who scrapes personal info off of their site) use it to create a whole “profile” of a person’s characteristics, personality, hobbies, interests, and whatnot? I know that Twitter won’t do this, but some other company in such a situation might. Like Apple.

Apple is the one the antitrust community should be gunning for. Look at how they are monopolizing.A classic example is the iPhone, exclusive to AT&T. Why is this, you might ask? This way, they can pull even more money out of the pocket’s of their users. Also, what is the whole point of all the restrictions inside the iPhone OS? Why can’t Apple be open, like Google with Android, open-sourced and partially developed by the community from the start? The Macintosh, Apple’s key product, is also an example of this. Mac OS X is only compatible with Apple hardware, not anything else, so that everything has to be through Apple, hardware and software, meaning more money for Apple, as well as an unnecessary monopoly, while Windows is completely open to all suitable hardware, because Microsoft isn’t a hardware manufacturer and knows not to lock people in, though they did that with IE some time ago (and possibly even again now). Apple even makes it hard for you to change the battery in a laptop!!! They want you to stop from using devices from others that compete with them!

And yet we agree to such a tradeoff. We still give all our information to Apple, ranging from our music purchases in iTunes (musical preferences and interests), files in MobileMe, email, pictures, computer preferences, and so much more. But they are crossing the line – why don’t they understand that doing so is dangerous? However, no one seems to care that Apple is being so monopolizing to users, even though in some of its main conquests it has a small market share. Look, this will end bad for you, Apple, so make the situation better for users NOW and save yourselves of the future consequences of not doing so. Otherwise, what is the commercial world coming to?

In my last post, I explained what truly went on in the Twitpocalypse, which dealt with tweet IDs passing the limits of the 32-bit signed integer (from -2,147,483,647 to +2,147,483,647), which is the most common datatype in use in computer applications today. Yet, whilst computer science has limits embedded into its structure, Twitter does not – the number of users and tweets is growing, and FAST! In September, the Twitter API team estimates, we will pass the limits of the 32-bit unsigned integer which is up to 4,294,967,295. Thus, applications and libraries that utilise that datatype in conjunction with tweet identification numbers in the Twitter API will fail, once again. In the post where I explained the first Twitpocalypse, I recommended that all applications switch to the 64-bit signed (or unsigned even) datatype, and then maybe even consider storing the IDs as strings, with variable length (no arithmetic between IDs is really needed, so this should be extremely easy). The Twitter API team is doing the same thing – it has now informed developers that it is best to switch to a 64-bit implementation for storing those integers. Hopefully, this time, we will be prepared for the upcoming Twitpocalypse, and even less confusion and problems will arise when we pass that huge number of tweets. I myself am switching to a string implementation for the IDs in the Twitter client that I am developing (more info coming soon!), so that no matter how many tweets have been posted, the application will not fail. Good luck, everyone, in surviving this next round of this problem. [@twitterapi 's tweet; Twitter API Announcements (via TechCrunch)]

Numerous friends have asked me about this whole Twitpocalypse thing, as they just don’t get it. “What’s this whole deal with signed integers?”, they ask. Well I’m here to clear that up, as I do programming, and in programming, if you don’t know such basics of computer science, you’re doomed.

What the predicters of the Twitpocalypse were referring to when they mentioned the limit of 2,147,483,647, is the limits of the signed integer data type. The signed integer is a 32-bit data type, so it can hold only so large (or so small) a number – in this case, the highest number the data type can preserve in 32-bits is 2,147,483,647, and the lowest number is -2,147,483,647, respectively. This is what causes the Twitpocalypse problem, as well as the foreseen Unix Year2038 problem (where Unix epoch time will cross the limit, and distros using the 32-bit data type will fail.)

Each tweet in the Twitter infrastructure has its own numeric ID. Thus, programs that invoke the Twitter API’s ID interface into a 32-bit variable fail, as the number of tweets has passed the limit. When this happened, some applications failed, others continued working, depending on their implementation of this feature. Of course, updates were quickly rushed to the failing products, so that users wouldn’t be discouraged or affected for too long. Most applications now use the 64-bit integer datatype (commonly referred to as long or int64) for the ID variable, which supports numbers from −9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 – in other words, pretty large. Until then, we’re safe, but if we manage to cross that 9 quintillion mark (well, it’s certainly possible! :) ), we may be forced to convert to the 128-bit integer time, or even storing numbers as strings (the datatype for any types of characters, mostly letters), but I think computing will have changed a bunch by then, so that we might not even think of such a problem. That is, if Twitter lasts till then, or maybe the world will have been sucked into a black hole. We’ll see.

(On a side note, last year, I created a VeryLargeInt class for storing huge numbers (100 digits long can be stored with this, or even more!) by using the string data-type, and I also built algorithms for computation with strings, including most common mathematical operators. I may publish this project here in the future.)

Another Nasty IE Bug

Plain and simple, I detest Internet Explorer. Why, some may ask? Internet Explorer is a retarded browser whose proprietary graphic rendering engine sucks, whose scripting engine fails, whose security does not exist AT ALL, and much much more. Thus, I don’t use IE, and I haven’t used it since a very very long time ago. I switched to Firefox when I realized how sucky IE is, and then when Google Chrome began as an open source developer project I signed up and started using it. But still, even if you don’t use Internet Explorer, it is responsible for many things in Windows, as it is directly tied-in to Internet Options and Connections.

Two days ago, I was writing an application that scraps a web database into SQL Server, when suddenly, Google Chrome, Visual Studio, and numerous other programs stopped connecting to the internet. The only major ones that still worked were Firefox and Google Talk. At first, I blamed my full CPU and thought that my computer was just crashing, but when the problem continued the next day, I knew something was up. As I noticed that the problem was spread out over many different programs, I knew that it had something to do with the internet settings that the default socket uses – Internet Explorer. Also, many people have had this problem, as reported on the internet. The fix is just as elusive as the culprit itself.

Some people said that reinstalling Internet Explorer would do the trick, yet this had no effect. While scrambling over the interwebz looking for a fix, I remembered that the HTTP proxy Fiddler automatically works with most programs including Internet Explorer, Google Chrome, Visual Studio, and more, but with Firefox it doesn’t. To successfully debug out of Firefox, you have to go into the Settings and set it to use a special proxy for Fiddler, which would mean using the default socket! This is when I realized that the whole problem was related to a proxy server mix-up. I quickly jumped into the Connections tab in Internet Options, hit LAN settings, and voila! The “Use proxy server…” checkbox was selected, with no values in the textboxes for the configuration of said proxy! After unchecking the proxy server checkbox and checking “Automatically configure settings…”, everything began to work.

Which brings me to ask, why would some program that I never use suddenly think that my internet connection has changed? Did it think I had some problems conecting so a proxy server must be required? This bug is just retarded in my opinion, as the connection changes for no reason whatsoever when you don’t even ask it to change! Really, Microsoft’s IE programmers are morons, if they have bugs like this, not to mention this bug. Geez, Microsoft – you’re abusing your power!

I’ve always wanted to experiment with creating “sessions” on websites to mimic real users browsing and using a site, and I’ve finally gotten around to a project that involves this: my goal is to “wrap” an online database that is queried through a series of HTML forms, returns a map, and then allows you to open a popup with an HTML table outlining all the points displayed on the map. A formidable challenge, indeed, but in the awesome language of C#, no big deal.

To successfully establish a user session with a website, you must preserve the correct authentication and session cookies. The web database was built using ASP.NET, so I needed to make sure that I had an ASP.NET Session ID. One of the best ways to find out where cookies are sent to you is using an HTTP proxy to analyze requests and responses. The program of choice is called Fiddler, developed by Microsoft. (You can get the latest version at http://fiddler2.com/.) Unfortunately, I was forced to use Firefox to track packets because the old (straight out of 1997) interface  recognizes the new and revolutionary browser Google Chrome as being Safari 1.3 (how sad), and doesn’t allow you to use their database. and you must set special proxy settings in Firefox for Fiddler to function correctly. After visiting the site and filling out the series of HTML forms, I could see how the report page was functioning – it was using the ASP.NET Session ID along with referrer HTTP header attributes to  find the parameters of my original query and retrieve information from the database.

That might sound like an easy interface to hack, but the cookies are deceptive as you don’t exactly know when they are set. Fortunately, after scouring the internet for an hour or so, I happened to find out about the CookieContainer datatype (HttpWebRequest.CookieContainer). All you have to do to create a cookie “jar” that carries over from one HTTP session to another is writing the following code:

CookieContainer cookieJar = new CookieContainer();
var request=(HttpWebRequest) WebRequest.Create("http://google.com");
request.CookieContainer = cookieJar;

Now you can access the cookies by looping through the CookieContainer in a simple foreach statement. To apply this cookie container to your next HttpWebRequest, all you have to do is:

 request.CookieContainer = cookieJar; 

Yay!

If you’re a .NET developer, admit it: you’ve at least once felt curious about how the underlying APIs behind the .NET Framework are coded, how certain functions are implemented, or whether one core function is more efficient that another. Well, this is where the trusty program named .NET Reflector comes in. As the title suggests, Reflector uses .NET reflection and ILDASM processing. It is the decompiler of the .NET world, and allows you to view source code of DLLs or executables in multiple languages (including C#, VB, C++, Delphi, IL, and more) with ease. It is very interesting to examine how the brilliant programmers at Microsoft sculpted the inner workings of the programming framework that drives many applications today. With this tool, you can accomplish just that and much much more. The Reflector was originally created by Lutz Roeder, but has been acquired by Red Gate Software. The program is free for all to download and use, and it can even Reflect upon itself! Now that is true irony. You can snag a copy over at the Red Gate site.

ThinkGeek has updated the warfare category of their catalog with a new USB-powered missile launcher. Its perks: it has a built-in laser to guide the missiles, it has a very powerful software frontend, and most importantly, it offers an API!!! Finally, developers can terrorize others by coding applications that make use of the firing capibilties of the launcher. The API is built in .NET, so using it is a blast – a sample application is included, complete with raw C# code. And just because of said API, I am willing to slop down 40 bucks for this widget. You can find out more about the product and download the API for free on the product page.  It’ll be interesting to run the DLL through .NET Reflector, and if I find anything intriguing about the way it’s built, I’ll post it here. Have fun terrorizing people! :)

Copyright © 2010 Maxim Zaslavsky. All Rights Reserved.

Videos, Slideshows and Podcasts by Cincopa Wordpress Plugin