Advertisement
GlobalHell2K17

WannaCry Entry Function Decompiled

May 18th, 2019
721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.81 KB | None | 0 0
  1. /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
  2.  
  3. void entry(void)
  4.  
  5. {
  6.   undefined4 *puVar1;
  7.   undefined4 *in_FS_OFFSET;
  8.   byte *local_78;
  9.   char **local_74;
  10.   _startupinfo local_70;
  11.   int local_6c;
  12.   char **local_68;
  13.   int local_64;
  14.   _STARTUPINFOA local_60;
  15.   undefined *local_1c;
  16.   undefined4 uStack20;
  17.   undefined *puStack16;
  18.   undefined *puStack12;
  19.   undefined4 local_8;
  20.  
  21.   puStack12 = &DAT_0040d488;
  22.   puStack16 = &DAT_004076f4;
  23.   uStack20 = *in_FS_OFFSET;
  24.   *(undefined4 **)in_FS_OFFSET = &uStack20;
  25.   local_1c = &stack0xffffff78;
  26.   local_8 = 0;
  27.   __set_app_type(2);
  28.   _DAT_0040f94c = 0xffffffff;
  29.   _DAT_0040f950 = 0xffffffff;
  30.   puVar1 = (undefined4 *)__p__fmode();
  31.   *puVar1 = DAT_0040f948;
  32.   puVar1 = (undefined4 *)__p__commode();
  33.   *puVar1 = DAT_0040f944;
  34.   _DAT_0040f954 = *(undefined4 *)_adjust_fdiv_exref;
  35.   FUN_0040793f();
  36.   if (_DAT_0040f870 == 0) {
  37.     __setusermatherr(&LAB_0040793c);
  38.   }
  39.   FUN_0040792a();
  40.   _initterm(&DAT_0040e008,&DAT_0040e00c);
  41.   local_70 = DAT_0040f940;
  42.   __getmainargs(&local_64,&local_74,&local_68,_DoWildCard_0040f93c,&local_70);
  43.   _initterm(&DAT_0040e000,&DAT_0040e004);
  44.   local_78 = *(byte **)_acmdln_exref;
  45.   if (*local_78 != 0x22) {
  46.     do {
  47.       if (*local_78 < 0x21) goto LAB_004078ad;
  48.       local_78 = local_78 + 1;
  49.     } while( true );
  50.   }
  51.   do {
  52.     local_78 = local_78 + 1;
  53.     if (*local_78 == 0) break;
  54.   } while (*local_78 != 0x22);
  55.   if (*local_78 != 0x22) goto LAB_004078ad;
  56.   do {
  57.     local_78 = local_78 + 1;
  58. LAB_004078ad:
  59.   } while ((*local_78 != 0) && (*local_78 < 0x21));
  60.   local_60.dwFlags = 0;
  61.   GetStartupInfoA((LPSTARTUPINFOA)&local_60);
  62.   GetModuleHandleA((LPCSTR)0x0);
  63.   local_6c = FUN_00401fe7();
  64.                     /* WARNING: Subroutine does not return */
  65.   exit(local_6c);
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement