خرید بک لینک

Vote count: 0

first of all am very at this and sorry for my bad english. I need for a project in university to disasemble binary files. Therefore i should use capstone. I tried weeks with java but it didnt work so since yesterday i teached myself a little Python. To read the Binary i tried file = open('binary_file') content = file.readlines() from this link: Reading Binary File (.out) in Python and disassemble with Capstone

and the instructions to disassemble from capstone http://www.capstone-engine.org/lang_python.html

i have the solutions from a online disassembler and the result is something more then 13000 rows. when i start my i only get one (0x1000: sc 0x2b ). I cant find the mistake because in my eyes its all right but i dont have any plan of Python or Capstone. I really hope someone can help me

By the Way the Testcode from the Capstone page works fine so its nothing wrong with the installation i think.

Code:

from capstone import *

file = open('C:/...sth', 'rb')
content = file.read()

ergebnism = open("C:/.../ergebnis.txt", "w")
mi = Cs(CS_ARCH_MIPS, CS_MODE_MIPS32)
for i in mi.disasm(content, 0x1000):    
    print("0x%x:t%st%s" %(i.address, i.mnemonic, i.op_str))
    #for (address, size, mnemonic, op_str) in mi.disasm_lite(content, 0x1000):    
    # print("0x%x:t%st%s" %(address, mnemonic, op_str))
    ergebnism.write("0x%x:t%st%s" %(i.address, i.mnemonic, i.op_str))
    ergebnism.write("n")
ergebnism.close()

file2 = open('C:/...erdb', 'rb')
content2 = file2.read()

ergebnisp = open("C:/.../ergebnisp.txt", "w")
pp = Cs(CS_ARCH_PPC, CS_MODE_64)
for i in pp.disasm(content, 0x1000):
    print("0x%x:t%st%s" %(i.address, i.mnemonic, i.op_str))
    #for (address, size, mnemonic, op_str) in pp.disasm_lite(content2, 0x1000):
    #print("0x%x:t%st%s" %(address, mnemonic, op_str))
    ergebnisp.write("0x%x:t%st%s" %(i.address, i.mnemonic, i.op_str))
    ergebnisp.write("n")
ergebnisp.close()

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 12 ارديبهشت 1395 ساعت: 2:29

صفحه بندی