2018-05-18 03:58:28 +05:30
|
|
|
import ctypes, os, sys
|
2018-05-16 03:34:53 +05:30
|
|
|
|
2018-05-18 02:30:52 +05:30
|
|
|
def loadlibc():
|
|
|
|
sharedlib = './lib3ddevil1.so'
|
|
|
|
libc = None
|
2018-05-18 03:58:28 +05:30
|
|
|
os.environ['PATH'] = os.path.abspath(
|
|
|
|
os.path.join(
|
|
|
|
os.path.dirname(__file__), "../")) \
|
|
|
|
+ ';' \
|
|
|
|
+ os.environ['PATH']
|
2018-05-18 02:30:52 +05:30
|
|
|
try:
|
|
|
|
libc = ctypes.cdll.LoadLibrary(sharedlib)
|
|
|
|
except OSError as e:
|
|
|
|
print("Error loading dynamically linked library.\nOSError: " + str(e))
|
2018-05-18 05:28:45 +05:30
|
|
|
raise RuntimeError("Couldn't load %s" % sharedlib)
|
2018-05-18 03:37:17 +05:30
|
|
|
return libc
|
2018-05-16 03:34:53 +05:30
|
|
|
|
2018-05-18 03:58:28 +05:30
|
|
|
libc = loadlibc()
|