Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions pydbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,31 @@ def func_resolve (self, dll, function):

return address


####################################################################################################################
def func_offset (self, dll, function):
'''
Utility function that resolves the offset of a given module / function name pair.

@see: func_offset()

@type dll: String
@param dll: Name of the DLL (case-insensitive)
@type function: String
@param function: Name of the function to resolve (case-sensitive)

@rtype: DWORD
@return: Offset
'''

handle = kernel32.LoadLibraryA(dll)
address = kernel32.GetProcAddress(handle, function)
offset = address-handle

kernel32.FreeLibrary(handle)

return offset


####################################################################################################################
def func_resolve_debuggee (self, dll_name, func_name):
Expand Down