IceDragon ([info]icedraco) wrote,
@ 2008-04-09 09:56:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Current location:Home
Current mood: tired
Current music:None
Entry tags:pocketpc, programming

Forcing Pocket C# to work with different install paths.
A while ago I've stumbled upon a pretty cool project called Pocket C# - it is a compiler that allows you to create C# programs on your PocketPC. To make life easier, it even came with an IDE program that would deal with configuration business for you as well as building the project. The only problem was that it refused to work unless you installed PocketC# in its default path - in \Program Files\Pocket C#\. Considering that I don't have much RAM as it is, leaving the compiler on RAM was the last thing I wanted to do - there had to be a different way!

After a little tinkering, it appears that as it starts to build the project, pcsharpide.exe makes a .bat file called cc.bat in your Temp folder and inside it, the program sets the PATH variable to "\program files\pocket c#". That particular path is stored inside the executable at offset 0x18eee in a 16bit Unicode format (UTF-16), so the only way to force the IDE to work on a different PocketC# path would be to hex it. That's pretty much what I did...

While I've hexed my IDE with Midnight Commander, you can do this on the PDA itself with a nice tool from SK called PE Info. Since the file is no longer accessible from the official site, here's a link to my webspace instead: peinfo.zip [185,738 bytes]
What you do there is select File->Open, open pcsharpide.exe from wherever it is installed, load it, then go to Tools->Hex view/edit to see the hexdump. Tap on one of the offsets to the left and write 18eee into the text box to skip to that specific offset. From that point, you will start seeing the file path that is used in the .bat file and you can now use the hex editor to change the path to something else. I suggest doing this character-by-character since the zeroes in between have to remain zeroes. Also, your path must not be longer than 24 characters! If it is shorter, replace the remainder from the old path with zeroes (00).

This are rather unfriendly instructions for those who mostly know what to do when it comes to hexing. For others (if there are any besides me), I might make a small app that would do the dirty work of changing the path for you. Not right now, though...

Just something that I found and would like to keep a memory of...




Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…