from capstone import * def disassemble_file(file_path): with open(file_path, 'rb') as f: binary_data = f.read() # Initialize the disassembler md = Cs(CS_ARCH_X86, CS_MODE_64) # Specify the architecture and mode (64-bit in this example) # Disassemble the binary data for i in md.disasm(binary_data, 0x0): print(f"0x{i.address:x}:\t{i.mnemonic}\t{i.op_str}") if __name__ == "__main__": # Specify the path to the executable file exe_path = "path/to/your/file.exe" # Call the disassembly function disassemble_file(exe_path)