|
| 1 | +Quick Start |
| 2 | +=========== |
| 3 | + |
| 4 | +Installation |
| 5 | +------------ |
| 6 | +This package can be installed on Linux, macOS, and Windows platforms for recent (3.8+) versions of both CPython and |
| 7 | +PyPy. Wheels are provided for several configurations. You can install the latest release from PyPI using ``pip``: |
| 8 | + |
| 9 | +.. code:: bash |
| 10 | +
|
| 11 | + pip install pypcode |
| 12 | +
|
| 13 | +You can also install the very latest development version from this repository using ``pip``: |
| 14 | + |
| 15 | +.. code:: bash |
| 16 | +
|
| 17 | + pip install --user https://github.com/angr/pypcode/archive/refs/heads/master.zip |
| 18 | +
|
| 19 | +You can now invoke the ``pypcode`` module from command line to translate supported machine code to P-code from command |
| 20 | +line. Run ``python -m pypcode --help`` for usage information. See module source(``__main__.py``) for examples of using |
| 21 | +pypcode as a library. |
| 22 | + |
| 23 | +Command Line Usage Example |
| 24 | +-------------------------- |
| 25 | +:: |
| 26 | + |
| 27 | + $ python -m pypcode -b x86:LE:64:default test-x64.bin |
| 28 | + -------------------------------------------------------------------------------- |
| 29 | + 00000000/2: XOR EAX,EAX |
| 30 | + -------------------------------------------------------------------------------- |
| 31 | + 0: CF = 0x0 |
| 32 | + 1: OF = 0x0 |
| 33 | + 2: EAX = EAX ^ EAX |
| 34 | + 3: RAX = zext(EAX) |
| 35 | + 4: SF = EAX s< 0x0 |
| 36 | + 5: ZF = EAX == 0x0 |
| 37 | + 6: unique[0x2580:4] = EAX & 0xff |
| 38 | + 7: unique[0x2590:1] = popcount(unique[0x2580:4]) |
| 39 | + 8: unique[0x25a0:1] = unique[0x2590:1] & 0x1 |
| 40 | + 9: PF = unique[0x25a0:1] == 0x0 |
| 41 | + |
| 42 | + -------------------------------------------------------------------------------- |
| 43 | + 00000002/2: CMP ESI,EAX |
| 44 | + -------------------------------------------------------------------------------- |
| 45 | + 0: CF = ESI < EAX |
| 46 | + 1: OF = sborrow(ESI, EAX) |
| 47 | + 2: unique[0x5180:4] = ESI - EAX |
| 48 | + 3: SF = unique[0x5180:4] s< 0x0 |
| 49 | + 4: ZF = unique[0x5180:4] == 0x0 |
| 50 | + 5: unique[0x2580:4] = unique[0x5180:4] & 0xff |
| 51 | + 6: unique[0x2590:1] = popcount(unique[0x2580:4]) |
| 52 | + 7: unique[0x25a0:1] = unique[0x2590:1] & 0x1 |
| 53 | + 8: PF = unique[0x25a0:1] == 0x0 |
| 54 | + |
| 55 | + -------------------------------------------------------------------------------- |
| 56 | + 00000004/2: JBE 0x17 |
| 57 | + -------------------------------------------------------------------------------- |
| 58 | + 0: unique[0x18f0:1] = CF || ZF |
| 59 | + 1: if (unique[0x18f0:1]) goto ram[0x17:8] |
0 commit comments