Function at 0x40ccf0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x451f49
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x46a524]
xor eax, esp
mov dword [esp + 0x68], eax
push ebx
push esi
push edi
mov eax, dword [0x46a524]
xor eax, esp
push eax
lea eax, [esp + 0x80]
mov dword fs:[0], eax
mov ebx, dword [ebp + 8]
xor esi, esi
mov edi, ecx
mov dword [esp + 0x14], esi
cmp ebx, 0xffffffff
jne 0x40cd41
xor eax, eax
jmp 0x40d003
mov eax, dword [edi + 0x24]
cmp dword [eax], esi
je 0x40cd6a
mov ecx, dword [eax]
mov eax, dword [edi + 0x34]
mov edx, dword [eax]
add edx, ecx
cmp ecx, edx
jae 0x40cd6a
dec dword [eax]
mov edi, dword [edi + 0x24]
mov eax, dword [edi]
lea ecx, [eax + 1]
mov dword [edi], ecx
mov byte [eax], bl
mov eax, ebx
jmp 0x40d003
cmp dword [edi + 0x54], esi
je 0x40d000
mov ecx, dword [edi + 0x10]
lea edx, [edi + 0x48]
cmp dword [ecx], edx
jne 0x40cd91
mov edx, dword [edi + 0x3c]
mov eax, dword [edi + 0x40]
mov dword [ecx], edx
mov ecx, dword [edi + 0x20]
mov dword [ecx], eax
mov edx, dword [edi + 0x30]
sub eax, eax
mov dword [edx], eax
cmp dword [edi + 0x44], esi
jne 0x40cdb6
mov edi, dword [edi + 0x54]
movsx eax, bl
push edi
push eax
call fcn.004216b0
add esp, 8
cmp eax, 0xffffffff
je 0x40d000
mov eax, ebx
jmp 0x40d003
push esi
push 8
lea ecx, [esp + 0x60]
mov byte [esp + 0x1a], bl
call fcn.0040e140
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x5c]
push edx
mov dword [esp + 0x90], esi
call fcn.00406870
mov esi, eax
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x5c]
push ecx
mov byte [esp + 0x90], 1
call fcn.00406870
mov ebx, eax
mov byte [esp + 0x88], 2
call fcn.0040f200
mov edx, dword [esp + 0x6c]
mov esi, ebx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], edx
call fcn.0040f200
mov ecx, dword [edi + 0x44]
mov edx, dword [ecx]
mov edx, dword [edx + 0x14]
lea esi, [esp + 0x20]
push esi
mov esi, dword [esp + 0x1c]
add esi, dword [esp + 0x20]
push esi
push eax
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x23]
push eax
lea eax, [esp + 0x26]
push eax
lea eax, [edi + 0x4c]
push eax
call edx
lea ecx, [esp + 0x34]
mov esi, eax
mov byte [esp + 0x88], 1
call fcn.00405090
lea ecx, [esp + 0x28]
mov byte [esp + 0x88], 0
call fcn.00405090
test esi, esi
js 0x40cfec
cmp esi, 1
jg 0x40d026
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x5c]
push ecx
call fcn.00406870
mov esi, eax
mov byte [esp + 0x88], 3
call fcn.0040f200
mov ebx, dword [esp + 0x20]
lea ecx, [esp + 0x40]
sub ebx, eax
mov byte [esp + 0x88], 0
call fcn.00405090
test ebx, ebx
je 0x40ceed
lea edx, [esp + 0x4c]
push edx
lea eax, [esp + 0x5c]
push eax
call fcn.00406870
mov byte [esp + 0x88], 4
or dword [esp + 0x14], 1
mov esi, eax
call fcn.0040f200
mov ecx, dword [edi + 0x54]
push ecx
push ebx
push 1
push eax
call fcn.004263d0
add esp, 0x10
mov byte [esp + 0x13], 1
cmp ebx, eax
jne 0x40cef2
mov byte [esp + 0x13], 0
mov dword [esp + 0x88], 0
test byte [esp + 0x14], 1
je 0x40cf12
and dword [esp + 0x14], 0xfffffffe
lea ecx, [esp + 0x4c]
call fcn.00405090
cmp byte [esp + 0x13], 0
jne 0x40cfec
lea edx, [esp + 0x12]
mov byte [edi + 0x49], 1
cmp dword [esp + 0x24], edx
jne 0x40d062
test ebx, ebx
jne 0x40cf4a
cmp dword [esp + 0x6c], 0x20
lea ecx, [esp + 0x58]
jae 0x40cff0
push ebx
push 8
call fcn.0040e1f0
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x5c]
push ecx
call fcn.00406870
mov esi, eax
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x5c]
push eax
mov byte [esp + 0x90], 1
call fcn.00406870
mov ebx, eax
mov byte [esp + 0x88], 2
call fcn.0040f200
mov ecx, dword [esp + 0x6c]
mov esi, ebx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ecx
call fcn.0040f200
mov ecx, dword [edi + 0x44]
mov edx, dword [ecx]
mov edx, dword [edx + 0x14]
lea esi, [esp + 0x20]
push esi
mov esi, dword [esp + 0x1c]
add esi, dword [esp + 0x20]
push esi
push eax
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x23]
push eax
lea eax, [esp + 0x26]
push eax
lea eax, [edi + 0x4c]
push eax
call edx
lea ecx, [esp + 0x34]
mov esi, eax
mov byte [esp + 0x88], 1
call fcn.00405090
lea ecx, [esp + 0x28]
mov byte [esp + 0x88], 0
call fcn.00405090
test esi, esi
jns 0x40ce6f
lea ecx, [esp + 0x58]
mov dword [esp + 0x88], 0xffffffff
call fcn.00401210
or eax, 0xffffffff
mov ecx, dword [esp + 0x80]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x68]
xor ecx, esp
call fcn.0041fd30
mov esp, ebp
pop ebp
ret 4
cmp esi, 3
jne 0x40cfec
mov edi, dword [edi + 0x54]
movsx eax, byte [esp + 0x12]
push edi
push eax
call fcn.004216b0
add esp, 8
cmp eax, 0xffffffff
je 0x40d047
mov esi, dword [ebp + 8]
jmp 0x40d04a
or esi, 0xffffffff
lea ecx, [esp + 0x58]
mov dword [esp + 0x88], 0xffffffff
call fcn.00401210
mov eax, esi
jmp 0x40d003
lea ecx, [esp + 0x58]
mov dword [esp + 0x88], 0xffffffff
call fcn.00401210
mov eax, dword [ebp + 8]
jmp 0x40d003