embedded perl interpreter in cmd.exe

All development related issues welcome

Moderator: Moderator Team

Post Reply
HansH
Posts: 9
Joined: Fri Dec 31, 2010 12:23 am
Location: Netherlands

embedded perl interpreter in cmd.exe

Post by HansH »

I have been playing with the cmd.exe and I am using it under windows (sorry)
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
Another extention is that I can execute encrypted scripts with it. But.... I can't publish the code of that specific fileread function because then anyone can build a new cmd.exe which just displays the code, in effect making the whole encryption useless..

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..

Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Re: embedded perl interpreter in cmd.exe

Post by Z98 »

The embedded perl interpreter is probably overkill.

hto
Developer
Posts: 2193
Joined: Sun Oct 01, 2006 3:43 pm

Post by hto »

I can't publish the code of that specific fileread function because then anyone can build a new cmd.exe which just displays the code, in effect making the whole encryption useless..
Why? Publish the code, just do not put a decription key in it. Keep the key in the registry or in some configuration file.

Post Reply

Who is online

Users browsing this forum: DotBot [Crawler] and 1 guest