B2R2-org / B2R2

B2R2 is a collection of useful algorithms, functions, and tools for binary analysis.
https://b2r2.org
MIT License
418 stars 62 forks source link

[Question] Dose the newest version B2R2 v0.5.0 support python? #40

Closed wqqqy closed 3 years ago

wqqqy commented 3 years ago

Dose the newest version B2R2 v0.5.0 support python?

sangkilc commented 3 years ago

Yes it should work with any language that supports .NET 5. For example, it should work with IronPython.

wqqqy commented 3 years ago

Yes it should work with any language that supports .NET 5. For example, it should work with IronPython.

So how to import B2R2?

sangkilc commented 3 years ago

I didn't test it, but you should do something like this:

import clr
import os, sys
sys.path.append(os.path.abspath(r'path-to-b2r2-dll-files')) # fix this
clr.AddReferenceToFile(r'B2R2.Core.dll')
clr.AddReferenceToFile(r'B2R2.FrontEnd.BinInterface.dll')
# Add more dlls if you need

from B2R2 import *
from B2R2.FrontEnd.BinInterface import *
# use B2R2 ...
wqqqy commented 3 years ago
clr.AddReferenceToFile(r'B2R2.Core.dll')
clr.AddReferenceToFile(r'B2R2.FrontEnd.BinInterface.dll')
# Add more dlls if you need

Thanks a lot. I am testing it.