Function at 0x402139
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x440269
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
sub esp, 0x4c
push ebx
push esi
push edi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x24], 0xffffffff
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x28], 0x10000
mov dword [ebp - 0x14], 0
push 0
mov eax, dword [ebp + 0xc]
push eax
call fcn.00413d10
add esp, 8
mov dword [ebp - 0x20], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0x20], 0x204
mov ecx, dword [ebp - 0x28]
push ecx
lea ecx, [ebp - 0x34]
call fcn.00413440
mov dword [ebp - 0x50], eax
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], 0x206
lea ecx, [ebp - 0x34]
call fcn.004136c0
mov dword [ebp - 0x54], eax
mov edx, dword [ebp - 0x54]
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x20], 0x208
cmp dword [ebp - 0x38], 0
jne 0x4021ee
mov dword [ebp - 0x40], 8
push 0x449870
lea eax, [ebp - 0x40]
push eax
call fcn.004236ae
mov dword [ebp - 0x20], 0x20c
push str._tmp
push 0x454738
call fcn.00433f27
add esp, 8
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x402225
mov dword [ebp - 0x44], 8
push 0x449870
lea ecx, [ebp - 0x44]
push ecx
call fcn.004236ae
mov dword [ebp - 0x20], 0x211
push 0
push 0x20
push 2
push 0
push 1
push 0x40000000
mov edx, dword [ebp - 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0xffffffff
jne 0x402265
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x48], eax
push 0x449870
lea eax, [ebp - 0x48]
push eax
call fcn.004236ae
mov dword [ebp - 0x20], 0x216
cmp dword [ebp + 0x10], 0
jbe 0x402310
mov dword [ebp - 0x20], 0x219
mov ecx, dword [ebp + 0x10]
cmp ecx, dword [ebp - 0x28]
jbe 0x40228d
mov edx, dword [ebp - 0x28]
mov dword [ebp - 0x58], edx
jmp 0x402293
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x58], eax
push 0
mov ecx, dword [ebp - 0x58]
push ecx
mov edx, dword [ebp - 0x38]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.0040d3d0
mov dword [ebp - 0x5c], eax
mov ecx, dword [ebp - 0x5c]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], 0x21b
cmp dword [ebp - 0x1c], 0
jg 0x4022be
jmp 0x402310
mov dword [ebp - 0x20], 0x21e
push 0
lea edx, [ebp - 0x18]
push edx
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 0x38]
push ecx
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4022e3
jmp 0x402310
mov dword [ebp - 0x20], 0x221
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x18]
je 0x4022f4
jmp 0x402310
mov dword [ebp - 0x20], 0x224
mov ecx, dword [ebp + 0x10]
sub ecx, dword [ebp - 0x1c]
mov dword [ebp + 0x10], ecx
mov dword [ebp - 0x20], 0x226
jmp 0x40226c
mov dword [ebp - 0x20], 0x229
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x20], 0x22b
mov dword [ebp - 0x20], 0x22d
mov eax, dword [ebp + 0xc]
mov byte [eax + 1], 0x3a
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp - 0x14]
push edx
call fcn.00424cad
add esp, 8
mov dword [ebp - 0x20], 0x230
mov dword [ebp - 0x20], 0x232
mov eax, dword [ebp - 0x14]
push eax
call fcn.00424c65
add esp, 4
mov dword [ebp - 0x20], 0x234
mov dword [ebp - 0x4c], 1
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x34]
call fcn.00413510
mov eax, dword [ebp - 0x4c]
jmp 0x4023ea
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret