Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getProcAddress in python for linux?

Tags:

python

linux

I'm working on a linux system. I know how to use nm and other gnu binutils, but I want to know if there is a better way to resolve function addresses using python. I don't want to have to parse a text response from a system call if there is a better way.

like image 708
rvorderm Avatar asked Jan 31 '26 09:01

rvorderm


1 Answers

If you want to call the function with type related, use ctypes. Or if you want to cal it dynamicaly without any types, use dl

import dl
dl.open("/lib/libc.so.6").call("time")

If you want to get symbol of function, use sym.

like image 78
mattn Avatar answered Feb 03 '26 00:02

mattn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!