[RELEASE] Web based ARM Assembler - Windows Mobile Development and Hacking General

As I am sure there are quite a few ppl around who can write ARM ASM application, I thought it might be fun/useful for them to have a look at my project which is a purely web-based ARM assembler. This is my university project, so I'd appreciate any feedback on it.
It's written entirely in PHP5 and it supports all instructions of ARM9. THUMB mode is not yet supported, but that's just a matter of encoding those instructions. Right now the assembler produces a single executable, but it's capable of producing DLLs and BINary ROM files too. It accepts both file-upload input and simple text. If there are no problems compiling your code, you'll get a link to executable, simple error reporting is available too. Compiled binaries are stored for 24h and then deleted.
It supports DLL linkage by .INCLUDE/.IMPORT directives, for instance:
Code:
.include coredll.inc
.import MessageBoxW
Right now it only has COREDLL header prepared, but I can make it for any other DLL you want, just let me know.
The assembler is available here:
http://arm.piopawlu.net - There is an example application "hello world!" included

Related

SlimServer Client developement - HELP NEEDED with XML

Hi there...
I have embarked upon the developement of a slimserver client for the pocket pc using c#. There is no decent one around that I know of!
Anyway, it is going to be open sourced, and I have already implemented the use of the CLI interface. however, I am a bit stuck with the XML one. I have attached the relevant sources! The problem is that when it runs through the emulator, it is unable to deserialise a slimserver xml file and returns a NotSupported Exception (I have attached a sample xml file). I generated a c# class library for slimserver's xml schema using xsd.exe.
The funny thing is that when I run the compiled .exe file in windows (without the emulator), it runs smoothly, and deserialises it perfectly! It also works when compiled for a normal desktop application!
Could someone help please?

Disassemble or Reverse Engineer WM 6.5 dll

Can anyone suggest tools/utilities that would allow me to disassemble a WM 6.5 dll to reveal it's methods and parameters? In .net desktop world I can use tools like Reflector to do this, but I seem to be having difficulty doing this on WM apps.
Unregister dll - EDiT - Register dll
Here two threads discussing Developer tools & Kitchen Utilities for (ROM) Chef's;
Kitchen Utensils
60 Universal Tutorials for Customizing any Device and Cooking
Have fun, develop something nice for free and please do it here on xda-developers
There are a lot of ifs and buts to this but here goes:
If the dll was created as a .NET app, then reflector should be able to list the code within it, as it will contain the MSIL code within it. If it has been run through an obfuscator when it was built, this can mangle some of the internals and give Reflector a bit of a hard time.
Otherwise it will be a Win32/MFC/ATL object containing ARM object code. A DLL file is the same format as an exe file i.e. Microsoft's PE (Portable Executable) format. Microsoft's DUMPBIN, part of Visual Studio, (run it from the VS Command Prompt), is able to dump out the EXPORT table which lists the public functions visible in it.
There is a freeware ARM dissassembler , CHARMED, which can run on your device which can display the ARM assembly code, but to make any sense out of it, you will require a pretty good knowledge of the ARM instruction set and basic knowledge of how compilers work. If you don't know what a stack frame is, you'll struggle.
Providing a link to chARMed and C/P from that page
stephj said:
There is a freeware ARM dissassembler , CHARMED, which can run on your device which can display the ARM assembly code, but to make any sense out of it, you will require a pretty good knowledge of the ARM instruction set and basic knowledge of how compilers work. If you don't know what a stack frame is, you'll struggle.
Click to expand...
Click to collapse
Here is the link for this nice freeware ARM dissassembler;
http://sites.google.com/site/naphos/software
Requirements: Windows 98,Me,2000,XP Size: 246kb Description: ABOUT ChARMeD:
ChARMeD is a Windows Mobile / Pocket PC / Win CE (for ARM CPUs) Disassembler and Assembler
The name ChARMeD stands for:
Carolo's Hexadecimal ARM Editor and Disassembler
FEATURES:
· Disassemble a Windows CE Executable for ARM CPUs.
· Assemble instructions in ARM Assembler.
· Upload modified file to Windows CE Device.
· View MZ and PE Headers of executable.
· View Import Table of executable.
ASSEMBLER:
· Added NOP instruction 0x90909090, which is not part of the ARM instruction set, but nevertheless works because it is an undefined instruction.
· Supports all no operand instructions, Branches (Jumps) and instructions with two registers as operands.
DISASSEMBLER:
· Recognises 0x90909090 as NOP (see ASSEMBLER above)
· Supports all no operand instructions, Branches (Jumps) and double operand instructions.
ARM Classic Processors
ARM Infocenter
I think IDA is standard for this kinda reversing. If you can find a location where the DLL is called from in another app, you should be able to quickly identify at least the number and format of the parameters. Obviously you can also refer to the import/export tables for this.
V
Awsome bits of info to get me started ... thanks!!
Is a DLL signed?
And if it is, how does one know it? I use a tool from sysinternals called Sigcheck
Sigcheck
Verify that images are digitally signed and dump version information with this simple command-line utility.
One way to use the tool is to check for unsigned files in your \Windows\System32 directories with this command:
Code:
sigcheck -u -e c:\windows\system32
Though there are way more options than the example above.
As all reverse engineers/hackers or cooks you too should investigate the purpose of any files that are not signed.
Besides some nice sysinternals standard utilities, there's also;
SystemInternals_Suite
For obvious reasons I'm using not a direct link to the Suite. Therefore you need to click on it (on the left) yourself. There's a load of useful utilities there waiting to be downloaded by (would be) developers, power users and system / network administrators (are we not all).
If it is signed with a signature; you need to unsign it before editing it!
It's dead easy.
1) Copy your DLL from your phone to your PC. You may need to use ROMExtractor to do this if you have problems.
2) Unsign it using Unsigner. To do this download Unsigner and the Unsigner batch file here. Copy Unsigner, the Batch file and the dll from the phone to one directory and run the .bat file. It should tell you that the certificate has been removed.
3) Download Reshack
4) Open the dll from the phone using Reshack or the better not free PE Explorer
5) Do your editing.
6) Click Compile String at the top and then save the file.
7) Download Ssigner. Launch it and use Select File to select the DLL file you've just modified. Click Start Sign Process! When it's done check the text file that's created to make sure it signed properly.
8) Copy the file back to the Windows directory on the device using for PPC/handheld/CE free Total Commander. If necessary Reboot.
Kitchen Utils Reviewed gives links to programs a developer / cook needs!
Have fun edtinig, vewinig ,bwroisng, assilimating, copamirng and itengaritng your files,
o/~

How to Patch ARM Executable?

Hi everybody,
I must to patch an ARM executable. I use HTC with Windows Mobile 6.5.
Actually I installed IDA Pro. It is dissassembling my arm executable file but it doesnt let me to patch (assemble) it. When I click "Edit>Patch Program>Assemble" , It gives an error. (Sorry, This processor module doesnt support the assembler).
So , is there any dissassembler for ARM executables which let me to patch/edit binary like Ollydbg???
Or is there any way to patch it via IDA Pro??
Thanks...
Patching and assembling are two different things. In my experience, IDA even does not produce good enough 386 assembler source code for reassembling. But often you can patch exe's with a hex editor succesfully if you don't need extra code. You look up the location in IDA and patch it correspondingly in a hex editor.
Hi zzxq,
thanks for your reply.. I need to add extra code? So changing opcodes via Hex editor is not enough for me ... What can I do?
Depending on how the .text segment is aligned, you could possibly add some code there or overwrite functions you don't need and branch to them. If you have room in the .data segment you could mark it as executable. Extending the total code size would require more work; you'd certainly need tot adjust the .text segment size in the PE header and the start of the segments following the .text segment. Just some suggestions that may not work; I only have experience with in-place hacks that involve a few bytes.

Compiling my own Support library into JAR

(This is a repost from Stack Overflow, so if you prefer to earn points there see this question: http://stackoverflow.com/questions/17218475/build-android-support-library-into-jar )
We all know Android Support Library has bugs. Some of them trivial and not fixed for years. I need to fix a few of them, but... how do I compile ASL source into usable JAR? What I did until now - in Eclipse created a directory in which I've put all classes from support library source. I added android.jar to the project and it doesn't show any errors after this. Then I used "Export..." into jar, which finished with some warnings and a size very close to ariginal android-support-v13.jar. Unfortunately my Android application with this self-built library fails with lots of missing classes reported at runtime (meaning it compiles without a problem).

A sentence about usefulness of Resources

Hi
In "Hello Android" book that i am reading , there is a sentence about usefulness of Resources that i can't understand .
Please give me some help about it .
The paragraph is :
"The resource compiler compresses and packs your resources and then
generates a class named R that contains identifiers you use to reference
those resources in your program. This is a little different from standard
Java resources, which are referenced by key strings. Doing it this way
allows Android to make sure all your references are valid and saves
space by not having to store all those resource keys. Eclipse uses a
similar method to store and reference the resources in Eclipse plug-ins."
The underlined sentence has two part .
I understand part one in this way :
When there is some error in for example XML lay out files in Android project in Eclipse IDE ,
The IDE does not work correctly and some red signs are appeared next to files that have
error in left side project browser of Eclipse.
Is the thing that i understood is correct and complete ???
And about part two .
I cant understand it . What it says ??
Thanks for your help
peter.sorotokin said:
Hi
In "Hello Android" book that i am reading , there is a sentence about usefulness of Resources that i can't understand .
Please give me some help about it .
The paragraph is :
"The resource compiler compresses and packs your resources and then
generates a class named R that contains identifiers you use to reference
those resources in your program. This is a little different from standard
Java resources, which are referenced by key strings. Doing it this way
allows Android to make sure all your references are valid and saves
space by not having to store all those resource keys. Eclipse uses a
similar method to store and reference the resources in Eclipse plug-ins."
The underlined sentence has two part .
I understand part one in this way :
When there is some error in for example XML lay out files in Android project in Eclipse IDE ,
The IDE does not work correctly and some red signs are appeared next to files that have
error in left side project browser of Eclipse.
Is the thing that i understood is correct and complete ???
And about part two .
I cant understand it . What it says ??
Thanks for your help
Click to expand...
Click to collapse
Whenever you add a resource(image, raw file, drawable, etc) in your app package, a separate class named as R.java forms in your gen folder. This cannot be edited by you and can only be modified by the IDE. All your resources will be given a unique id by which you can refer to them from your Java classes. It will revert to the generated version if you try to modify it manually.
I guess that the way you understood the first part is correct. But it also applies to Java code. In the Android Java code you use these identifiers to load resources. You don't use hard-coded Strings. That way the compiler can check whether a resource with that name exists by checking whether the reference to the field in R is valid. If you had to put in hard-coded Strings, there would be no (easy) way to check that.
About the second part: I guess that it means that Strings need more storage space.
If we talk about usefulness of resources, this is a much bigger point to me: You can define different resources for portrait and landscape mode, for different countries, for different screen sizes, for different OS versions, etc. and Android cares about using the right one. You don't need to decide which one to use yourself.
You can also refer to them from Java and xml very easily. You just need to change one line of code to change a String that is used multiple times in your app. You can't forget one.
Link for a much more detailed description: http://developer.android.com/guide/topics/resources/overview.html (including the sub-topics)
However, I guess that you won't need that many details in the beginning. Your book should explain the most important things.

Categories

Resources