OverflowError: in method 'SBProcess_ReadPointerFromMemory', argument 2 of type 'lldb::addr_t'

You are right, it seems the argument is out of range, both vtableAddr and vtableAddr-8 are “8.5” byte long. Maybe there is something wrong with the way I get vtableAddress? I will clean up my full script and send it to you if the following does not provide enough information, thanks much.

def vtable_addr (vtableSymbol):

return vtableSymbol.addr.section.file_addr + vtableSymbol.addr.offset + 0x10

vtableAddr, type=<type ‘long’>, value=0x1000000000000000f

vtableAddr-8, type=<type ‘long’>, value=0x10000000000000007

Traceback (most recent call last):

File “”, line 1, in

File “/home/leikong/repo/WindowsFabric/build.prod/test/fabdbg.py”, line 199, in findall

findtypes(pattern,ignorePureVirtualType)

File “/home/leikong/repo/WindowsFabric/build.prod/test/fabdbg.py”, line 156, in findtypes

if ignorePureVirtualType and has_pure_virtual(vtableAddr, pureVirtualFuncs) :

File “/home/leikong/repo/WindowsFabric/build.prod/test/fabdbg.py”, line 100, in has_pure_virtual

vtableEndAddr = lldb.process.ReadPointerFromMemory(vtableAddr-8, error)

File “/home/leikong/bin/lldb/lib/python2.7/site-packages/lldb/init.py”, line 9418, in ReadPointerFromMemory

return _lldb.SBProcess_ReadPointerFromMemory(self, addr, error)

OverflowError: in method ‘SBProcess_ReadPointerFromMemory’, argument 2 of type ‘lldb::addr_t’

You are right, it seems the argument is out of range, both vtableAddr and vtableAddr-8 are “8.5” byte long. Maybe there is something wrong with the way I get vtableAddress? I will clean up my full script and send it to you if the following does not provide enough information, thanks much.

def vtable_addr (vtableSymbol):
    return vtableSymbol.addr.section.file_addr + vtableSymbol.addr.offset + 0x10

You actually want to get the load address when reading from memory. This should be:

def vtable_addr (vtableSymbol, target):
    return vtableSymbol.addr.GetLoadAddress(target) + 0x10

You are right, it seems the argument is out of range, both vtableAddr and vtableAddr-8 are “8.5” byte long. Maybe there is something wrong with the way I get vtableAddress? I will clean up my full script and send it to you if the following does not provide enough information, thanks much.

def vtable_addr (vtableSymbol):
   return vtableSymbol.addr.section.file_addr + vtableSymbol.addr.offset + 0x10

You actually want to get the load address when reading from memory. This should be:

def vtable_addr (vtableSymbol, target):
   return vtableSymbol.addr.GetLoadAddress(target) + 0x10

If you actually wanted the file address of vtableSymbol's address, then you would do this:

def vtable_addr (vtableSymbol, target):
   return vtableSymbol.addr.GetFileAddress() + 0x10

No need to do the section + offset math yourself.