question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

External references for raw binary

See original GitHub issue

Describe the bug Functions from external programs in raw binary file dispayed in decompiler as func_0x00009190 or func_0x1

To Reproduce Steps to reproduce the behavior:

  1. Load raw binary file (module of firmware), which contains calls of external functions.

  2. Load additional raw binary file (shared library for modules of firmware) and set it as external program.

  3. Open module of firmware in CodeBrowser and find undefined call of function 2019-03-10_135341_579834901

  4. Add external reference for CALL 2019-03-10_141449_360263728

    2019-03-10_135238_373525765

    Name of function in decompiler: 2019-03-10_135304_749179163

    or

    1. Create new block of memory (addresses of shared library).

    2. Create reference in called function. 2019-03-10_135605_340318275

      Name of function in decompiler: 2019-03-10_135615_665112316

Expected behavior Name of function in decompiler should be displayed as in external function.

Environment (please complete the following information):

  • OS: Linux
  • Java Version: 11.0
  • Ghidra Version: 9.0

Additional context How can I create external reference in idiomatic way for raw binaries? Adding external reference for all CALL (JMP and others) is a very time consuming process. Can I automate it without script?

How can I export functions (signatures too) from Exports of shared library to Import of module of firmware and synchronize them in future? I do it manually now: reverse engineering functions in shared library, then changing signatures in functions of Imports in module of firmware.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
saruman9commented, May 22, 2019

Could you make the script into a PR?

I developed the script in the context of the project at work (NDA). When I finish the project, I will make a PR. While you can use prototype.

1reaction
saruman9commented, Apr 27, 2020

As I promised, I’m publishing the script for finding external references in raw binaries. It’s far from ideal, but you can use it as example for developing more complex scripts/plugins.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to get gcc to output raw binary? - Stack Overflow
No external references, nothing to export to the linker. I'd like to get a small file with just the machine instructions for this...
Read more >
Raw Binary File (.rbf) Definition - Intel
rbf) containing configuration data for use outside the Quartus ® Prime software. A Raw Binary File contains the binary equivalent of a Tabular...
Read more >
Binary file - Wikipedia
A binary file is a computer file that is not a text file. The term "binary file" is often used as a term...
Read more >
Binary file | Databricks on AWS
Learn how to read data from binary files using Databricks. ... into a single record that contains the raw content and metadata of...
Read more >
BinaryRead - Wolfram Language Documentation
BinaryRead[stream] reads one byte of raw binary data from an input stream, and returns an integer from 0 to 255. BinaryRead[stream, type] reads...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found