asm2vec icon indicating copy to clipboard operation
asm2vec copied to clipboard

how did you get the assembly code from binary?

Open smithCoderLeo opened this issue 4 years ago • 10 comments

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!

smithCoderLeo avatar Dec 23 '20 12:12 smithCoderLeo

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

zeze-zeze avatar Dec 23 '20 12:12 zeze-zeze

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

smithCoderLeo avatar Dec 23 '20 12:12 smithCoderLeo

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 ;)

bjchan9an avatar Jan 03 '21 12:01 bjchan9an

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

smithCoderLeo avatar Jan 05 '21 09:01 smithCoderLeo

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

bjchan9an avatar Jan 05 '21 13:01 bjchan9an

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

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

smithCoderLeo avatar Jan 07 '21 03:01 smithCoderLeo

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

bjchan9an avatar Jan 08 '21 00:01 bjchan9an

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

thank you very much!

smithCoderLeo avatar Jan 12 '21 12:01 smithCoderLeo

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!

smithCoderLeo avatar Jan 12 '21 12:01 smithCoderLeo

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.

oalieno avatar Feb 13 '21 15:02 oalieno