Facebook
From moi, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 73
  1. from capstone import *
  2.  
  3. def disassemble_file(file_path):
  4.     with open(file_path, 'rb') as f:
  5.         binary_data = f.read()
  6.  
  7.     # Initialize the disassembler
  8.     md = Cs(CS_ARCH_X86, CS_MODE_64)  # Specify the architecture and mode (64-bit in this example)
  9.  
  10.     # Disassemble the binary data
  11.     for i in md.disasm(binary_data, 0x0):
  12.         print(f"0x{i.address:x}:\t{i.mnemonic}\t{i.op_str}")
  13.  
  14. if __name__ == "__main__":
  15.     # Specify the path to the executable file
  16.     exe_path = "path/to/your/file.exe"
  17.  
  18.     # Call the disassembly function
  19.     disassemble_file(exe_path)
  20.  

Replies to oui rss

Title Name Language When
Re: oui moi python 1 Year ago.
captcha