Function at 0x405870
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x434c12
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xb0
push esi
push edi
push ecx
lea edi, [ebp - 0xbc]
mov ecx, 0x2c
mov eax, 0xcccccccc
rep stosd dword es:[edi], eax
pop ecx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x94], 0
mov eax, dword [ebp - 0x10]
cmp dword [eax + 0x44], 0
je 0x4058c5
mov ecx, dword [ebp - 0x10]
movzx edx, byte [ecx + 0x49]
test edx, edx
jne 0x4058d1
mov al, 1
jmp 0x405b97
mov dword [ebp - 0x14], 8
call fcn.00401ae0
mov esi, esp
push eax
mov eax, dword [ebp - 0x10]
mov edx, dword [eax]
mov ecx, dword [ebp - 0x10]
mov eax, dword [edx + 0xc]
call eax
cmp esi, esp
call fcn.0040ac20
mov dword [ebp - 0x50], eax
call fcn.00401ae0
mov dword [ebp - 0x54], eax
lea ecx, [ebp - 0x50]
push ecx
lea edx, [ebp - 0x54]
push edx
call fcn.00401ac0
add esp, 8
movzx eax, al
test eax, eax
je 0x40591d
xor al, al
jmp 0x405b97
push 0
push 8
lea ecx, [ebp - 0x44]
call fcn.00403dd0
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x1c]
push ecx
lea edx, [ebp - 0x64]
push edx
lea ecx, [ebp - 0x44]
call fcn.00404030
mov dword [ebp - 0x98], eax
mov eax, dword [ebp - 0x98]
mov dword [ebp - 0x9c], eax
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x9c]
call fcn.00406040
mov esi, eax
lea ecx, [ebp - 0x44]
call fcn.00404080
add esi, eax
push esi
lea ecx, [ebp - 0x70]
push ecx
lea ecx, [ebp - 0x44]
call fcn.00404030
mov dword [ebp - 0xa0], eax
mov edx, dword [ebp - 0xa0]
mov dword [ebp - 0xa4], edx
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0xa4]
call fcn.00406040
push eax
mov eax, dword [ebp - 0x10]
add eax, 0x4c
push eax
mov ecx, dword [ebp - 0x10]
mov ecx, dword [ecx + 0x44]
call fcn.00406a00
mov dword [ebp - 0x58], eax
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x70]
call fcn.00403b50
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x64]
call fcn.00403b50
mov edx, dword [ebp - 0x58]
mov dword [ebp - 0xa8], edx
cmp dword [ebp - 0xa8], 0
je 0x4059f6
cmp dword [ebp - 0xa8], 1
je 0x4059fd
cmp dword [ebp - 0xa8], 3
je 0x405b47
jmp 0x405b65
mov eax, dword [ebp - 0x10]
mov byte [eax + 0x49], 0
lea ecx, [ebp - 0x7c]
push ecx
lea ecx, [ebp - 0x44]
call fcn.00404030
mov dword [ebp - 0xac], eax
mov edx, dword [ebp - 0xac]
mov dword [ebp - 0xb0], edx
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0xb0]
call fcn.00406040
mov ecx, dword [ebp - 0x1c]
sub ecx, eax
mov dword [ebp - 0x4c], ecx
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x7c]
call fcn.00403b50
cmp dword [ebp - 0x4c], 0
jbe 0x405aaa
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x54]
push eax
mov ecx, dword [ebp - 0x4c]
push ecx
push 1
lea edx, [ebp - 0x8c]
push edx
lea ecx, [ebp - 0x44]
call fcn.00404030
mov dword [ebp - 0xb4], eax
mov eax, dword [ebp - 0xb4]
mov dword [ebp - 0xb8], eax
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0x94]
or ecx, 1
mov dword [ebp - 0x94], ecx
mov ecx, dword [ebp - 0xb8]
call fcn.00406040
push eax
call fcn.0040af80
add esp, 0x10
cmp dword [ebp - 0x4c], eax
je 0x405aaa
mov dword [ebp - 0xbc], 1
jmp 0x405ab4
mov dword [ebp - 0xbc], 0
mov dl, byte [ebp - 0xbc]
mov byte [ebp - 0x7d], dl
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x94]
and eax, 1
je 0x405ae1
and dword [ebp - 0x94], 0xfffffffe
lea ecx, [ebp - 0x8c]
call fcn.00403b50
movzx ecx, byte [ebp - 0x7d]
test ecx, ecx
je 0x405b0a
mov byte [ebp - 0x8d], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x44]
call fcn.00401870
mov al, byte [ebp - 0x8d]
jmp 0x405b97
mov edx, dword [ebp - 0x10]
movzx eax, byte [edx + 0x49]
test eax, eax
jne 0x405b33
mov byte [ebp - 0x8e], 1
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x44]
call fcn.00401870
mov al, byte [ebp - 0x8e]
jmp 0x405b97
cmp dword [ebp - 0x4c], 0
jne 0x405b45
push 0
push 8
lea ecx, [ebp - 0x44]
call fcn.00403e60
jmp 0x405b83
mov byte [ebp - 0x8f], 1
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x44]
call fcn.00401870
mov al, byte [ebp - 0x8f]
jmp 0x405b97
mov byte [ebp - 0x90], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x44]
call fcn.00401870
mov al, byte [ebp - 0x90]
jmp 0x405b97
jmp 0x405930
push edx
mov ecx, ebp
push eax
lea edx, [0x405bc8]
call fcn.0040ac50
pop eax
pop edx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
add esp, 0xbc
cmp ebp, esp
call fcn.0040ac20
mov esp, ebp
pop ebp
ret