0

I'm running a Unity Android application, using ADB from a Windows machine.

By using ADB and logcat, I'm able to get the runtime logs with stack traces (with hex addresses).

Now I want to use the hex addresses to get the actual lines of code, using a command line tool, e.g. aarch64-linux-android-addr2line.exe, however this always returns a result like

?? ??:0

The problem seems to be that the addresses in the log output are completely different to the addresses of the debug symbols. I've used a utility, nm.exe, which lists all the symbols.

In my log file, most of the addresses look like this (10 digits):

0x76e62ed130
0x76e3cf9f84
0x76e3cf9df8

Using nm.exe, the addresses look like this (6 or 7 digits):

0000000000f51c98
0000000004cdc260
0000000000f460d4

I suppose there are two questions here:

Firstly, am I right, that these addresses should match, or am I completely clueless? Secondly, why don't they match, and what can I do to make them match, so that I can get the stack trace?

Stephen Oberauer
  • 5,237
  • 6
  • 53
  • 75
  • 1
    That is because of ASLR. To make certain attacks harder each library is loaded to a random base address. So you have to distract actual base address from the addresses shown in stack traces to get the real address. The addressed shown in `nm`, Ghidra, IDA, ... then may be still a bit different as those tools usually add their own fixed base address. See e.g. https://stackoverflow.com/questions/21972148/aslr-and-addresses – Robert May 02 '23 at 11:17

0 Answers0