#include #install.asm #this is the ep install program. this is a stub which is combined with #a compressed archive which is composed of a set of compressed files #--this archive and binding to the stub is done by sfx.exe. #when run it first gathers info about the install dir and so on #when the final ok to install is given ,it reads itself and finds #the header created by sfx.exe and thus having the files begining,end #and name info extracts them one by one to a tmpfile and then uses #the functions provided by the lz32.dll to expand the files into #a destination directory .it also creates epsetup.log containing the #list of files installed with full path for use by the uninstaller #for more info on the directory operations see dir.asm #Please drop me an email for any clarifications,suggestions,comments begin imports [Kernel32.dll] CreateDirectoryA SetCurrentDirectoryA GetCurrentDirectoryA GetWindowsDirectoryA DeleteFileA TerminateProcess FreeConsole GetModuleHandleA GetCommandLineA LoadLibraryA ExitProcess GlobalAlloc GlobalSize GlobalFree GlobalReAlloc Sleep CreateFileA ReadFile WriteFile CloseHandle GetFileSize CreateThread CreateProcessA SuspendThread ResumeThread ExitThread TerminateThread [user32.dll] DlgDirListA RegisterClassExA CreateWindowExA ShowWindow UpdateWindow DefWindowProcA GetMessageA TranslateMessage DispatchMessageA SendMessageA LoadCursorA LoadIconA LoadMenuA BeginPaint EndPaint DrawTextA GetClientRect PostQuitMessage MessageBoxA SetForegroundWindow SetActiveWindow BringWindowToTop FindWindowA DestroyWindow PostMessageA CreatePopupMenu AppendMenuA SetMenu CreateMenu GetCursorPos TrackPopupMenu SetFocus [gdi32.dll] CreateFontIndirectA Rectangle CreateSolidBrush SelectObject SetBkMode ExtFloodFill CreatePen SetTextColor [comctl32.dll] InitCommonControls [comdlg32.dll] GetOpenFileNameA GetSaveFileNameA [crtdll.dll] strcmp fopen fclose fgets fputs fgetc fputc feof malloc realloc free fread fwrite fprintf fscanf _itoa memcpy memcmp memmove memset sprintf atoi strcpy strstr strncat [lz32.dll] LZCopy LZInit LZOpenFileA LZClose end imports #-----------------Constants---------------------------------------------- begin const WS_CLIENTEDGE 512 WS_MINIMIZEBOX 131072 LB_GETCURSEL 392 SW_HIDE 0 SW_SHOW 5 WS_CHILD 1073741824 WS_VISIBLE 268435456 WS_BORDER 8388608 WS_HSCROLL 1048576 WS_VSCROLL 2097152 WS_CAPTION 12582912 WS_CHILDWINDOW 1073741824 WS_OVERLAPPEDWINDOW 13565952 WS_POPUPWINDOW 2156396544 ES_MULTILINE 4 WM_CREATE 1 WM_COPY 769 WM_CUT 768 WM_PASTE 770 WM_CLOSE 16 WM_COMMAND 273 WM_DESTROY 2 WM_ENABLE 10 WM_GETTEXT 13 WM_GETTEXTLENGTH 14 WM_INITDIALOG 272 WM_INITMENU 278 WM_KEYDOWN 256 WM_KEYUP 257 WM_KILLFOCUS 8 WM_LBUTTONDBLCLK 515 WM_LBUTTONDOWN 513 WM_LBUTTONUP 514 WM_MOVE 3 WM_NOTIFY 78 WM_PAINT 15 WM_ACTIVATE 6 WM_QUIT 18 WM_RBUTTONDBLCLK 518 WM_RBUTTONDOWN 516 WM_RBUTTONUP 517 WM_SETFOCUS 7 WM_SETFONT 48 WM_SETTEXT 12 WM_SIZE 5 WM_TIMER 275 WM_UNDO 772 WS_SYSMENU 524288 LB_ADDSTRING 384 LB_RESETCONTENT 388 LBS_HASSTRINGS 64 LB_SELECTSTRING 396 LB_SETTOPINDEX 407 DT_SINGLELINE 32 DT_CENTER 1 DT_VCENTER 4 DT_BOTTOM 8 IDI_APPLICATION 32512 IDC_CROSS 32515 GMEM_ZEROINIT 64 ES_AUTOVSCROLL 64 ES_AUTOHSCROLL 128 EN_MSGFILTER 1792 EM_SETEVENTMASK 1093 EN_CHANGE 768 ENM_MOUSEEVENTS 131072 ENM_SELCHANGE 524288 ENM_PROTECTED 2097152 ENM_KEYEVENTS 65536 ENM_UPDATE 2 ENM_SCROLL 4 ENM_CHANGE 1 ES_NOHIDESEL 256 EM_GETFIRSTVISIBLELINE 206 EM_FINDTEXTEX 1103 EM_LINEFROMCHAR 201 EM_LINESCROLL 182 EM_SETLIMITTEXT 197 MF_ENABLED 0 MF_BYPOSITION 1024 MF_SEPARATOR 2048 MF_STRING 0 MF_POPUP 16 MF_DISABLED 2 MF_BYCOMMAND 0 GENERIC_READ 2147483648 GENERIC_WRITE 1073741824 OPEN_EXISTING 3 FILE_ATTRIBUTE_NORMAL 128 EM_STREAMIN 1097 EM_STREAMOUT 1098 ES_WANTRETURN 4096 ES_LEFT 0 SF_RTF 2 SFF_SELECTION 32768 SFF_PLAINRTF 16384 SF_TEXT 1 CB_ADDSTRING 323 CB_DELETESTRING 324 CB_GETCOUNT 326 CB_GETLBTEXT 328 CB_GETLBTEXTLEN 329 CB_INSERTSTRING 330 CB_RESETCONTENT 331 CB_GETCURSEL 327 CB_SETCURSEL 334 CBN_DROPDOWN 7 CBS_DROPDOWN 2 CBS_DROPDOWNLIST 3 CBS_HASSTRINGS 512 CBN_SELENDOK 9 CBN_SELCHANGE 1 CBS_SIMPLE 1 CBN_CLOSEUP 8 CB_FINDSTRINGEXACT 344 CBS_SORT 256 OFN_EXPLORER 524288 OFN_HIDEREADONLY 4 OFN_LONGNAMES 2097152 OFN_PATHMUSTEXIST 2048 MB_ICONASTERISK 64 CREATE_ALWAYS 2 LB_DIR 397 WM_VSCROLL 277 LB_GETCOUNT 395 LB_GETTEXT 393 ES_READONLY 2048 LBS_SORT 2 CB_DIR 325 CBN_SELENDOK 9 LB_GETCOUNT 395 LB_GETTEXT 393 LBN_DBLCLK 2 LBS_NOTIFY 1 IDCANCEL 2 IDNO 7 OF_EXIST 16384 PBM_SETRANGE 1025 PBM_SETSTEP 1028 PBM_STEPIT 1029 PBM_SETPOS 1026 end const #-----------------Data Section------------------------------------------- begin data dword hwndMain 0 string Class Window dword hInstance 0 string ClassName WinClass string AppName EP Install ! string btn button string text Edit string combo combobox string list listbox string colon :\*.* dword quit 0 string lnkpath \start menu\programs\EmPowered Programmer 1.0\ sequence shlink 512 string log epsetup.log string epexe ep.exe string ephelp ep.hlp string epuninst uninst.exe string font1 ms sans serif string font2 Courier New sequence fon1 60 sequence fon2 60 dword hfont1 0 dword hfont2 0 string read r string write w string readb rb string writeb wb string WindowCaption EmPowered Programmer Install ! string ab Welcome to EmPowered Programmer 1.0 Install. Please choose the directory where you want to install the program. EP does not install any system files or make any entries in the registry. Just choose your directory and press Install. string ab1 All of EP's files will be here. The space requirement is ~470KB. Have fun getting EmPowered ! string problem1 Please enter a full path including the drive letter eg. c:\path. string problem2 This directory doesn't exist. Do you want to create it ? string problem3 The specified directory could not be created ! Install stopped. string problem4 There was a write error ! Install stopped. string problem5 Do you want to quit the install ? string problem6 This file already exists ! Do you want to overwrite it ? string start Proceed with install to string success EmPowered Programmer installed successfully ! A shortcut has been setup in Start Menu | Programs. Would you like to run the program now ? string ep ep.exe string ques ? string spc sequence buffer 256 sequence buf 48 sequence icobuf 24 sequence pt 8 sequence stinfo 68 sequence pinfo 16 dword htext1 0 dword htext2 0 dword hbtn1 0 dword hbtn2 0 dword hlist 0 dword hlist1 0 dword hcombo1 0 sequence blank 1 dword CommandLine 0 dword hmem 0 sequence wndclass 16 sequence msg 28 dword mem 0 string tmp tmp.bin string instexe \epsetup.exe sequence ofs 136 dword bytes 0 string dec Compress string exp Install string path c:\*.* sequence listbuf 64 sequence filebuf 256 sequence tmpfile 256 sequence cexefile 256 sequence curdir 256 sequence instdir 256 sequence logfile 256 sequence windir 256 string epexelnk EmPowered Programmer 1.0.lnk string ephlplnk EP Help.lnk string epuninlnk EP Uninstall.lnk string cancl Exit sequence drive 8 sequence drive1 8 sequence dirpath 128 string star \*.* dword level 0 string slash \ string path1 c:\ string lef [- string rig -] string cslash :\ string pbar msctls_progress32 dword pbar1 0 dword dataend 4294967295 end data #------------------------------------------------------------------- begin code proc strlen dword q push ebp mov ebp esp mov edi [q] mov eax 0 mov ecx 0 cld search_loop: inc ecx scasb jne search_loop dec ecx mov eax ecx leave ret 4 endp #------------------------------------------------------------------------ proc hiword dword n push ebp mov ebp esp eax=n and eax 4294901760 xor edx edx ecx=65536 div ecx leave ret 4 endp #------------------------------------------------------------------------ proc strcat dword s1 dword s2 dword len1 0 dword len2 0 dword addr 0 dword len 0 push ebp mov ebp esp add esp -48 invoke strlen [s1] mov [len1] eax invoke strlen [s2] mov [len2] eax add eax [len1] inc eax len = eax invoke [malloc] eax invoke memset eax 0 len mov [addr] eax mov edi eax mov ecx [len1] mov esi [s1] rep_movsb mov ecx [len2] mov esi [s2] rep_movsb mov eax [addr] leave ret 8 endp #------------------------------------------------------------------------ proc left dword s dword n dword slen 0 push ebp mov ebp esp add esp -16 cld eax = n inc eax slen = eax invoke malloc eax edi = eax invoke memset eax 0 slen esi = s ecx = n rep_movsb leave ret 8 endp #------------------------------------------------------------------------ proc writemem dword addr dword disp dword vartype dword val push ebp mov ebp esp add esp -48 eax = addr add eax disp if vartype = 1 ebx = val [eax] = ebx endif if vartype = 2 ebx = val invoke strcpy eax ebx endif #write byte if vartype = 3 ebx = val [eax] = bl endif eax = addr leave ret 16 endp #------------------------------------------------------------------------ proc SetWord dword m dword addr dword n 0 push ebp mov ebp esp add esp -48 eax=m ebx=addr [ebx]=al inc ebx ecx=0 while ecx < 8 shr eax inc ecx endw [ebx]=al leave ret 8 endp #------------------------------------------------------------------------ proc CreateShortcut dword lnkfile dword title #creates a basic .lnk file in the target dir --Start Menu|Prgrams|EmPowered Programmer 1.0 dword n 0 dword bfr 0 dword fn 0 dword addr 0 dword len 0 dword st 0 dword tlen 0 dword m 0 dword filepath 0 dword p 0 push ebp mov ebp esp add esp -96 filepath=strcat instdir lnkfile invoke memset shlink 0 512 invoke writemem shlink 0 1 76 invoke writemem shlink 4 1 136193 invoke writemem shlink 12 1 192 invoke writemem shlink 16 1 1174405120 invoke writemem shlink 20 1 26 invoke writemem shlink 24 1 20 invoke writemem shlink 28 1 825085728 invoke writemem shlink 32 1 29501082 invoke writemem shlink 36 1 1297433600 invoke writemem shlink 40 1 29500900 invoke writemem shlink 44 1 880504064 invoke writemem shlink 48 1 29500841 invoke writemem shlink 52 1 102912 invoke writemem shlink 60 1 1 n=strlen filepath len=eax add n 32 add n 2 invoke writemem shlink 76 1 n #total length invoke writemem shlink 80 1 28 invoke writemem shlink 84 1 1 invoke writemem shlink 88 1 28 #offset to vol table invoke writemem shlink 92 1 32 #offset to string1 dec n invoke writemem shlink 100 1 n #offset to string2 invoke writemem shlink 104 1 4 invoke writemem shlink 108 2 filepath eax=108 add eax len add eax 2 ebx=shlink add ebx eax invoke SetWord len ebx eax=108 add eax len add eax 4 addr=eax invoke writemem shlink eax 2 filepath p=strlen lnkfile inc p eax=len sub eax p #7 m=eax st=left filepath m eax=addr add eax len ebx=shlink add ebx eax invoke SetWord m ebx eax=addr add eax len add eax 2 invoke writemem shlink eax 2 st eax=108 add eax len add eax len add eax len add eax 24 n=eax st=strcat windir title fn =fopen st writeb invoke fwrite shlink 1 n fn invoke fclose fn leave ret 8 endp #------------------------------------------------------------------------ proc WndProc dword hwnd dword msg dword wparam dword lparam dword fn1 0 dword fn2 0 dword hdc 0 sequence ps 64 sequence rect 16 dword tx 0 dword ordata 0 dword fn 0 dword hn 0 dword st 0 dword n 0 dword m 0 dword x 0 dword y 0 dword fbuf 0 dword fsize 0 dword tfsize 0 dword pfsize 0 dword begins 0 dword ends 0 dword cfile 0 dword offs 0 dword num 0 dword c 0 dword pb 0 dword fnlog 0 push ebp mov ebp esp add esp -256 cmp [msg] {WM_CREATE} je wmcreate cmp [msg] {WM_PAINT} je wmpaint cmp [msg] {WM_COMMAND} je wmcommand cmp [msg] {WM_CLOSE} je wmclose cmp [msg] {WM_DESTROY} jne default push 0 call [PostQuitMessage] jmp exit wmclose: if quit=0 invoke MessageBoxA hwnd problem5 AppName 4 if eax={IDNO} jmp exit endif endif invoke SendMessageA hwnd {WM_DESTROY} 0 0 jmp exit wmcreate: mov eax {WS_CHILD} or eax {WS_BORDER} or eax {WS_VISIBLE} [ordata]= eax invoke [CreateWindowExA] 0 pbar blank [ordata] 20 280 470 25 [hwnd] 0 [hInstance] 0 mov [pbar1] eax invoke SendMessageA [pbar1] {WM_SETFONT} hfont1 0 mov eax {WS_CHILD} or eax {WS_BORDER} or eax {WS_VISIBLE} or eax {CBS_DROPDOWN} [ordata]= eax invoke [CreateWindowExA] 0 combo exp [ordata] 290 20 200 100 [hwnd] 0 [hInstance] 0 mov [hcombo1] eax invoke SendMessageA [hcombo1] {WM_SETFONT} hfont2 0 eax =16384 or eax 32768 invoke SendMessageA hcombo1 {CB_DIR} eax path1 mov eax {WS_CHILD} #this list is invisible or eax {WS_BORDER} or eax {WS_VSCROLL} or eax {LBS_NOTIFY} ordata=eax invoke CreateWindowExA 0 list blank ordata 10 10 200 250 hwnd 0 hInstance 0 mov hlist eax invoke GetCurrentDirectoryA 256 curdir st=left curdir 1 st=strcat lef st st=strcat st rig invoke SendMessageA hcombo1 {WM_SETTEXT} 0 st esi=curdir eax=0 al=[esi] edi=drive1 [edi]=al edi=drive [edi]=al invoke strncat drive1 colon 5 invoke strncat drive colon 2 eax=16 or eax 32768 invoke SendMessageA hlist {LB_DIR} eax drive1 eax=ordata or eax {LBS_SORT} or eax {WS_VISIBLE} ordata=eax invoke CreateWindowExA 0 list blank ordata 290 50 200 215 hwnd 0 hInstance 0 mov hlist1 eax invoke SendMessageA hlist1 {WM_SETFONT} hfont2 0 n=SendMessageA hlist {LB_GETCOUNT} 0 0 ebx=0 m=0 while ebx < n invoke memset listbuf 0 64 invoke SendMessageA hlist {LB_GETTEXT} m listbuf edi=listbuf eax=0 al=[edi] if eax=91 #if there is a left bracket invoke SendMessageA hlist1 {LB_ADDSTRING} 0 listbuf endif inc m ebx=m endw mov eax {WS_CHILD} or eax {WS_BORDER} or eax {WS_VISIBLE} ordata= eax invoke CreateWindowExA 0 btn exp ordata 20 245 100 25 hwnd 0 hInstance 0 mov hbtn1 eax invoke SendMessageA hbtn1 {WM_SETFONT} hfont1 0 invoke CreateWindowExA 0 btn cancl ordata 170 245 100 25 hwnd 0 hInstance 0 mov hbtn2 eax invoke SendMessageA hbtn2 {WM_SETFONT} hfont1 0 or ordata {ES_AUTOHSCROLL} invoke CreateWindowExA 0 text blank ordata 20 20 250 25 hwnd 0 hInstance 0 mov htext1 eax invoke SendMessageA htext1 {WM_SETFONT} hfont2 0 mov eax {WS_CHILD} or eax {WS_VISIBLE} or eax {ES_MULTILINE} or eax {WS_VSCROLL} or eax {ES_READONLY} ordata=eax tx=strcat ab ab1 invoke CreateWindowExA 0 text tx ordata 20 50 250 190 hwnd 0 hInstance 0 mov htext2 eax invoke SendMessageA htext2 {WM_SETFONT} hfont2 0 jmp exit wmpaint: lea eax ps invoke BeginPaint hwnd eax mov hdc eax lea eax ps invoke EndPaint hwnd eax jmp exit wmcommand: mov eax hlist cmp lparam eax jne lis1 invoke hiword wparam if eax=2 invoke memset buf 0 48 invoke SendMessageA hlist {LB_GETCURSEL} 0 0 invoke SendMessageA hlist {LB_GETTEXT} eax buf invoke SendMessageA hlist1 {LB_ADDSTRING} 0 buf endif jmp exit lis1: mov eax hlist1 cmp lparam eax jne cmb1 invoke hiword wparam if eax=2 #double click inc level invoke memset buf 0 48 invoke SendMessageA hlist1 {LB_GETCURSEL} 0 0 invoke SendMessageA hlist1 {LB_GETTEXT} eax buf n=strlen buf edi=buf add edi n dec edi [edi]=0 edi=buf inc edi eax=0 al=[edi] if eax=46 #[..] back dec level c=0 #if back then zero all chars till previous \ n=strlen dirpath edi=dirpath add edi n ebx=0 while ebx < n [edi]=0 dec edi eax=0 al=[edi] if eax=92 #\ backslash inc c endif if c <> 1 [edi]=0 endif if c=1 [edi]=0 jmp backdir endif endw endif if level=1 invoke strncat dirpath drive 24 invoke strncat dirpath edi 24 endif if level > 1 invoke strncat dirpath slash 1 invoke strncat dirpath edi 24 endif backdir: invoke SendMessageA [htext1] {WM_SETTEXT} 0 dirpath st=strcat dirpath star invoke SendMessageA hlist {LB_RESETCONTENT} 0 0 eax=16 or eax 32768 invoke SendMessageA hlist {LB_DIR} eax st invoke SendMessageA hlist1 {LB_RESETCONTENT} 0 0 n=SendMessageA hlist {LB_GETCOUNT} 0 0 ebx=0 m=0 while ebx < n invoke memset listbuf 0 64 invoke SendMessageA hlist {LB_GETTEXT} m listbuf edi=listbuf eax=0 al=[edi] if eax=91 #if there is a left bracket invoke SendMessageA hlist1 {LB_ADDSTRING} 0 listbuf endif inc m ebx=m endw endif jmp exit cmb1: mov eax [hcombo1] cmp [lparam] eax jne btn1 invoke hiword wparam if eax=9 invoke memset drive 0 8 invoke memset drive1 0 8 invoke memset dirpath 0 128 invoke memset buf 0 48 invoke SendMessageA hcombo1 {CB_GETCURSEL} 0 0 invoke SendMessageA hcombo1 {CB_GETLBTEXT} eax buf esi=buf add esi 2 eax=0 al=[esi] edi=drive1 [edi]=al edi=drive [edi]=al invoke strncat drive1 colon 5 invoke strncat drive cslash 2 invoke SendMessageA hlist {LB_RESETCONTENT} 0 0 level=0 eax=16 or eax 32768 invoke SendMessageA hlist {LB_DIR} eax drive1 invoke memset dirpath 0 128 invoke SendMessageA hlist1 {LB_RESETCONTENT} 0 0 n=SendMessageA hlist {LB_GETCOUNT} 0 0 ebx=0 m=0 while ebx < n invoke memset listbuf 0 64 invoke SendMessageA hlist {LB_GETTEXT} m listbuf edi=listbuf eax=0 al=[edi] if eax=91 invoke SendMessageA hlist1 {LB_ADDSTRING} 0 listbuf endif inc m ebx=m endw invoke SendMessageA [htext1] {WM_SETTEXT} 0 dirpath endif jmp exit btn1: mov eax [hbtn1] cmp [lparam] eax jne btn2 invoke memset instdir 0 256 invoke memset tmpfile 0 256 invoke memset filebuf 0 256 invoke memset cexefile 0 256 invoke memset logfile 0 256 invoke SendMessageA htext1 {WM_GETTEXT} 256 instdir n=strlen instdir edi=instdir add edi n dec edi eax=0 al=[edi] if eax <> 92 invoke strncat instdir slash endif n=strlen instdir if n < 3 jmp exit endif edi=instdir inc edi st=left edi 2 invoke strcmp st cslash if eax <> 0 invoke MessageBoxA hwnd problem1 AppName 0 jmp exit endif invoke SetCurrentDirectoryA instdir if eax=0 invoke MessageBoxA hwnd problem2 AppName 4 if eax={IDNO} jmp exit endif invoke CreateDirectoryA instdir 0 if eax=0 invoke MessageBoxA hwnd problem3 AppName 0 jmp exit endif endif st=strcat start instdir st=strcat st ques invoke MessageBoxA hwnd st AppName 4 if eax={IDNO} jmp exit endif #now ready for install invoke strncat tmpfile instdir invoke strncat tmpfile tmp invoke strncat cexefile curdir invoke strncat cexefile instexe hn=CreateFileA cexefile {GENERIC_READ} 1 0 {OPEN_EXISTING} 128 0 fsize= GetFileSize hn 0 invoke CloseHandle hn #you may wonder why i use CreateFileA only to find the file size #it's just that i have been using the crtdll funcs like fopen more #and am more comfortable using them fbuf=malloc fsize fn=fopen cexefile readb invoke fread fbuf 1 fsize fn #read entire file (epinstal.exe here) into memory invoke fclose fn eax=fbuf add eax 17920 #15872 #here the stub ends and the header of the compressed archive portion begins cfile=eax add eax 4 ebx=[eax] n=ebx #get number of files in compressed archive add ebx 16 offs=ebx #offset to compressed archive #invoke SendMessageA pbar1 {PBM_SETRANGE} 0 131072 invoke SendMessageA pbar1 {PBM_SETSTEP} 4 0 m=0 ebx=0 num=16 invoke strncat logfile instdir invoke strncat logfile log fnlog=fopen logfile write #file decompression loop begins while ebx < n invoke memset filebuf 0 256 invoke strncat filebuf instdir eax=cfile add eax num ebx=[eax] begins=ebx #the beginning offset of a compressed file within the archive add eax 4 ebx=[eax] ends=ebx #the end offset add eax 4 invoke strncat filebuf eax #the file name eax=ends sub eax begins fsize=eax fn=fopen tmpfile writeb if fn=0 invoke MessageBoxA hwnd problem4 AppName 0 #write error jmp exit endif eax=cfile add eax offs add eax begins invoke fwrite eax 1 fsize fn invoke fclose fn hn=CreateFileA filebuf {GENERIC_READ} 1 0 {OPEN_EXISTING} 128 0 if hn <> -1 invoke CloseHandle hn st=strcat filebuf spc st=strcat st problem6 #file already exists invoke MessageBoxA hwnd st AppName 4 if eax ={IDNO} jmp skip endif endif #everything ok now expand fn1= LZOpenFileA tmpfile ofs 0 fn2= LZOpenFileA filebuf ofs 4096 invoke LZCopy fn1 fn2 invoke LZClose fn1 invoke LZClose fn2 skip: invoke fputs filebuf fnlog invoke fputc 13 fnlog invoke fputc 10 fnlog if pb < 96 #show some progress pb=SendMessageA pbar1 {PBM_STEPIT} 0 0 endif add num 32 add m 32 ebx=m endw #file decompression loop #winding up invoke DeleteFileA tmpfile invoke SendMessageA pbar1 {PBM_SETPOS} 100 0 invoke fclose fnlog invoke GetWindowsDirectoryA windir 256 invoke strncat windir lnkpath invoke CreateDirectoryA windir invoke CreateShortcut epexe epexelnk invoke CreateShortcut ephelp ephlplnk invoke CreateShortcut epuninst epuninlnk invoke MessageBoxA hwnd success AppName 4 if eax={IDNO} quit=1 invoke SendMessageA hwnd {WM_CLOSE} 0 0 jmp exit endif quit=1 st=strcat instdir ep #run EP if yes [stinfo]=68 invoke CreateProcessA 0 st 0 0 0 32 0 instdir stinfo pinfo invoke SendMessageA hwnd {WM_CLOSE} 0 0 jmp exit btn2: mov eax [hbtn2] cmp [lparam] eax jne default invoke MessageBoxA hwnd problem5 AppName 4 if eax={IDNO} jmp exit endif quit=1 invoke SendMessageA hwnd {WM_DESTROY} 0 0 jmp exit default: invoke DefWindowProcA hwnd msg wparam lparam leave ret 16 exit: xor eax eax leave ret 16 endp #------------------------------------------------------------------------ proc WinMain dword hinst dword previnst dword comline dword cmdshow sequence wc 48 dword ordata 0 dword len 0 dword topmenu 0 dword dropmenu 0 dword sepmenu 0 push ebp mov ebp esp add esp -80 call InitCommonControls mov eax fon2 mov [eax] 16 add eax 16 mov [eax] 400 add eax 12 invoke strcpy eax font2 hfont2 = CreateFontIndirectA fon2 mov eax fon1 mov [eax] 10 add eax 16 mov [eax] 400 add eax 12 invoke strcpy eax font1 hfont1 = CreateFontIndirectA fon1 [wc]= 48 [wc+4] =3 [wc+8]= WndProc [wc+12]= 0 [wc+16] =0 eax =[hInstance] [wc+20]= eax push 1 push [hInstance] call [LoadIconA] [wc+24]= eax [wc+44]= eax push {IDC_CROSS} push 0 call [LoadCursorA] [wc+28] =eax [wc+32]= 16 [wc+36]= 0 [wc+40]= ClassName lea eax [wc] invoke [RegisterClassExA] eax eax={WS_CAPTION} or eax {WS_SYSMENU} or eax {WS_MINIMIZEBOX} ordata=eax invoke [CreateWindowExA] {WS_CLIENTEDGE} ClassName WindowCaption ordata 50 50 515 350 0 0 [hInstance] 0 [hwndMain]= eax push 1 push [hwndMain] call [ShowWindow] push [hwndMain] call [UpdateWindow] MsgLoop: invoke [GetMessageA] msg 0 0 0 cmp eax 0 je exitprocess invoke [TranslateMessage] msg invoke [DispatchMessageA] msg jmp MsgLoop exitprocess: mov eax [msg+8] leave ret 16 endp #------------------------------------------------------------------------ EntryPoint push 0 call [GetModuleHandleA] mov [hInstance] eax call [GetCommandLineA] mov [CommandLine] eax invoke WinMain [hInstance] 0 [CommandLine] 10 push eax call [ExitProcess] end code #-----------------Resources--------------------------------------- begin resources icon galaxy.ico end resources