1

I'm looking for tools to:

  1. Disassemble a function from a x86 Windows executable into an asm file.
  2. Edit the file.
  3. Assemble the file again into an object file that can then be linked into a DLL.
  4. Inject this DLL into the original target executable.

What disassembler and assembler combo allows me to do this ?

I'm currently using Visual Studio 2013 to inject C++ code which works fine but being able to edit the original assembly code without having to translate it to C++ first would be a nice improvement.

1

I'm currently using Visual Studio 2013 to inject C++ code which works fine but being able to edit the original assembly code without having to translate it to C++ first would be a nice improvement.

If you're using Visual Studio 2013, you don't need to translate the assembly code into C++. Just use __asm.

6
  • Right, but I'd still need something to disassemble parts of the original binary into something that can be reassembled with __asm. – XTF Sep 6 '14 at 16:40
  • Your original question makes it sound like you already have the assembly code. You may want to reword your question to make it more clear. – Jason Geffner Sep 6 '14 at 18:37
  • Just FYI, the __asm feature does not work for 64-Bit projects; you need to create a separate .asm and compile with the MS macro-assembler. – JamalS Sep 6 '14 at 19:54
  • It's about a x86 game (Red Alert 2), so that's not an issue. – XTF Sep 7 '14 at 11:41
  • It sounds like you'd be better off hooking the target function than going through the rigmarole you outlined above. Check out research.microsoft.com/en-us/projects/detours – Jason Geffner Sep 7 '14 at 15:29
1

disassembling the whole thing to something reassembleable is a huge feat, with high potential for errors if theres no reloc information or other things to 'assist' the disassembly.. i dont know of anything that will do this entirely.. there were old programs like sourcer etc in the dos days, but even then they got close, but not perfect.. what you're looking for i dont think exists.. yet

2
  • I'd like to do it one (or a few) functions at a time, not the whole executable at once. – XTF Sep 6 '14 at 16:39
  • hmm well the ida is probably good for that, i've done it myself, but it does require careful analysis of the code, the data blocks it access and other functions it calls.. i hope your target function is small :) – evlncrn8 Sep 6 '14 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.