Sending a exe file as a text file.

 

We first create a simple exe file b.exe in the root directory from b.c as follows.

 

b.c

#include <windows.h>

int _stdcall WinMain(HINSTANCE i , HINSTANCE j , char *k , int l)

{

MessageBox(0,"hi", "hi" , 0);

}

 

cl b.c user32.lib

 

We then run the OLE packager program packager and click on the menu file, Import and choose b.exe from the root directory.  This shows us the file name in the two panes. We chose the menu option Edit and then Copy package to make a copy of this exe file in the clipboard. We close packager and start wordpad.

 

We click on Edit , Paste and see the exe file b.exe pasted in our wordpad document. We save this file as b.rtf.  We next run a copy of notepad and open the file b,rtf and see lots of hex numbers. We choose the entire file using menu edit ,select all and then copy the entire text.

 

We then create a new e-mail to be send and copy the entire file as the contents of the e-mail. Thus we are now sending a exe file  as plain text. When we receive the same e-mail we select the entire text and paste this text in a empty notepad document. We save this file as c.txt. We then rename it to c.rtf and open it in wordpad. What we see the same file b.exe which if we click on in wordpad it will execute b.exe after giving us a warning which we ignore.

 

This is how we can receive a exe file as a text file by passing all the checks placed.