load without any analysis (file header at offset 0x0): r2 -n /path/to/file
- analyze all:
aa - show sections:
iS - list functions:
afl - list imports:
ii - list entrypoints:
ie - seek to function:
s sym.main
| import re | |
| from collections import namedtuple | |
| ASCII_BYTE = " !\"#\$%&\'\(\)\*\+,-\./0123456789:;<=>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\]\^_`abcdefghijklmnopqrstuvwxyz\{\|\}\\\~\t" | |
| String = namedtuple("String", ["s", "offset"]) |
| digraph structs { | |
| node [shape=plaintext, style="rounded", fontname="courier"] | |
| struct1 [label=< <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> <TR><TD>left</TD><TD PORT="f1">mid dle</TD><TD PORT="f2">right</TD></TR> </TABLE>>]; | |
| struct2 [label=< <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> <TR><TD PORT="f0">one</TD><TD>two</TD></TR> </TABLE>>]; | |
| struct3 [label=< | |
| <TABLE BORDER="1" CELLBORDER="0"> |
| #!/usr/bin/env python | |
| ''' | |
| some documentation | |
| author: Willi Ballenthin | |
| email: willi.ballenthin@gmail.com | |
| website: https://gist.github.com/williballenthin/f88c5c95f3e41157de3806dfbeef4bd4 | |
| ''' | |
| import sys | |
| import logging |
I hereby claim:
To claim this, I am signing this object:
| ''' | |
| IDAPython plugin that adds the contents of a file as a new segment in an existing idb. | |
| Prompts the user for: | |
| - file path | |
| - segment name | |
| - segment starting offset | |
| Useful for reversing engineering packed software and shellcode. | |
| Author: Willi Ballenthin <william.ballenthin@fireeye.com> |
| import sys | |
| import logging | |
| from collections import namedtuple | |
| import requests | |
| import bs4 | |
| from bs4 import BeautifulSoup | |
| logger = logging.getLogger(__name__) |
| ''' | |
| IDAPython script that generates a YARA rule to match against the | |
| basic blocks of the current function. It masks out relocation bytes | |
| and ignores jump instructions (given that we're already trying to | |
| match compiler-specific bytes, this is of arguable benefit). | |
| If python-yara is installed, the IDAPython script also validates that | |
| the generated rule matches at least one segment in the current file. | |
| author: Willi Ballenthin <william.ballenthin@fireeye.com> |