Function at 0x402940
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x434a78
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xdc
push ebx
push esi
push edi
push ecx
lea edi, [ebp - 0xe8]
mov ecx, 0x37
mov eax, 0xcccccccc
rep stosd dword es:[edi], eax
pop ecx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xb8], 0
call fcn.00401ae0
mov dword [ebp - 0x68], eax
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0x68]
push ecx
call fcn.00401ac0
add esp, 8
movzx edx, al
test edx, edx
je 0x4029b4
lea eax, [ebp + 8]
push eax
call fcn.00402e10
add esp, 4
jmp 0x402d92
mov ecx, dword [ebp - 0x10]
call fcn.00405310
test eax, eax
je 0x4029f8
mov ecx, dword [ebp - 0x10]
call fcn.00405310
mov esi, eax
mov ecx, dword [ebp - 0x10]
call fcn.004053a0
cmp esi, eax
jae 0x4029f8
lea ecx, [ebp + 8]
push ecx
call fcn.00402660
add esp, 4
mov bl, al
mov ecx, dword [ebp - 0x10]
call fcn.00405540
mov byte [eax], bl
mov eax, dword [ebp + 8]
jmp 0x402d92
mov edx, dword [ebp - 0x10]
cmp dword [edx + 0x54], 0
jne 0x402a0b
call fcn.00401ae0
jmp 0x402d92
mov ecx, dword [ebp - 0x10]
call fcn.00405c90
mov eax, dword [ebp - 0x10]
cmp dword [eax + 0x44], 0
jne 0x402a68
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx + 0x54]
push edx
lea eax, [ebp + 8]
push eax
call fcn.00402660
add esp, 4
movzx ecx, al
push ecx
call fcn.00402e60
add esp, 8
movzx edx, al
test edx, edx
je 0x402a4d
mov eax, dword [ebp + 8]
mov dword [ebp - 0xbc], eax
jmp 0x402a58
call fcn.00401ae0
mov dword [ebp - 0xbc], eax
mov eax, dword [ebp - 0xbc]
jmp 0x402d92
mov dword [ebp - 0x14], 8
lea ecx, [ebp + 8]
push ecx
call fcn.00402660
add esp, 4
mov byte [ebp - 0x19], al
push 0
push 8
lea ecx, [ebp - 0x5c]
call fcn.00403dd0
mov dword [ebp - 4], 0
lea edx, [ebp - 0x34]
push edx
lea eax, [ebp - 0x78]
push eax
lea ecx, [ebp - 0x5c]
call fcn.00404030
mov dword [ebp - 0xc0], eax
mov ecx, dword [ebp - 0xc0]
mov dword [ebp - 0xc4], ecx
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0xc4]
call fcn.00406040
mov esi, eax
lea ecx, [ebp - 0x5c]
call fcn.00404080
add esi, eax
push esi
lea edx, [ebp - 0x84]
push edx
lea ecx, [ebp - 0x5c]
call fcn.00404030
mov dword [ebp - 0xc8], eax
mov eax, dword [ebp - 0xc8]
mov dword [ebp - 0xcc], eax
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0xcc]
call fcn.00406040
push eax
lea ecx, [ebp - 0x28]
push ecx
lea edx, [ebp - 0x18]
push edx
lea eax, [ebp - 0x19]
push eax
mov ecx, dword [ebp - 0x10]
add ecx, 0x4c
push ecx
mov edx, dword [ebp - 0x10]
mov ecx, dword [edx + 0x44]
call fcn.00405fe0
mov dword [ebp - 0x6c], eax
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x84]
call fcn.00403b50
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x78]
call fcn.00403b50
mov eax, dword [ebp - 0x6c]
mov dword [ebp - 0xd0], eax
cmp dword [ebp - 0xd0], 0
jl 0x402d5c
cmp dword [ebp - 0xd0], 1
jle 0x402b6d
cmp dword [ebp - 0xd0], 3
je 0x402d08
jmp 0x402d5c
lea ecx, [ebp - 0x90]
push ecx
lea ecx, [ebp - 0x5c]
call fcn.00404030
mov dword [ebp - 0xd4], eax
mov edx, dword [ebp - 0xd4]
mov dword [ebp - 0xd8], edx
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0xd8]
call fcn.00406040
mov ecx, dword [ebp - 0x34]
sub ecx, eax
mov dword [ebp - 0x64], ecx
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x90]
call fcn.00403b50
cmp dword [ebp - 0x64], 0
jbe 0x402c20
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x54]
push eax
mov ecx, dword [ebp - 0x64]
push ecx
push 1
lea edx, [ebp - 0xa0]
push edx
lea ecx, [ebp - 0x5c]
call fcn.00404030
mov dword [ebp - 0xdc], eax
mov eax, dword [ebp - 0xdc]
mov dword [ebp - 0xe0], eax
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0xb8]
or ecx, 1
mov dword [ebp - 0xb8], ecx
mov ecx, dword [ebp - 0xe0]
call fcn.00406040
push eax
call fcn.0040af80
add esp, 0x10
cmp dword [ebp - 0x64], eax
je 0x402c20
mov dword [ebp - 0xe4], 1
jmp 0x402c2a
mov dword [ebp - 0xe4], 0
mov dl, byte [ebp - 0xe4]
mov byte [ebp - 0x91], dl
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0xb8]
and eax, 1
je 0x402c5a
and dword [ebp - 0xb8], 0xfffffffe
lea ecx, [ebp - 0xa0]
call fcn.00403b50
movzx ecx, byte [ebp - 0x91]
test ecx, ecx
je 0x402c8a
call fcn.00401ae0
mov dword [ebp - 0xa4], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5c]
call fcn.00401870
mov eax, dword [ebp - 0xa4]
jmp 0x402d92
mov edx, dword [ebp - 0x10]
mov byte [edx + 0x49], 1
mov eax, dword [ebp - 0x28]
lea ecx, [ebp - 0x19]
cmp eax, ecx
je 0x402cbe
mov edx, dword [ebp + 8]
mov dword [ebp - 0xa8], edx
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5c]
call fcn.00401870
mov eax, dword [ebp - 0xa8]
jmp 0x402d92
cmp dword [ebp - 0x64], 0
jbe 0x402cc6
jmp 0x402d06
lea ecx, [ebp - 0x5c]
call fcn.00404080
cmp eax, 0x20
jae 0x402ce1
push 0
push 8
lea ecx, [ebp - 0x5c]
call fcn.00403e60
jmp 0x402d06
call fcn.00401ae0
mov dword [ebp - 0xac], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5c]
call fcn.00401870
mov eax, dword [ebp - 0xac]
jmp 0x402d92
jmp 0x402d7e
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x54]
push ecx
movzx edx, byte [ebp - 0x19]
push edx
call fcn.00402e60
add esp, 8
movzx eax, al
test eax, eax
je 0x402d2e
mov ecx, dword [ebp + 8]
mov dword [ebp - 0xe8], ecx
jmp 0x402d39
call fcn.00401ae0
mov dword [ebp - 0xe8], eax
mov edx, dword [ebp - 0xe8]
mov dword [ebp - 0xb0], edx
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5c]
call fcn.00401870
mov eax, dword [ebp - 0xb0]
jmp 0x402d92
call fcn.00401ae0
mov dword [ebp - 0xb4], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5c]
call fcn.00401870
mov eax, dword [ebp - 0xb4]
jmp 0x402d92
jmp 0x402a91
push edx
mov ecx, ebp
push eax
lea edx, [0x402dc4]
call fcn.0040ac50
pop eax
pop edx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
add esp, 0xe8
cmp ebp, esp
call fcn.0040ac20
mov esp, ebp
pop ebp
ret 4