Assuming this is an ELF or similarly structured binary, you should consider the address where the material is loaded, which is affected by things in the ELF header.
Using objdump -Fd
in your binary, you can have a disassembler that also displays the exact offset of the character file.
Using objdump -x
, you can find this bootloader address, usually 0x400000 for standard linux executables.
The next thing you need to be careful with is to see if its an indirect string, which you can do most easily using objdump -g
. When a string is found as an indirect string, in the position output by objdump -Fd
, you will not find the string, but the address. From this you must subtract the bootloader address again. Let me show you an example for one of my binaries:
objdump -Fd BIN | grep VersionString 45152f: 48 8b 1d 9a df 87 00 mov 0x87df9a(%rip),%rbx
So, we look at 0x8cf4d0 in the file and find in hexeditor:
008C:F4D0 D8 C1 89 00 00 00 00 00 01 00 00 00 FF FF FF FF
So, we take 0x89C1D8 there, subtract 0x400000 and have 0x49c1d8, and when we look there in the hexeditor, we find:
0049:C1D0 FF FF 7F 7F FF FF 7F FF 74 72 75 6E 6B 5F 38 30 0049:C1E0 34 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00
What does "trunk_8043" mean.
YMMV, especially when its a different file format, but itβs a common way to structure these things, with lots of warts and details that are rejected for special occasions.