My final goal is to automate the following process:

  1. Load a PE executable (32 bits)
  2. Go to the program entry point
  3. Get the state of all the processor flags and the values in the registers
  4. Get the current instruction (operand+parameters, in hexadecimal or in assembly) and its adress offset
  5. [Do things with the informations I got in 3 and 4]
  6. Step through the instruction
  7. Go to 3. and repeat

Thus, I need a tool, a library (any programming language), or a debugger/disassembler that I can script to run step by step, and retrieve the state of the processor between 2 instructions calls.

Freeware/open source is a plus, but a paid software will be fine.


The GNU Debugger, (GDB), is able to step though the code one instruction at a time with inspection of the state of the processor registers. It is script-able in Python so you should be able to do what you need with completely free software, on most platforms and for the code produced in just about any programming language.

  • Exactly what I needed, thank you
    – Antoine C.
    Jul 29 '18 at 13:05

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.