[x] I have reviewed the OFRAK contributor guide and attest that this pull request is in accordance with it.
One sentence summary of this PR (This should go in the CHANGELOG!)
Fix Ghidra serializing negative 64-bit addresses
Link to Related Issue(s)
N/A
Please describe the changes in your request.
The OFRAK Ghidra scripts use %d string format of long integers when building JSON messages. In Java, this will be a signed decimal, but OFRAK expects an unsigned decimal. This causes problems in 64-bit Linux kernels, where commonly the address space is in the negative range. This change uses Long.toUnsignedString to format all long integers as unsigned before serializing to JSON. This PR also adds a test case which uses an elf with a negative address range.
Anyone you think should look at this, specifically?
@whyitfor @SamL98
One sentence summary of this PR (This should go in the CHANGELOG!)
Link to Related Issue(s) N/A
Please describe the changes in your request. The OFRAK Ghidra scripts use
%d
string format of long integers when building JSON messages. In Java, this will be a signed decimal, but OFRAK expects an unsigned decimal. This causes problems in 64-bit Linux kernels, where commonly the address space is in the negative range. This change usesLong.toUnsignedString
to format all long integers as unsigned before serializing to JSON. This PR also adds a test case which uses an elf with a negative address range.Anyone you think should look at this, specifically? @whyitfor @SamL98