Function at 0x40cd00
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 0x40cd51
xor eax, eax
jmp 0x40d013
mov eax, dword [edi + 0x24]
cmp dword [eax], esi
je 0x40cd7a
mov ecx, dword [eax]
mov eax, dword [edi + 0x34]
mov edx, dword [eax]
add edx, ecx
cmp ecx, edx
jae 0x40cd7a
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 0x40d013
cmp dword [edi + 0x54], esi
je 0x40d010
mov ecx, dword [edi + 0x10]
lea edx, [edi + 0x48]
cmp dword [ecx], edx
jne 0x40cda1
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 0x40cdc6
mov edi, dword [edi + 0x54]
movsx eax, bl
push edi
push eax
call fcn.004216c0
add esp, 8
cmp eax, 0xffffffff
je 0x40d010
mov eax, ebx
jmp 0x40d013
push esi
push 8
lea ecx, [esp + 0x60]
mov byte [esp + 0x1a], bl
call fcn.0040e150
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x5c]
push edx
mov dword [esp + 0x90], esi
call fcn.00406880
mov esi, eax
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x5c]
push ecx
mov byte [esp + 0x90], 1
call fcn.00406880
mov ebx, eax
mov byte [esp + 0x88], 2
call fcn.0040f210
mov edx, dword [esp + 0x6c]
mov esi, ebx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], edx
call fcn.0040f210
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.004050a0
lea ecx, [esp + 0x28]
mov byte [esp + 0x88], 0
call fcn.004050a0
test esi, esi
js 0x40cffc
cmp esi, 1
jg 0x40d036
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x5c]
push ecx
call fcn.00406880
mov esi, eax
mov byte [esp + 0x88], 3
call fcn.0040f210
mov ebx, dword [esp + 0x20]
lea ecx, [esp + 0x40]
sub ebx, eax
mov byte [esp + 0x88], 0
call fcn.004050a0
test ebx, ebx
je 0x40cefd
lea edx, [esp + 0x4c]
push edx
lea eax, [esp + 0x5c]
push eax
call fcn.00406880
mov byte [esp + 0x88], 4
or dword [esp + 0x14], 1
mov esi, eax
call fcn.0040f210
mov ecx, dword [edi + 0x54]
push ecx
push ebx
push 1
push eax
call fcn.004263f0
add esp, 0x10
mov byte [esp + 0x13], 1
cmp ebx, eax
jne 0x40cf02
mov byte [esp + 0x13], 0
mov dword [esp + 0x88], 0
test byte [esp + 0x14], 1
je 0x40cf22
and dword [esp + 0x14], 0xfffffffe
lea ecx, [esp + 0x4c]
call fcn.004050a0
cmp byte [esp + 0x13], 0
jne 0x40cffc
lea edx, [esp + 0x12]
mov byte [edi + 0x49], 1
cmp dword [esp + 0x24], edx
jne 0x40d072
test ebx, ebx
jne 0x40cf5a
cmp dword [esp + 0x6c], 0x20
lea ecx, [esp + 0x58]
jae 0x40d000
push ebx
push 8
call fcn.0040e200
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x5c]
push ecx
call fcn.00406880
mov esi, eax
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x5c]
push eax
mov byte [esp + 0x90], 1
call fcn.00406880
mov ebx, eax
mov byte [esp + 0x88], 2
call fcn.0040f210
mov ecx, dword [esp + 0x6c]
mov esi, ebx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ecx
call fcn.0040f210
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.004050a0
lea ecx, [esp + 0x28]
mov byte [esp + 0x88], 0
call fcn.004050a0
test esi, esi
jns 0x40ce7f
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.0041fd40
mov esp, ebp
pop ebp
ret 4
cmp esi, 3
jne 0x40cffc
mov edi, dword [edi + 0x54]
movsx eax, byte [esp + 0x12]
push edi
push eax
call fcn.004216c0
add esp, 8
cmp eax, 0xffffffff
je 0x40d057
mov esi, dword [ebp + 8]
jmp 0x40d05a
or esi, 0xffffffff
lea ecx, [esp + 0x58]
mov dword [esp + 0x88], 0xffffffff
call fcn.00401210
mov eax, esi
jmp 0x40d013
lea ecx, [esp + 0x58]
mov dword [esp + 0x88], 0xffffffff
call fcn.00401210
mov eax, dword [ebp + 8]
jmp 0x40d013