Related
Hi,
Can someone assist me with how i might go about decompiling or viewing a dll, making changes to it and recompiling it? What tools can i use to do this?
I have tried copying some of the dlls from my device over to my local pc, however most of the time i get an "access violation" message.
Further, i realize i can use idlasm to disassemble .net files, but it seems most of the more interesting dlls and files may be standard c dlls. How can i take a look at the code in these and modify if wanted?
thanks much.
farseer: what level of experience do you have?
V
I'd like to think i am decent developer, but that may be in my own mind
However, i do not do a lot of "hacking", i.e., have not had the need to do much reverse engineering. I have been coding ground up apps for over 10 years however, uisng C++, Java, C#, VB, etc. You name the language, and i've probably done something in it .
vijay555 said:
farseer: what level of experience do you have?
V
Click to expand...
Click to collapse
was that the wrong answer?
farseer said:
I'd like to think i am decent developer, but that may be in my own mind
However, i do not do a lot of "hacking", i.e., have not had the need to do much reverse engineering. I have been coding ground up apps for over 10 years however, uisng C++, Java, C#, VB, etc. You name the language, and i've probably done something in it .
vijay555 said:
farseer: what level of experience do you have?
V
Click to expand...
Click to collapse
Click to expand...
Click to collapse
The correct answer should be "I know ARM assembler language, the structure of Win32 PE files, I know what is XIP DLL and why I cannot modify them directly, and I have read the WM5 source code".
In this case the process is simple - you decompile a DLL with IDA (www.datarescue.com), find the place you need, modify the code to suit your needs - and that is all. In most cases there is not enough place in DLL for your code, so you need to use virus-like techniques, my prefered method is to patch the code so that it loads my DLL and run it instead of original code. Or use some other hooking methods so that my code is executed instead of original.
Ah, thanks much, this was helpful. I do have a few follow up questions:
1. Is "Arm assembler" different than standard assembler? If so, any suggested readings?
2. There are some dlls that cannot be copied to my local pc (i get an access violation i believe). How does one extract an image of such dlls?
3. Where is the WM5 source code? and why would i need to read this to be able to hack/patch dlls?
thanks again.
mamaich said:
The correct answer should be "I know ARM assembler language, the structure of Win32 PE files, I know what is XIP DLL and why I cannot modify them directly, and I have read the WM5 source code".
In this case the process is simple - you decompile a DLL with IDA (www.datarescue.com), find the place you need, modify the code to suit your needs - and that is all. In most cases there is not enough place in DLL for your code, so you need to use virus-like techniques, my prefered method is to patch the code so that it loads my DLL and run it instead of original code. Or use some other hooking methods so that my code is executed instead of original.
Click to expand...
Click to collapse
Hi farseer!
I am nowhere near the level of mamaich or vijay555 but I have some experience in this and I believe I can give you some basic answers:
1. ARM is a different architecture then x86 processors and the assembler is different to accommodate it. There are some basic similarities like mov add and such, but even the registers are different (R0 - R15 if I am not mistaken). Sorry, I don't know any books on it, but if you google you will quickly find the list of commands with basic explanation.
2. Since the OS is in ROM you can't just copy and paste it's DLLs and EXEs. Look for ROM dumping tools on this forum, or already extracted images on the ftp. Keep in mind MS did some tricks to save memory and make it harder to get at the files, so like mamaich said, you need to learn about XIP and the ROM structure in general to understand whats going on.
3. Hmm... MS does have a program for sharing most of WM source code, but it's not for common people like us. (check out their site to see what I mean) I suspect there are other sources of getting the parts necessary to understand DLL hooking, but I have no idea what they might be.
Well that's my two cents until an expert can answer you. Hope this helps.
farseer: you gave a perfectly good answer IMHO, just needed to get an idea of what level to pitch a response without talking up or down to you!
It's well documented that I'm a self confessed newb to c++, and would say that your programming skills should certainly hold you in good stead. However, having a good knowledge of the Win32 API is certainly beneficial.
For decompiling, basically IDA. There is an IDA demo available on their website that should get you going, it's pretty much 100% functional other then it won't save, and closes itself (or crashes itself) after a reasonable, random period of time. IDA is "the daddy" for pretty much all mainstream reversing, although you could write your own decompiler/debugger.
Recompiling - that's a toughy. IDA won't permit recompiling on ARM AFAIK.
You'll have to hexedit into the target and patch directly. Otherwise you get into the exciting world of code injection, hooking etc, as Mamaich says.
For that area, read everything he's ever written, before you start reversing
Oh, and a helpful hint to all. Don't just read what Mamaich's written on this board, his posts on other boards are even more useful!
It's worth getting a good familiarity with reversing on x86 first, get used to how IDA works etc (and Soft Ice is very useful to give a good insight into x86, although AFAIK it's not available for WinCE). ARM assembler is different, but just grab a list of the opcodes and read through a few CPU developers' guides (online).
There are a number of tutorials on reversing ARM stuff online. In the usual places for that kind of stuff.
For getting access to the ROM files, easiest way is to grab a rom update file and decrypt it. Mamaich is once again your man, his romtools do the job. He also has a "live" rom grabber, that'll grab all the files/modules out of your running phone for your perusal.
Platform Builder is available free to give you (some) WinCE source code. Not all, but enough to give you years worth of reading.
V
Thanks all...very kind of you to respond in such detail. I look forward to dabbling a bit with IDA and some of mamaich tools. I suppose the first order of business is to do a lil more research and then just dive in! It's been a while since i wrote any assembly code (not since college!), but i am a bit excited at having an excuse to do so again.
thanks again.
Just remember that unless you really luck out and the developer left the symbol table intact, you're going to end up with garbage for the names of variables and subroutines.
I hate reading decompiled code.
Most of us are already aware that PPC and smartphone edition are similar enough to be mostly compatible in their apps across the platforms.
That is, with enough coaxing and the help of input simulators like SPHelper, I've managed to run almost any Pocket PC app on a smartphone device.
Well, until now.
I've officialy run into my first brick wall of sorts, and I'm hoping someone here can shed some light onto the situation.
Since the MS implementation of A2DP has quality issues, I'm trying to run MSI Blueplayer app ( found at http://cweb.msi.com.tw/program/support/download/dld/spt_dld_detail.php?UID=619&kind=8) on a smartphone.
Analyzing the cab, I extracted 4 .dll's that go in the \windows dir (msibtstk.dll, msibtapi.dll, CHS.dll and TW.dll), and two .exe program files that go in program files\msi\blueplayer (STLoader.exe, and MPOBCE.exe).
Now, normally its as simple as running the .exe, at least it always has been in the past.
However, every time I hit MPOBCE.exe, all I get is:
"Alert
Can't find MPOBCE or one of its components. Make sure the path and filename are correct and that all the required libraries are available."
Just to control this experiment, I copied the exact same files over to a PPC device and ran it to find that it DOES work.
Now, I've never encountered PPC specific code before- in fact, I didn't even know such a thing was possible. Has anyone see/heard of this sort of thing before?
Can someone help me take this apart and find out what makes it work on a PPC only? Perhaps a PPC-specific path (if there is such a thing)?
At this point, as much as I'd like to get this working, I'm just as much intellectually curious as to what would cause a program to only operate on a PPC installation.
Hello Dishe.
Your problem is simple: Certain DLLs that come built in Pocket PC version of windows mobile do not exist in the Smartphone version. An example is MFC DLLs.
What you need to do is get hold of 'dependency walker' which is a neat little app that MS incorporated in to VS 6 (though I understand it was written by an independent developer and should be available separately).
It will show you exactly which DLL files each exe is linked to. You then have to get a good copy (from a ROM dump) of the needed DLL and put it in windows directory.
Hope this helps.
That's a great idea. Thanks! I never heard of the dependency walker before, but it sounds like a perfect tool for this. I'll have to check it out on my office computer (I don't have VS 6 at home).
I wont be back in my office until wed., so if anyone had a bit of spare time, I'll attach the files here for someone to examine.
If anyone wants to look into it and tell me what dll's are required, I can get ahold of them from a healthy Pocket PC image.
Thanks!
This zip file has the two .exe's contained in the installation. I think only mpobce.exe is complaining about missing components, though.
Oops, apparently I should have checked first...
Dependency Walker is a free app. I downloaded it and tried it out.
It lists a bunch of .dll's, most of which I had on smartphone.
However, the two missing ones are:
mfcce300.dll
olece300.dll
Now, I'm not exactly sure what these do, so I need to look into it some more. Does anyone have any clue what these are for? If I copy them from a Pocket PC, will they operate on a smartphone?
Hi Dishe.
I guess I should have been more clear: Dependency Walker was written as freeware by an independent developer, but M$ liked it so much they decided to grab it for VS.
Any way, mfcce300.dll is MFC version for PPC (if you are not familiar with MFC, it's a collection of "ready code" that simplifies writing apps in c++)
It comes built in for PPCs but not for smartphones for some reason. If you have a good dump check that DLL with dep. walker as well, I am pretty sure it is linked to a few others.
olece300.dll - is a COM support dll. I won't even go there because I really hate COM (that's Component Object Model, not com port) and I am really not sure my self what the DLL does.
If you do get a good version of those two you should be able to get the app running.
levenum said:
Hi Dishe.
I guess I should have been more clear: Dependency Walker was written as freeware by an independent developer, but M$ liked it so much they decided to grab it for VS.
Any way, mfcce300.dll is MFC version for PPC (if you are not familiar with MFC, it's a collection of "ready code" that simplifies writing apps in c++)
It comes built in for PPCs but not for smartphones for some reason. If you have a good dump check that DLL with dep. walker as well, I am pretty sure it is linked to a few others.
olece300.dll - is a COM support dll. I won't even go there because I really hate COM (that's Component Object Model, not com port) and I am really not sure my self what the DLL does.
If you do get a good version of those two you should be able to get the app running.
Click to expand...
Click to collapse
Thanks for the help, I'm realizing there's a lot more to this I should have known before embarking on such a task. I've never had such a problem doing this before, I guess MFC isn't so popular!
Anyway, I need a good ROM dump, I haven't been able to aquire one. In the mean time I tried some files I found searching google... didn't expect it to work, but tried it anyway. Still complained of missing files- you're right, I'll bet MFC is calling more dll's as well that I need.
Perhaps there's hope...
You were right... I just needed more .dlls!
I found a whole series of .dlls required by mfcce300.dll that my smartphone was missing, so I put them all in the program directory and it opened!
Problem is, its not so stable... the files were pulled from a ce.net-4.1 set of files since I don't have access to a wm5 rom image.
One more thong I should have thought about earlier:
Some COM dlls, maybe even olece300.dll have a function called DllRegisterServer that writes them to registry as COM provider (under HKCR\CLSID).
Check to see if I am right using Dep. Walker and if so try to get regsvr32.exe or something similar for the PPC. (On a PC you use regsvr32 somedll.dll to register a COM server)
This may help with stability issue.
Hello.
Do you know a site or thread which has basic instructions about making a "hello world" app for PPC? Just to get me started.
What tools do you guys use? (doesn't matter if they are free or not)
How do you export/publish it as a .CAB?
Thanks.
PS. I searched and didn't find a thread like this and I don't want to use somebody else's thread.
Are you familiar with programming?
I use Visual Studio 2005 to create my apps. It has the ability to create a *.cab file as well
Visual Studio 2005 is not free.
You can find tons of info at the MSDN.
You can also use some library simplifying access to pocketPC by taking care of all necessary OS calls. Xflib looks good, especially if you want to code games, there are also some examples provided with lib download, and sources for most games hosted on their site are available. Might be a good place to start if you'd like to avoid learning winAPI and get right down to coding the actual app Another good thing is that it uses open source ceGCC compiler, so MS Visual C isn't needed. Also, you won't really need to make CABS to distribute programs coded this way, since they consist of one single exe file.
Go to www.xflib.net for downloads and install instructions.
And if you're a total beginner when it comes to programming, I'd try scripting out first. Have a look at mortscript (good because of it's multi-platform usage) or AutoIt (for windows desktop)
Thanks for the answears so far .
I'm not a programming noob, but not profesional. I've done some apps and games. I plan to start with easy things first as a coin toss app... it comes quite handy... or perhaps a handy stuff thing, inclusing the coin toss, unit converting (there are many), dices, chronometer, etc. All with stadistics and many options, like a random mode and a rigged mode ;D for dice and coin toss...
Then move on to something greater, who knows.
For something like that I suppose visual studio is best. I'll try both anyway. Any advise?
By the way is there an emulator like toolkit for J2me? Something a friend can download to run it without a programming software (or a phone).
Thanks again.
Edit: I believe I found an emulator, at least for XFlib (found there).
Device emulators
visual studio has its own device emulators you just have to download the proper SDK's like WM6 sdk or WM5 sdk to be more device specific, it's supports emulator debuging and device debuging but apps made with VS tend to slower and more memory hungry than apps implemented in C. But for me it's the easiest way to app development.
can you post the emulators link or better yet the whole thing itself here if its small enuff? im also working in xflib and would be much easier to use a standalone emulator rather than the one with vs2008. thanks
One of the most important things that makes iPhone appealing for the end-user is the famous Installer. Although jailbreaking your device is not something Apple wants you to do, everyone does it, and it was one of the main reasons that iPhone became so popular.
An end-user who wants goodies for his phone does not know how to search online for applications, choose the best, download, copy, and install... Installer saves you this hassle by providing a one-stop location to download (virtually) any application you might want, using the iPhone itself, making it extremely easy for the user.
Is there a similar application for WM? If not, can't we start it XDA-Developers and build a general public repository for freeware applications to promote the applications of developers here in the forums and contribute the WM software community? The application would have to be widely advertised and not just included in custom ROMs by default, so that people who don't know how to install custom ROMs can get a copy of this application easily.
This is a proposal to the developers to start a new application, not a request for an already available one. I don't have the required development skills for it.
[Was this discussed before? Can't find a trace]
I agree!
Since the new 2.0 FW came out I have been using my iPhone again. I actually still prefer my Touch even with the new exchange support. The installer (app store and Cydia for now) on the iPhone is amazing. While I know how to install apps, think about the new WM user. If they had an installer program that could be downloaded and installed from a site (here?) and then have access to installing programs like S2U2, S2P, PCM Contacts, Keyboards, or even pay products like SPB MS, UL, etc. Potentially the program could also monitor for updates, so when A_C (the great!) comes out with a new update, the user would not need to be checking this forum and happen to see the thread with the update, it would be notified by the application on the device (when they launch the installer app). Skins could be available, the possibilities are endless - the iPhone has proven that.
As far as the application itself, I am no programmer, but it seems like it would be fairly easy to create a program that would look for a list of cab files on a website directory, download the list and allow the download and installation of the cab file. Yes, No?
I agree, this would be very useful. Currently I use Ubuntu Linux, and downloading and installing programs is this easy, because of repositories. I just search for a program using a package manager, and I'm given a list of programs that is relevant to my search. Then I simply have to click and install. I've seen this on the iPod touch, and it is very useful and quick
I just found that someone proposed a similar idea at http://forum.xda-developers.com/showthread.php?t=396486.
However, the approach is not logical as someone has proposed using a thread filtering algorithm instead of creating an actual repository.
Anyway, isn't any developer interested?!
I was looking for something similar since ages. However, the best bet I think (in terms of ease of development) would be to setup a ppc-friendly website with freeware cabs available. Ofcourse, not an ideal solution but should do the trick. How about something like an AppStore for ppc devices ?
A web site won't serve the purpose. There are several web sites out there already. A Windows Mobile application will make it completely different. It can serve as a UI for a cab manager (much like *nix apt-get or other package managers: Installer, Cydia, App Store). The point is reaching the end-user through the phone, not a web site, not the PC.
z_rudy said:
A web site won't serve the purpose. There are several web sites out there already. A Windows Mobile application will make it completely different. It can serve as a UI for a cab manager (much like *nix apt-get or other package managers: Installer, Cydia, App Store). The point is reaching the end-user through the phone, not a web site, not the PC.
Click to expand...
Click to collapse
Well, even if someone managed to make such an app, in idea it would still be needing a working internet connection to download the cabs. So in a way it is as internet dependent as a website. However, I agree that such a software would be cool but difficult to develop.
Isn't one of the features of the installer app that users can add repositories from all over the place,but still have a unified interface at the end of the day? A website could not achieve that.
Surur
In the meantime why not set up an rss feed from eg: http://www.freewarepocketpc.net/ and you are at least halfway there.
Skymarket - Windows Mobile app store coming “this fall”
http://wmpoweruser.com/?p=819
The answer
-removed- will announce full launch soon.
hmmm... isn't a wiki the easiest answer?
everyone can modify it and it has enough structure to make it as deep as folks want and search is built in.
and it can be quite fast on mobile if no graphics.
if I see itunes not wanting to start up every other week because there is another update, I'm going to simply uninstall it.
There is already an paa like this in our phones .. the MS version that does not do ****. if anything, all it would take is have it register the programs installed on the ppc, and have the ms version search for updates in the middle of the night while we sleep. the only thing though: the developers have to put a link for the updates in the about section. this would help MS update check those websites for updates, instead of having someone putt all the labor hours collecting cabs. the developers can do it them selves everytime they make an update just like posting it on a thread.
Unfortunately, MS does not have much on their website other than promotional advertising for their own product.
it will be hard work but very possible. considering all the custom roms out there, not many cabs can be installed with just a tap of the stylus. there will be dependency issues, memory issues, etc. but anyway, check out Device Update of CrC's roms for hermes. it's a small repo for his rom. cool, aint it?
gotvitamink said:
I agree, this would be very useful. Currently I use Ubuntu Linux, and downloading and installing programs is this easy, because of repositories. I just search for a program using a package manager, and I'm given a list of programs that is relevant to my search. Then I simply have to click and install. I've seen this on the iPod touch, and it is very useful and quick
Click to expand...
Click to collapse
Exactly this.
Makes many things much easier.
I know a few people have made threads like this before, but those were all before Windows 8 was released in its final version. Now that Windows 8 has been out for a while, how do you think it compares to Debian? The gestures and apps are cool ideas, but I don't think they were implemented as well as they could have been on the OS when it came to non-touchscreen devices. Apps are a good idea, but I spend almost no time on the start screen apart from checking mail and breezing past it on my way to search for something.
Drivers have been a nightmare for some users, me included, as a few random automatic updates (now turned off on my PC) rendered my wifi unusable without a complete reinstallation of all the Toshiba drivers. I haven't had any problems with things such as mouse drivers, but I've heard of others who had to get them from another computer and install them via a flash drive.
Graphics are superb on Win8, much better in my opinion than Debian's, but when it comes down to it, they just aren't that big of a factor when choosing an operating system. Debian, on the other hand, lacks fancy graphics while it has a much more ("power user", I guess) friendly way of dealing with files and customization when installing packages. Windows does have options while installing programs, but they are limited to what the installer offers to let you do.
As far as ubiquity, Windows wins hands down. With a Windows system, you will almost never be stuck with a file format that nobody around you can open, and Microsoft Office is just as widespread on school and work computers as it is on home computers. Debian, meanwhile, comes with OpenOffice, or you can install OpenOffice's newer branch, LibreOffice. Both use the .odf format, which is readable in Microsoft Word, but some formatting options and graphics don't translate nicely into Word format. Fortunately, they also include the .doc and .docx formats, though they restrict you somewhat on what your document can have in it (same translation issues). Back to ubiquity, programs are nearly always easier to install on Windows, and plugins such as Flash and Java require much less experience and work on many more browsers when installing than on Debian.
For customization, I like Debian better because packages can install either programs or give you new system changes, such as new window managers and graphics options. In Windows, you either have to change group policy settings, or edit the registry, both time consuming, inefficient, and risky tasks (not so risky for group policy, but whatever). Programs such as Wine (actually, just wine, AFAIK) can safely add a different file system type into Debian, while you have to use the much less well known program Cygwin to have a Linux-esque environment on Windows.
I could go on and on about information that's readily available on google, but I need to know, do you like Debian or Windows better? I've been running Debian on Virtualbox for a while now, and I like it, but the whole thing about it not being as widespread and well-supported (yes, I know it has a support community behind it, but you can google literally just about any problem for Windows) is what's holding me back. I've done a dual-boot arrangement in the past, but that doesn't work because I allot half my hard drive space to both OS's, then end up using only one. So I want to have only one OS installed. I don't use Microsoft Office anyway (LibreOffice all the way! ), but getting used to using pretty much ALL open source alternatives to common Windows programs will take more than the month of sporadic testing on a VM that I've done with it.
Is it worth the switch? Or is Windows 8 too good to give up?