# core.base.binutils Binary file processing utility module. ## binutils.bin2c Generate C/C++ code from binary file. ### Function Prototype ::: tip API ```lua binutils.bin2c(binaryfile: , outputfile: , opt: ) ``` ::: ### Parameter Description | 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) | ## binutils.bin2obj Generate object file from binary file. ### Function Prototype ::: tip API ```lua binutils.bin2obj(binaryfile: , outputfile: , opt:
) ``` ::: ### Parameter Description | 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) | ## binutils.readsyms Read symbols from object file (auto-detect format: COFF, ELF, or Mach-O). ### Function Prototype ::: tip API ```lua binutils.readsyms(binaryfile: ) ``` ::: ### Parameter Description | Parameter | Description | |-----------|-------------| | binaryfile | Required. Input object file path | ### Return Value | Return Value | Description | |--------------|-------------| | `
` | Symbols list | ## binutils.deplibs Get dependent libraries. ### Function Prototype ::: tip API ```lua binutils.deplibs(binaryfile: ) ``` ::: ### Parameter Description | Parameter | Description | |-----------|-------------| | binaryfile | Required. Input binary file path | ### Return Value | Return Value | Description | |--------------|-------------| | `
` | Dependent libraries list | ## binutils.rpath_list Get rpath list from binary file (auto-detect format: ELF or Mach-O). ### Function Prototype ::: tip API ```lua binutils.rpath_list(binaryfile: ) ``` ::: ### Parameter Description | Parameter | Description | |-----------|-------------| | binaryfile | Required. Input binary file path | ### Return Value | Return Value | Description | |--------------|-------------| | `
` | Rpath list | ## binutils.extractlib Extract static library to directory. ### Function Prototype ::: tip API ```lua binutils.extractlib(libraryfile: , outputdir: , opt:
) ``` ::: ### Parameter Description | Parameter | Description | |-----------|-------------| | libraryfile | Required. Input static library file path | | outputdir | Required. Output directory path | | opt | Optional. Options (reserved) |