0
|
1 from pydc import *
|
5
|
2 import sys
|
|
3 import platform
|
0
|
4
|
5
|
5 if sys.platform == "win32":
|
0
|
6 libc = load("msvcrt")
|
5
|
7 elif sys.platform == "darwin":
|
0
|
8 libc = load("/usr/lib/libc.dylib")
|
5
|
9 elif "bsd" in sys.platform:
|
28
|
10 #libc = load("/usr/lib/libc.so")
|
|
11 libc = load("/lib/libc.so.7")
|
5
|
12 elif platform.architecture()[0] == "64bit":
|
|
13 libc = load("/lib64/libc.so.6")
|
0
|
14 else:
|
|
15 libc = load("/lib/libc.so.6")
|
|
16
|
|
17 fp_atoi = find(libc,"atoi")
|
|
18 fp_atof = find(libc,"atof")
|
|
19
|
5
|
20
|
|
21
|
28
|
22 def atoi(s): return call(fp_atoi,"Z)i",s)
|
|
23 def atod(s): return call(fp_atof,"Z)d",s)
|
0
|
24
|
28
|
25 print(atoi("3".join(["12","45"])))
|
|
26 print(atod("3".join(["12","45"])))
|
0
|
27
|