Guest User

Untitled

a guest
Jul 17th, 2017
96
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. format PE GUI 5.0
  2. entry start
  3.  
  4. include 'win32w.inc'
  5.  
  6. section '.text' code readable executable
  7. align 10h
  8. data import
  9.     library kernel32,'KERNEL32.DLL',\
  10.             user32,'USER32.DLL'
  11.     include 'api/kernel32.inc'
  12.     include 'api/user32.inc'
  13. end data
  14. align 10h
  15. sznoerr     du  'uptime.exe not found! Please',0Dh,0Ah,'check location of launch!',0
  16. szvarerr    du  'Unable to get %comspec% variable!',0Dh,0Ah,'Further work is impossible, bye :|',0
  17. szrunerr    du  'Unable to create process cmd.exe!',0Dh,0Ah,'Further work is impossible, bye :|',0
  18. exe32       du  'uptime.exe',0
  19. 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
  20. comspec     du  '%comspec%',0
  21. szquote     du  22h,0
  22. align 10h
  23.  
  24. nothing_error:
  25.     invoke  MessageBox,0,sznoerr,0,MB_ICONERROR
  26.     jmp     loc_exit
  27.  
  28. cmdvar_error:
  29.     invoke  MessageBox,0,szvarerr,0,MB_ICONERROR
  30.     jmp     loc_exit
  31.  
  32. running_error:
  33.     invoke  MessageBox,0,szrunerr,0,MB_ICONERROR
  34.     jmp     loc_exit
  35.  
  36. proc existW ucFileName:DWORD
  37.     local   ucwfd:WIN32_FIND_DATAW
  38.     lea     eax,[ucwfd]
  39.     invoke  FindFirstFileW,[ucFileName],eax
  40.     cmp     eax,-1
  41.     je      @F
  42.     invoke  FindClose,eax
  43.     dec     eax
  44.     @@:
  45.     inc     eax
  46.     ret
  47. endp
  48.  
  49. start:
  50.     invoke  GetModuleFileName,0,curdir,MAX_PATH*2
  51.     invoke  lstrlen,curdir
  52.     lea     edi,[eax*2+curdir]
  53.     @@:
  54.     cmp     word[edi],5Ch
  55.     je      @F
  56.     dec     edi
  57.     jmp     @B
  58.     @@:
  59.     mov     word[edi+2],0
  60.     invoke  SetCurrentDirectory,curdir
  61.     stdcall existW,exe32
  62.     test    eax,eax
  63.     je      nothing_error
  64.  
  65.     invoke  ExpandEnvironmentStrings,comspec,cmdexe,MAX_PATH*2
  66.     test    eax,eax
  67.     je      cmdvar_error
  68.  
  69.     invoke  lstrcpy,buffer,szquote
  70.     invoke  lstrcat,buffer,cmdexe
  71.     invoke  lstrcat,buffer,szquote
  72.     invoke  lstrcat,buffer,param
  73.  
  74.     mov     [sinfo.cb],sizeof.STARTUPINFO
  75.     invoke  CreateProcess,cmdexe,buffer,0,0,FALSE,0,0,curdir,sinfo,pinfo
  76.     test    eax,eax
  77.     je      running_error
  78.  
  79.     loc_exit:
  80.     invoke  ExitProcess,0
  81.  
  82. section '.data' readable writeable
  83. buffer      du  1024 dup(?)
  84. curdir      du  MAX_PATH dup(?)
  85. cmdexe      du  MAX_PATH dup(?)
  86. sinfo       STARTUPINFO
  87. pinfo       PROCESS_INFORMATION
  88.  
  89. section '.rsrc' resource data readable
  90.  
  91.     directory RT_ICON,icons,\
  92.         RT_GROUP_ICON,group_icons
  93.  
  94.     resource icons,\
  95.         1,409h,icon_data1,\
  96.         2,409h,icon_data2,\
  97.         3,409h,icon_data3,\
  98.         4,409h,icon_data4
  99.  
  100.     resource group_icons,\
  101.         100,409h,main_icon
  102.  
  103.     icon main_icon,\
  104.         icon_data1,'res/48x48.ico',\
  105.         icon_data2,'res/32x32.ico',\
  106.         icon_data3,'res/24x24.ico',\
  107.         icon_data4,'res/16x16.ico'
RAW Paste Data