Lancern / asm2vec

An unofficial implementation of asm2vec as a standalone python package
160 stars 38 forks source link

how did you get the assembly code from binary? #8

Open smithCoderLeo opened 3 years ago

smithCoderLeo commented 3 years ago

Hi, I want to know how did you get the assembly code from binary? What tools did you use? And can the tool mark the function boundary in assembly code? Thanks for your help!

zeze-zeze commented 3 years ago

It seems that the format of the assembly have to be parsed by yourself from either r2pipe, objdump, or gcc -S

smithCoderLeo commented 3 years ago

It seems that the format of the assembly have to be parsed by yourself from either r2pipe, objdump, or gcc -S

i want use IDA pro,but i think the .asm's format is not suitable for this model

bjchan9an commented 3 years ago

It seems that the format of the assembly have to be parsed by yourself from either r2pipe, objdump, or gcc -S

i want use IDA pro,but i think the .asm's format is not suitable for this model

Try IDAPython ;)

smithCoderLeo commented 3 years ago

It seems that the format of the assembly have to be parsed by yourself from either r2pipe, objdump, or gcc -S

i want use IDA pro,but i think the .asm's format is not suitable for this model

Try IDAPython ;)

hi,did you mean use IDAPython generate the format like estimate.s ? thank you very much

bjchan9an commented 3 years ago

Use GetMnem() and GetOpnd() to get the assembly code.

smithCoderLeo commented 3 years ago

Use GetMnem() and GetOpnd() to get the assembly code.

thank you very much, and another question is how to construct flowchart?

bjchan9an commented 3 years ago

idaapi.FlowChart(idaapi.get_func(func_addr))

For more examples you can see, https://github.com/idapython/src/blob/master/examples/core/dump_flowchart.py

smithCoderLeo commented 3 years ago

Use GetMnem() and GetOpnd() to get the assembly code.

thank you very much!

smithCoderLeo commented 3 years ago

idaapi.FlowChart(idaapi.get_func(func_addr))

For more examples you can see, https://github.com/idapython/src/blob/master/examples/core/dump_flowchart.py

thank you very much!

oalieno commented 3 years ago

https://github.com/oalieno/asm2vec-pytorch I have made an implementation of asm2vec using pytorch. And the repo also include a tool to extract functions from binary.