Function at 0x405980
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4184a8
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x420034]
xor eax, esp
mov dword [esp + 0x28], eax
push ebx
push esi
push edi
mov eax, dword [0x420034]
xor eax, esp
push eax
lea eax, [esp + 0x40]
mov dword fs:[0], eax
cmp dword [ecx + 0x3c], 0
mov dword [esp + 0x10], ecx
je 0x405d15
cmp byte [ecx + 0x41], 0
je 0x405d15
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push 0xffffffffffffffff
call edx
cmp eax, 0xffffffff
je 0x405d08
lea esi, [esp + 0x1c]
call fcn.004054a0
mov dword [esp + 0x48], 0
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
lea ebx, [ebx]
cmp ecx, 0x10
jb 0x405b13
test eax, eax
mov ebx, eax
mov dword [esp + 0x14], ebx
je 0x405a37
cmp ecx, 0x10
mov edx, eax
jae 0x405a1e
lea edx, [esp + 0x20]
cmp edx, ebx
ja 0x405a37
cmp ecx, 0x10
mov edx, eax
jae 0x405a2d
lea edx, [esp + 0x20]
mov esi, dword [esp + 0x30]
add edx, esi
cmp ebx, edx
jbe 0x405a44
call fcn.00406c98
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x1c]
cmp edx, 0xfffffffe
je 0x405a6f
cmp ecx, 0x10
mov edx, eax
jae 0x405a58
lea edx, [esp + 0x20]
mov esi, dword [esp + 0x30]
add edx, esi
cmp ebx, edx
jb 0x405a6f
call fcn.00406c98
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
cmp ecx, 0x10
mov edi, dword [esp + 0x30]
jb 0x405b20
test eax, eax
mov esi, eax
je 0x405aaa
cmp ecx, 0x10
mov edx, eax
jae 0x405a8d
lea edx, [esp + 0x20]
cmp edx, esi
ja 0x405aaa
cmp ecx, 0x10
mov edx, eax
jae 0x405a9c
lea edx, [esp + 0x20]
mov ebx, dword [esp + 0x30]
add edx, ebx
cmp esi, edx
mov ebx, dword [esp + 0x14]
jbe 0x405ab7
call fcn.00406c98
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x1c]
cmp edx, 0xfffffffe
je 0x405ad8
cmp ecx, 0x10
jae 0x405ac9
lea eax, [esp + 0x20]
mov ecx, dword [esp + 0x30]
add eax, ecx
cmp esi, eax
jb 0x405ad8
call fcn.00406c98
mov edx, dword [esp + 0x10]
mov ecx, dword [edx + 0x3c]
mov edx, dword [ecx]
mov edx, dword [edx + 0x18]
lea eax, [esp + 0x18]
push eax
mov eax, dword [esp + 0x14]
add ebx, edi
push ebx
push esi
add eax, 0x44
push eax
call edx
sub eax, 0
je 0x405b29
sub eax, 1
je 0x405b31
sub eax, 2
lea ecx, [esp + 0x1c]
jne 0x405d03
jmp 0x405d10
lea ebx, [esp + 0x20]
mov dword [esp + 0x14], ebx
jmp 0x405a13
lea esi, [esp + 0x20]
jmp 0x405a82
mov eax, dword [esp + 0x10]
mov byte [eax + 0x41], 0
mov ecx, dword [esp + 0x34]
cmp ecx, 0x10
mov eax, dword [esp + 0x20]
jb 0x405cd4
test eax, eax
mov esi, eax
je 0x405b6c
cmp ecx, 0x10
mov edx, eax
jae 0x405b53
lea edx, [esp + 0x20]
cmp edx, esi
ja 0x405b6c
cmp ecx, 0x10
mov edx, eax
jae 0x405b62
lea edx, [esp + 0x20]
mov edi, dword [esp + 0x30]
add edx, edi
cmp esi, edx
jbe 0x405b79
call fcn.00406c98
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x1c]
cmp edx, 0xfffffffe
je 0x405ba4
cmp ecx, 0x10
mov edx, eax
jae 0x405b8d
lea edx, [esp + 0x20]
mov edi, dword [esp + 0x30]
add edx, edi
cmp esi, edx
jb 0x405ba4
call fcn.00406c98
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
sub edi, esi
je 0x405c35
cmp ecx, 0x10
jb 0x405cdd
test eax, eax
mov esi, eax
je 0x405be3
cmp ecx, 0x10
mov edx, eax
jae 0x405bca
lea edx, [esp + 0x20]
cmp edx, esi
ja 0x405be3
cmp ecx, 0x10
mov edx, eax
jae 0x405bd9
lea edx, [esp + 0x20]
mov ebx, dword [esp + 0x30]
add edx, ebx
cmp esi, edx
jbe 0x405bf0
call fcn.00406c98
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x1c]
cmp edx, 0xfffffffe
je 0x405c11
cmp ecx, 0x10
jae 0x405c02
lea eax, [esp + 0x20]
mov ecx, dword [esp + 0x30]
add eax, ecx
cmp esi, eax
jb 0x405c11
call fcn.00406c98
mov edx, dword [esp + 0x10]
mov eax, dword [edx + 0x4c]
push eax
push edi
push 1
push esi
call fcn.0040752a
add esp, 0x10
cmp edi, eax
jne 0x405cff
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x10]
cmp byte [edx + 0x41], 0
je 0x405d0c
test edi, edi
jne 0x405a00
or edx, 0xffffffff
sub edx, dword [esp + 0x30]
cmp edx, 8
ja 0x405c64
call fcn.00413f57
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
mov esi, dword [esp + 0x30]
add esi, 8
cmp esi, 0xfffffffe
jbe 0x405c7d
call fcn.00413f57
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
cmp ecx, esi
jae 0x405ce6
mov eax, dword [esp + 0x30]
push eax
push esi
lea ecx, [esp + 0x24]
call fcn.00401de0
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
test esi, esi
jbe 0x405a00
cmp ecx, 0x10
mov ecx, eax
jae 0x405cab
lea ecx, [esp + 0x20]
mov edx, dword [esp + 0x30]
xor eax, eax
add ecx, edx
mov dword [ecx], eax
mov dword [ecx + 4], eax
cmp dword [esp + 0x34], 0x10
mov eax, dword [esp + 0x20]
mov dword [esp + 0x30], esi
jae 0x405ccb
lea eax, [esp + 0x20]
mov byte [eax + esi], 0
jmp 0x4059f2
lea esi, [esp + 0x20]
jmp 0x405b48
lea esi, [esp + 0x20]
jmp 0x405bbf
test esi, esi
jne 0x405c9a
cmp ecx, 0x10
mov dword [esp + 0x30], esi
jae 0x405cf7
lea eax, [esp + 0x20]
mov byte [eax], 0
jmp 0x4059f2
lea ecx, [esp + 0x1c]
call fcn.00401860
xor al, al
jmp 0x405d17
lea ecx, [esp + 0x1c]
call fcn.00401860
mov al, 1
mov ecx, dword [esp + 0x40]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.004063ce
mov esp, ebp
pop ebp
ret