#include <windows.h>
#include <stdio.h>
int APIENTRY WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
{
if(strlen(lpCmd)<1)	{MessageBox(0,"usage: exe2vbs filename\nor simply drag\'n\'drop your exe over this file\n\nother progs at:\nhttp://freenet.am/~zombie","z0mbie\'s exe->vbs converter",MB_OK);return 1;}
char drive[3];char dir[50];char path[200];char name[50];char ext[10];
_splitpath( lpCmd,drive,dir,name,ext);
_makepath(path,drive,dir,name,"vbs");

FILE* vbs=fopen(path,"w");
if(!vbs) MessageBox(0,"err","cannot open",MB_OK);
fputs("dim filesys, filetxt, getname, path, textfile, i\n",vbs);
fputs("textfile = \"zvbs.exe\"\n",vbs);
fputs("Set filesys = CreateObject(\"Scripting.FileSystemObject\")\n",vbs);
fputs("Set filetxt = filesys.CreateTextFile(textfile, True)\n",vbs);
fputs("getname = filesys.GetFileName(path)\n",vbs);
fputs("dim a\n",vbs);
fputs("a=Array(",vbs);
FILE* file=fopen(lpCmd,"rb");
unsigned char c;int count=0;
c=fgetc(file);
fprintf(vbs,"%u",c);
while(1)
	{
		c=fgetc(file);
		if(feof(file)) break;
		fprintf(vbs,",%i",c);
		count++;
	}
fputs(")\n",vbs);
fprintf(vbs,"for i=0 to %i\n",count);
fputs("filetxt.Write(chr(a(i)))\n",vbs);
fputs("next\n",vbs);
fputs("filetxt.Close\n",vbs);
fputs("dim z\n",vbs);
fputs("dim zz\n",vbs);
fputs("Const ForReading = 1, ForWriting = 2, ForAppending = 3\n",vbs);
fputs("const RemoteExe = \"zvbs.exe\"\n",vbs);
fputs("set zz = wscript.createobject(\"wscript.shell\")\n",vbs);
fputs("z = zz.run (\"zvbs.exe\")\n",vbs);
fputs("wscript.quit\n",vbs);
MessageBox(0,"done!","z0mbie\'s exe->vbs converter",MB_OK);
fclose(vbs);
return 0;

}
