• Welcome to Jose's Read Only Forum 2023.

Introducing the SED-Editor - Post Processor (PP)

Started by Theo Gottwald, August 24, 2007, 10:52:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

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:

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

'# ?w ?prodir\upx.exe --all-methods ?file.exe

The following line tells the PP that he's ready.
'# 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:

' 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

' 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:
SHELL c:\myfolder\upx.exe --all-methods ?file.exe

Kent Sarikaya

Thanks Theo, we need more posts like this about these powerful programs that someone trying to learn is lost in setting up. Thanks!!!