ちょっとだけ書いてみた
from ctypes import cast, CFUNCTYPE, c_char_p, c_int buffer = ''.join([ "\x31\xc0", "\xb0\x02", "\xcd\x80", "\xc3" ]) ptr = cast(c_char_p(buffer), CFUNCTYPE(c_int)) ptr() print "fork"
from ctypes import cast, CFUNCTYPE, c_char_p, c_int buffer = ''.join([ "\x31\xc0", "\xb0\x02", "\xcd\x80", "\xc3" ]) ptr = cast(c_char_p(buffer), CFUNCTYPE(c_int)) ptr() print "fork"