Function at 0x405f40
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x478b38
mov eax, dword fs:[0]
push eax
sub esp, 0x7c
mov eax, dword [0x4922f8]
xor eax, ebp
mov dword [ebp - 0x20], eax
push ebx
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x7c], ecx
call fcn.004034c0
mov dword [ebp - 0x44], eax
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0x44]
push ecx
call fcn.0041ca60
add esp, 8
movzx edx, al
test edx, edx
je 0x405fa2
lea eax, [ebp + 8]
push eax
call fcn.004034d0
add esp, 4
jmp 0x406254
mov ecx, dword [ebp - 0x7c]
call fcn.00407690
test eax, eax
je 0x405fe9
mov ecx, dword [ebp - 0x7c]
call fcn.00407690
mov esi, eax
mov ecx, dword [ebp - 0x7c]
call fcn.00407750
cmp esi, eax
jae 0x405fe9
lea ecx, [ebp + 8]
push ecx
call fcn.004034a0
add esp, 4
mov bl, al
mov ecx, dword [ebp - 0x7c]
call fcn.00407930
mov byte [eax], bl
mov eax, dword [ebp + 8]
jmp 0x406254
mov edx, dword [ebp - 0x7c]
cmp dword [edx + 0x4c], 0
jne 0x406001
call fcn.004034c0
jmp 0x406254
mov eax, dword [ebp - 0x7c]
cmp dword [eax + 0x3c], 0
jne 0x40604d
mov ecx, dword [ebp - 0x7c]
mov edx, dword [ecx + 0x4c]
push edx
lea eax, [ebp + 8]
push eax
call fcn.004034a0
add esp, 4
movzx ecx, al
push ecx
call fcn.004046b0
add esp, 8
movzx edx, al
test edx, edx
je 0x406038
mov eax, dword [ebp + 8]
mov dword [ebp - 0x80], eax
jmp 0x406040
call fcn.004034c0
mov dword [ebp - 0x80], eax
mov eax, dword [ebp - 0x80]
jmp 0x406254
mov dword [ebp - 0x10], 8
lea ecx, [ebp + 8]
push ecx
call fcn.004034a0
add esp, 4
mov byte [ebp - 0x15], al
push 0
push 8
lea ecx, [ebp - 0x3c]
call fcn.00406f70
mov dword [ebp - 4], 0
lea edx, [ebp - 0x1c]
push edx
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0x3c]
call fcn.00401e80
mov ecx, eax
call fcn.00408ff0
mov esi, eax
lea ecx, [ebp - 0x3c]
call fcn.00401880
add esi, eax
push esi
lea ecx, [ebp - 0x54]
push ecx
lea ecx, [ebp - 0x3c]
call fcn.00401e80
mov ecx, eax
call fcn.00408ff0
push eax
lea edx, [ebp - 0x14]
push edx
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x15]
push ecx
mov edx, dword [ebp - 0x7c]
add edx, 0x44
push edx
mov eax, dword [ebp - 0x7c]
mov ecx, dword [eax + 0x3c]
call fcn.00408f10
mov dword [ebp - 0x84], eax
cmp dword [ebp - 0x84], 0
jl 0x406224
cmp dword [ebp - 0x84], 1
jle 0x4060fa
cmp dword [ebp - 0x84], 3
je 0x4061d6
jmp 0x406224
lea ecx, [ebp - 0x5c]
push ecx
lea ecx, [ebp - 0x3c]
call fcn.00401e80
mov ecx, eax
call fcn.00408ff0
mov edx, dword [ebp - 0x1c]
sub edx, eax
mov dword [ebp - 0x40], edx
je 0x406164
mov eax, dword [ebp - 0x7c]
mov ecx, dword [eax + 0x4c]
push ecx
mov edx, dword [ebp - 0x40]
push edx
push 1
lea eax, [ebp - 0x64]
push eax
lea ecx, [ebp - 0x3c]
call fcn.00401e80
mov ecx, eax
call fcn.00408ff0
push eax
call fcn.00445272
add esp, 0x10
cmp dword [ebp - 0x40], eax
je 0x406164
call fcn.004034c0
mov dword [ebp - 0x68], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x3c]
call fcn.004016d0
mov eax, dword [ebp - 0x68]
jmp 0x406254
mov ecx, dword [ebp - 0x7c]
mov byte [ecx + 0x41], 1
mov edx, dword [ebp - 0x14]
lea eax, [ebp - 0x15]
cmp edx, eax
je 0x406192
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x6c], ecx
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x3c]
call fcn.004016d0
mov eax, dword [ebp - 0x6c]
jmp 0x406254
cmp dword [ebp - 0x40], 0
jbe 0x40619a
jmp 0x4061d4
lea ecx, [ebp - 0x3c]
call fcn.00401880
cmp eax, 0x20
jae 0x4061b5
push 0
push 8
lea ecx, [ebp - 0x3c]
call fcn.00406fb0
jmp 0x4061d4
call fcn.004034c0
mov dword [ebp - 0x70], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x3c]
call fcn.004016d0
mov eax, dword [ebp - 0x70]
jmp 0x406254
jmp 0x406240
mov edx, dword [ebp - 0x7c]
mov eax, dword [edx + 0x4c]
push eax
movzx ecx, byte [ebp - 0x15]
push ecx
call fcn.004046b0
add esp, 8
movzx edx, al
test edx, edx
je 0x4061fc
mov eax, dword [ebp + 8]
mov dword [ebp - 0x88], eax
jmp 0x406207
call fcn.004034c0
mov dword [ebp - 0x88], eax
mov ecx, dword [ebp - 0x88]
mov dword [ebp - 0x74], ecx
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x3c]
call fcn.004016d0
mov eax, dword [ebp - 0x74]
jmp 0x406254
call fcn.004034c0
mov dword [ebp - 0x78], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x3c]
call fcn.004016d0
mov eax, dword [ebp - 0x78]
jmp 0x406254
jmp 0x406076
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov ecx, dword [ebp - 0x20]
xor ecx, ebp
call fcn.00442777
mov esp, ebp
pop ebp
ret 4