![]() For example, assembly vs C of the SkipSpace function (clickable): Mostly, the original code is slimmer and looks more optimized. It’s interesting to compare manually written assembly code with code generated by a compiler. I had to fix a couple of things manually, but after some tweaking, it actually worked! And after some more tweaks for 64-bit portability (mainly adjusting pointer vs integer types and pointer size constants), the compiled 64-bit library worked as well! Obviously, the code didn’t work right away. I was actually surprised that it was able to compile. Due to the fact that there’s no type correctness in assembly, GCC displayed more than 1,000 warnings, most of which complain about incompatibility of types. After some tweaking, I could get the code to compile. Then, I wrote a script which uses regular expression search/replace to translate every line of assembly to C. I had to manually change some of the exotic stuff (such as usage of the CARRY flag), but most of the code was ready for automatic translation. Most assembly commands can be translated to C as well. if/.while extensively, which can be easily translated to C. But I came up with a more creative idea: to port it to C first! After all, C is considered by some as a portable assembly. Perhaps it was possible to port the codebase to 64-bit MASM using macros and such. ![]() But how do I port an assembly codebase from 32-bit to 64-bit? I’m not familiar with MASM syntax, which the codebase uses. ![]() Also, I didn’t like the second option, so I’ve decided to port RAEdit. I looked for an alternative, but didn’t find a decent one. running the editor window as a separate 32-bit process. Finding an alternative editor component.While it’s somewhat similar to 64-bit x86 assembly, there’s no way to automatically port an assembly codebase from 32-bit to 64-bit. After porting the 32-bit version of the plugin, I realized that there’s a problem porting it to 64-bit: the RAEdit component is written in 32-bit x86 assembly. Recently, I’ve been working on a port of Multiline Ultimate Assembler for the 圆4_dbg debugger. It’s a great component, lightweight and simple to use. In the Multiline Ultimate Assembler plugin for OllyDbg, I use an editor component called RAEdit, written by KetilO in 32-bit x86 assembly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |