1 post from 3 月 2009
- January
- February
- March
- April
- May
- June
- July
- August
- September
- October
- November
- December
In these days, Japanese perl mongers trying to inject a x86 binary code to the perl world with pure perl.
DynaLoader::dl_install_xsub inject binary code, that can call as CV(coderef).
Following is a sample code, call the fork(2).
use DynaLoader;
my $s = join('',
"\x31\xc0", # xor %eax,%eax
"\xb0\x02", # mov $0x2,%al
"\xcd\x80", # int $0x80
"\xc3", # ret
);
DynaLoader::dl_install_xsub(
'myfork',
unpack("L",pack("P*",$s))
);
&myfork;
Enjoy!