Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format PE GUI 5.0
- entry start
- include 'win32w.inc'
- section '.text' code readable executable
- align 10h
- data import
- library kernel32,'KERNEL32.DLL',\
- user32,'USER32.DLL'
- include 'api/kernel32.inc'
- include 'api/user32.inc'
- end data
- align 10h
- sznoerr du 'uptime.exe not found! Please',0Dh,0Ah,'check location of launch!',0
- szvarerr du 'Unable to get %comspec% variable!',0Dh,0Ah,'Further work is impossible, bye :|',0
- szrunerr du 'Unable to create process cmd.exe!',0Dh,0Ah,'Further work is impossible, bye :|',0
- exe32 du 'uptime.exe',0
- param du ' /c "@echo off && color 4F && title uptime && mode con: cols=30 lines=3 && cls && uptime -s && echo. && uptime -p && echo. && pause >NUL"',0
- comspec du '%comspec%',0
- szquote du 22h,0
- align 10h
- nothing_error:
- invoke MessageBox,0,sznoerr,0,MB_ICONERROR
- jmp loc_exit
- cmdvar_error:
- invoke MessageBox,0,szvarerr,0,MB_ICONERROR
- jmp loc_exit
- running_error:
- invoke MessageBox,0,szrunerr,0,MB_ICONERROR
- jmp loc_exit
- proc existW ucFileName:DWORD
- local ucwfd:WIN32_FIND_DATAW
- lea eax,[ucwfd]
- invoke FindFirstFileW,[ucFileName],eax
- cmp eax,-1
- je @F
- invoke FindClose,eax
- dec eax
- @@:
- inc eax
- ret
- endp
- start:
- invoke GetModuleFileName,0,curdir,MAX_PATH*2
- invoke lstrlen,curdir
- lea edi,[eax*2+curdir]
- @@:
- cmp word[edi],5Ch
- je @F
- dec edi
- jmp @B
- @@:
- mov word[edi+2],0
- invoke SetCurrentDirectory,curdir
- stdcall existW,exe32
- test eax,eax
- je nothing_error
- invoke ExpandEnvironmentStrings,comspec,cmdexe,MAX_PATH*2
- test eax,eax
- je cmdvar_error
- invoke lstrcpy,buffer,szquote
- invoke lstrcat,buffer,cmdexe
- invoke lstrcat,buffer,szquote
- invoke lstrcat,buffer,param
- mov [sinfo.cb],sizeof.STARTUPINFO
- invoke CreateProcess,cmdexe,buffer,0,0,FALSE,0,0,curdir,sinfo,pinfo
- test eax,eax
- je running_error
- loc_exit:
- invoke ExitProcess,0
- section '.data' readable writeable
- buffer du 1024 dup(?)
- curdir du MAX_PATH dup(?)
- cmdexe du MAX_PATH dup(?)
- sinfo STARTUPINFO
- pinfo PROCESS_INFORMATION
- section '.rsrc' resource data readable
- directory RT_ICON,icons,\
- RT_GROUP_ICON,group_icons
- resource icons,\
- 1,409h,icon_data1,\
- 2,409h,icon_data2,\
- 3,409h,icon_data3,\
- 4,409h,icon_data4
- resource group_icons,\
- 100,409h,main_icon
- icon main_icon,\
- icon_data1,'res/48x48.ico',\
- icon_data2,'res/32x32.ico',\
- icon_data3,'res/24x24.ico',\
- icon_data4,'res/16x16.ico'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement