Skip to content

Instantly share code, notes, and snippets.

@mhaskar mhaskar/find_address.py
Last active Oct 4, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.