Author Topic: Introducing the SED-Editor - Post Processor (PP)  (Read 3901 times)

0 Members and 1 Guest are viewing this topic.

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 929
  • User-Rate: +30/-4
    • it-berater
Introducing the SED-Editor - Post Processor (PP)
« on: August 24, 2007, 10:52:40 AM »
Those using Jose's excellent SED-Editor may have seen the small checkmark in the
Editor-Options->Call Post Processor.

Most will maybe never had an idea what its good for.
Let me introduce the SED-Post Processor. In short here: PP.

The PP is been called after you compiled a program to an EXE.
Therefore using the PP-commands, you can do any sort of automatic post-processing using the PP.

Post Processing is everything that you want to happen automatically after the compiler has compiled your ".bas"-file.

For example, you may want to use UPX.exe or other runtime-packers on your just compiled file.
The code for that would be:

Code: [Select]
'# SED_Block: Start
'# ?w ?prodir\upx.exe --all-methods ?file.exe
'# SED_Block: End

Lets break it into peaces:

This Line tells the PP that all following Lines are PP-Commands.
Code: [Select]
'# SED_Block: Start
The next line starts with a PP Command: ?w which means "run windows executable and wait"
The ?prodir\ will internally be replaced with the directory where the ".bas"-file is.
Together with the upx.exe this makes the filename for the ?w command to be executed*.
The PP knows more such "Special Folders", you find them below.
The last part of the line is a "Special Filename" the ?file.exe this will be replaced with the filename of the just compiled exe-file. There are more of these "Special Filenames" you find them below.

Code: [Select]
'# ?w ?prodir\upx.exe --all-methods ?file.exe
The following line tells the PP that he's ready.
Code: [Select]
'# SED_Block: End
Lets take a look on available PP Commands, these are:

?w - start executable and wait
?s - call Semen Matusovskiy's PE-Processor on a given filename
?f - Wait for File, this one will wait until a specified file exists

Now lets take a look on the available special folders:

?app\ - SED-Folder (Folder where SED.exe is)
?tmp\ - Windows-Temp-Folder
?prodir\ - Folder where the ".bas"-File whoich was compiled is.

These are the "special filenames"
?file.bas - this will be replaced with the name and path of the actual compiled ".bas"-file
?file.exe - this will be replaced with the name and path of the actual compiled ".exe"-file
?file - this will be replaced with the name and path of the actual compiled ".bas"-file but without file-extension
?fnoext - this is only the filename of the actual compiled file without any extension

Using these features, you can do any thinkable Post-Processing, automatically after compilation.

Here are two more examples:

Code: [Select]
' We want to use Semens PE-Preprozessor on the code and then UPX the result
'# SED_Block: Start
'# ?s ?prodir\?file.exe
'# ?w ?prodir\u9.exe --all-methods ?file.exe
'# SED_Block: End

Code: [Select]
' We want to use Semens PE-Preprozessor on the code after compilation, thats all
'# SED_Block: Start
'# ?s ?prodir\?file.exe
'# SED_Block: End

*If we would translate this PP-command into PB-code it would maybe look like this:
Code: [Select]
SHELL c:\myfolder\upx.exe --all-methods ?file.exe
« Last Edit: August 24, 2007, 06:50:12 PM by Theo Gottwald »

Offline Kent Sarikaya

  • Full Member
  • ***
  • Posts: 173
  • User-Rate: +8/-4
Re: Introducing the SED-Editor - Post Processor (PP)
« Reply #1 on: August 25, 2007, 12:34:56 AM »
Thanks Theo, we need more posts like this about these powerful programs that someone trying to learn is lost in setting up. Thanks!!!