Skip to content

Instantly share code, notes, and snippets.

@deeso
Last active January 2, 2016 06:19
Show Gist options
  • Save deeso/8263247 to your computer and use it in GitHub Desktop.
Save deeso/8263247 to your computer and use it in GitHub Desktop.
Radare Python example that loads a bin object using the "zip://" URI. Note the core.file_open first, and then the call to core.bin_load with a None object. This will trigger the bin object to be loaded from the IO layer. The core.cmd0 will execute the commands, 'af' and then 'pdf'. 'af' will analyse the functions, and the 'pdf' will print the di…
def flush(c):
k = c.cons
k.flush()
def exec_(c, cmd):
c.cmd0(cmd)
k = c.cons
k.flush()
from r2.r_core import RCore
core = RCore()
path = 'zip:///adobe.jar'
zip_path = path + '//WebEnhancer.class'
f = core.file_open(path, False, 0)
f = core.file_open(zip_path, False, 0)
core.bin_load(None, 0)
core.cmd0('af')
core.cmd0('pdf')
flush(core)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment