This worked so well, that I started extending it.
I posted some general modifications on bugzilla, but I didn't do that with some others, because I don't know if it is in the context of the cmd.exe in the reactos project.
So what I did is that I extended the default cmd.exe with:
- a hook for a different fileread function
- a hook to be able to add custom commands
- a hook for intercepting file execution
- added an integrated (embedded) perl interpreter
Now with those adaptions I can excute any .cmd or .pl script or use perl inside a .cmd script
for example:
Code: Select all
@echo off
set var1=123
perlcall :plfunc
echo %var1%
goto end
:plfunc
print "we are in perl !\n";
$ENV{var1}=234;
1;
:END
I have put the version without the encrypt/decrypt function on my website ( http://www.atbas.org/pcmd )
The zip file contains the full project and sourcecode as well as a precompiled basic cmd.exe and the pcmd.exe which will execute perl and cmd code and an example test.cmd and test.pl
I am still trying to figure out how I also can hand out a (binary) version of the pcmd.exe which supports encryption without breaking the GPL license... Basicly it is the same code as in the pcmd project, only the plc_fn function differs.
Any comments/suggestions are welcome..