Python3でリバースエンジニアリング その2

前回リバースエンジニアリング ―Pythonによるバイナリ解析技法の続きで、今回は3.1章の前半。

 

my_debugger.py

  1. ...
  2.     def load(self, path_to_exe):
  3.         ...
  4.         if kernel32.CreateProcessA(path_to_exe.encode('utf-8'),
  5.                                    None,
  6.                                    None,
  7.                                    None,
  8.                                    None,
  9.                                    creation_flags,
  10.                                    None,
  11.                                    None,
  12.                                    byref(startupinfo),
  13.                                    byref(process_information)):
  14.             ...
  15.             print("[*] PID: {0}".format(process_information.dwProcessId))
  16.         else:
  17.             print("[*] Error: 0x{0:08x}".format(kernel32.GetLastError()))