Binary file processing utility module.
Generate C/C++ code from binary file.
::: tip API
binutils.bin2c(binaryfile: <string>, outputfile: <string>, opt: <table>)
:::
| Parameter | Description |
|---|---|
| binaryfile | Required. Input binary file path |
| outputfile | Required. Output C/C++ source file path |
| opt | Optional. Options: - linewidth: line width (default: 32) - nozeroend: do not append null terminator (default: false) |
Generate object file from binary file.
::: tip API
binutils.bin2obj(binaryfile: <string>, outputfile: <string>, opt: <table>)
:::
| Parameter | Description |
|---|---|
| binaryfile | Required. Input binary file path |
| outputfile | Required. Output object file path |
| opt | Optional. Options: - format: object format (coff, elf, macho) - symbol_prefix: symbol prefix (default: _binary_) - arch: architecture (default: x86_64) - plat: platform (default: macosx, only for macho) - basename: base name for symbols - target_minver: target minimum version (only for macho) - xcode_sdkver: Xcode SDK version (only for macho) - zeroend: append null terminator (default: false) |
Read symbols from object file (auto-detect format: COFF, ELF, or Mach-O).
::: tip API
binutils.readsyms(binaryfile: <string>)
:::
| Parameter | Description |
|---|---|
| binaryfile | Required. Input object file path |
| Return Value | Description |
|---|---|
<table> |
Symbols list |
Get dependent libraries.
::: tip API
binutils.deplibs(binaryfile: <string>)
:::
| Parameter | Description |
|---|---|
| binaryfile | Required. Input binary file path |
| Return Value | Description |
|---|---|
<table> |
Dependent libraries list |
Get rpath list from binary file (auto-detect format: ELF or Mach-O).
::: tip API
binutils.rpath_list(binaryfile: <string>)
:::
| Parameter | Description |
|---|---|
| binaryfile | Required. Input binary file path |
| Return Value | Description |
|---|---|
<table> |
Rpath list |
Extract static library to directory.
::: tip API
binutils.extractlib(libraryfile: <string>, outputdir: <string>, opt: <table>)
:::
| Parameter | Description |
|---|---|
| libraryfile | Required. Input static library file path |
| outputdir | Required. Output directory path |
| opt | Optional. Options (reserved) |