Function at 0x402de3
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x12c
mov eax, dword [0x419020]
xor eax, dword [ebp + 4]
and byte [ebp - 5], 0
push ebx
push esi
xor ebx, ebx
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push dword [0x41d848]
mov dword [ebp - 4], eax
mov dword [ebp - 0xc], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp - 0x1c], esi
jne 0x402e3a
push 0x401c84
call dword [sym.imp.MSVCR70.dll_printf]
pop ecx
xor al, al
jmp 0x4030c2
mov eax, dword [0x52488c]
cmp eax, ebx
je 0x402e9b
push eax
lea eax, [ebp - 0x12c]
push 0x401c58
push eax
mov dword [ebp - 0x18], 0x402d51
call dword [sym.imp.MSVCR70.dll_sprintf]
lea eax, [ebp - 0x12c]
add esp, 0xc
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x402e69
sub eax, ecx
push ebx
lea ecx, [ebp - 0x10]
push ecx
push eax
lea eax, [ebp - 0x12c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x402ea2
push 0x401c30
call dword [sym.imp.MSVCR70.dll_printf]
pop ecx
jmp 0x4030b6
mov dword [ebp - 0x18], 0x402d2e
mov eax, dword [0x524880]
inc eax
mov word [ebp - 0x28], ax
mov ax, word [0x421864]
mov word [ebp - 0x26], ax
mov ax, word [0x524888]
mov word [ebp - 0x24], ax
mov al, byte [0x52487c]
mov byte [ebp - 0x22], al
mov al, byte [0x4a1878]
mov byte [ebp - 0x21], al
mov al, byte [0x421870]
mov byte [ebp - 0x20], al
mov al, byte [0x4a187c]
mov byte [ebp - 0x1f], al
mov al, byte [0x524884]
mov byte [ebp - 0x1e], al
mov al, byte [0x5248a0]
mov byte [ebp - 0x1d], al
push 0x10
lea eax, [ebp - 0x2c]
push eax
push esi
mov word [ebp - 0x2c], 0x4e54
mov word [ebp - 0x2a], 2
call dword [ebp - 0x18]
cmp eax, ebx
mov dword [ebp - 0x10], eax
je 0x402e8a
cmp byte [0x41d85c], 0
mov esi, dword [sym.imp.MSVCR70.dll_printf]
je 0x402f2d
push eax
push 0x401c10
mov dword [ebp - 0xc], eax
call esi
pop ecx
pop ecx
mov eax, dword [0x524880]
mov ecx, dword [0x524898]
lea edx, [ecx + eax]
mov ecx, dword [0x421864]
lea ecx, [ecx + ecx*2]
shl ecx, 1
push edi
lea edi, [eax + 1]
cmp edi, ebx
lea edx, [ecx + edx*4 + 0x14]
mov ecx, dword [0x41d860]
mov dword [ebp - 0x14], ebx
jbe 0x402f6d
mov ebx, dword [ebp - 0x14]
lea ebx, [ecx + ebx*4]
add dword [ebx], edx
inc dword [ebp - 0x14]
cmp dword [ebp - 0x14], edi
jb 0x402f5b
xor ebx, ebx
lea eax, [eax*4 + 4]
push eax
push ecx
push dword [ebp - 0x1c]
call dword [ebp - 0x18]
cmp eax, ebx
mov dword [ebp - 0x10], eax
jne 0x402f90
push 0x401c30
call esi
pop ecx
jmp 0x4030b5
cmp byte [0x41d85c], 0
je 0x402fae
add dword [ebp - 0xc], eax
push eax
mov eax, dword [0x524880]
inc eax
push eax
push 0x401be0
call esi
add esp, 0xc
mov eax, dword [0x421864]
lea eax, [eax + eax*2]
shl eax, 1
push eax
push 0x521880
push dword [ebp - 0x1c]
call dword [ebp - 0x18]
cmp eax, ebx
mov dword [ebp - 0x10], eax
je 0x402f83
cmp byte [0x41d85c], 0
je 0x402fe8
add dword [ebp - 0xc], eax
push eax
push dword [0x421864]
push 0x401bb0
call esi
add esp, 0xc
mov eax, dword [0x524898]
shl eax, 2
push eax
push 0x41d868
push dword [ebp - 0x1c]
call dword [ebp - 0x18]
cmp eax, ebx
mov dword [ebp - 0x10], eax
je 0x402f83
cmp byte [0x41d85c], 0
je 0x403020
add dword [ebp - 0xc], eax
push eax
push dword [0x524898]
push 0x401b80
call esi
add esp, 0xc
mov eax, dword [0x524880]
xor edi, edi
test eax, eax
mov dword [ebp - 0x14], eax
jbe 0x403062
mov eax, dword [0x41d860]
lea eax, [eax + edi*4]
mov ecx, dword [eax + 4]
sub ecx, dword [eax]
mov eax, dword [0x41d84c]
push ecx
push dword [eax + edi*4]
push dword [ebp - 0x1c]
call dword [ebp - 0x18]
test eax, eax
mov dword [ebp - 0x10], eax
je 0x402f83
add ebx, eax
inc edi
cmp edi, dword [ebp - 0x14]
jb 0x40302e
mov eax, dword [0x524880]
cmp byte [0x41d85c], 0
je 0x40308a
push dword [0x4a187c]
push ebx
push eax
push 0x401b38
call esi
mov eax, dword [ebp - 0xc]
add ebx, eax
push ebx
push 0x401b14
call esi
add esp, 0x18
cmp dword [0x52488c], 0
je 0x4030b1
push 0
lea eax, [ebp - 0x10]
push eax
push 6
push 0x401b0c
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x402f83
mov byte [ebp - 5], 1
pop edi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [ebp - 5]
mov ecx, dword [ebp - 4]
xor ecx, dword [ebp + 4]
pop esi
pop ebx
call fcn.004032d6
leave
ret