cisco-open / llvm-crash-analyzer

llvm crash analysis
Apache License 2.0
40 stars 17 forks source link

[TA] Fix calculateMemAddr for PC relative addresses #43

Closed niktesic closed 1 year ago

niktesic commented 1 year ago

Calculate Concrete Memory Address for PC relative addressing mode. Use PC register value at the next instruction program point as a base register. Compute next instruction PC value as current PC value plus an instruction size.

0x40059f: (size: 11) :   MOV64mi32 $rip, 1, $noreg, 2099886, $noreg, 6295616,
0x4005aa: (size: 3) :   $eax = MOV32rm $rbp, 1, $noreg, -4, $noreg,

In the example above, operand $rip + 2099886, corresponds to the address 0x40059f + 11 + 2099886.