Skip to content

Instantly share code, notes, and snippets.

@mhaskar
Last active November 9, 2023 19:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhaskar/d784a0a193e78a0f46b76924154887c7 to your computer and use it in GitHub Desktop.
Save mhaskar/d784a0a193e78a0f46b76924154887c7 to your computer and use it in GitHub Desktop.
Find DLL function address using python
#!usr/bin/python
'''
Description : find any windows function address from any DLL
Author : Askar @mohammadaskar2
'''
from ctypes import windll
import sys
if len(sys.argv) != 3:
print "Usage: ./find_address.py dll function"
sys.exit(0)
dll_file_name = sys.argv[1]
function_name = sys.argv[2]
kernel32 = windll.kernel32
h_kernel32 = kernel32.GetModuleHandleA(dll_file_name)
load_address = kernel32.GetProcAddress(h_kernel32, function_name)
print "[+]Process Address of %s.%s is %s" % (dll_file_name, function_name, hex(load_address))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment