Extract Module

Description

With the extract module, you can cut bytes from a binary file. It is also possible to extract data sections. This can be particularly useful when developing shellcodes.

Command

shencode core extract [-h] [-i INPUT] [-o OUTPUT] [-e EXTRACT_RANGE EXTRACT_RANGE] [-s EXTRACT_SECTION]
                                [-so START_OFFSET] [-eo END_OFFSET]

options:
  -h, --help            show this help message and exit
  -i, --input           Input file for example module
  -o, --output          Output file with extracted bytes

Extract data:
  -e, --extract-range   Defines the range to extract, takes 2 arguments: -e 100 150
  -s, --extract-section
                        Extract a section from exe, dll, obj

Deprecated, will be removed in a future release:
  -so, --start-offset   begin extraction from this offset
  -eo, --end-offset     extract until here

Example output

shencode core extract --input calc.o --output extract.bin --extract-range 10 35

[BYTE-XTRACT0R]-[2.1.3]

[*] Try to open file calc.o
[+] File calc.o loaded
[+] Size of shellcode 721 bytes
[+] Hash: f8af704c8b7cb8f5e4369bfa3213a4d275f33fcd
[*] Try to extract bytes from 10 to 35
[*] Writing to file...
[+] File extract.bin created
[+] Size 25 bytes
[+] Hash: 55272d1e6eb5d67c72b6913621aad864b162ed20
[+] DONE!

JSON Parameter

Arguments Values Type
input filename str
ouput filename str
extract_range x, y int
extract_section .section_name str