Function at 0x40c040
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x47b348
mov eax, dword fs:[0]
push eax
sub esp, 0x58
mov eax, dword [0x49d7a0]
xor eax, esp
mov dword [esp + 0x50], eax
push ebx
push esi
push edi
mov eax, dword [0x49d7a0]
xor eax, esp
push eax
lea eax, [esp + 0x68]
mov dword fs:[0], eax
mov ebx, ecx
mov ecx, dword [ebp + 8]
cmp ecx, 0xffffffff
mov dword [esp + 0x38], ebx
jne 0x40c08c
xor eax, eax
jmp 0x40c3d7
mov eax, dword [ebx + 0x24]
mov edx, dword [eax]
test edx, edx
je 0x40c0b6
mov eax, dword [ebx + 0x34]
mov esi, dword [eax]
add esi, edx
cmp edx, esi
jae 0x40c0b6
add dword [eax], 0xffffffff
mov ebx, dword [ebx + 0x24]
mov eax, dword [ebx]
lea edx, [eax + 1]
mov dword [ebx], edx
mov byte [eax], cl
mov eax, ecx
jmp 0x40c3d7
mov eax, dword [ebx + 0x4c]
test eax, eax
je 0x40c3d4
cmp dword [ebx + 0x3c], 0
jne 0x40c0e5
push eax
movsx eax, cl
push eax
call fcn.0043fd46
add esp, 8
cmp eax, 0xffffffff
je 0x40c3d4
mov eax, dword [ebp + 8]
jmp 0x40c3d7
lea esi, [esp + 0x44]
mov byte [esp + 0x13], cl
call fcn.0040cdb0
mov dword [esp + 0x70], 0
lea ecx, [esp + 0x44]
call fcn.004025e0
lea ecx, [esp + 0x18]
mov esi, eax
call fcn.004076e0
test esi, esi
je 0x40c130
lea ecx, [esp + 0x44]
call fcn.004025e0
cmp eax, esi
ja 0x40c130
lea ecx, [esp + 0x44]
call fcn.004025e0
add eax, dword [esp + 0x58]
cmp esi, eax
jbe 0x40c135
call fcn.0043c2d0
lea ecx, [esp + 0x44]
mov edx, ecx
cmp edx, 0xfffffffe
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], esi
je 0x40c15f
call fcn.004025e0
mov ecx, dword [esp + 0x18]
add eax, dword [ecx + 0x14]
cmp dword [esp + 0x1c], eax
jb 0x40c15f
call fcn.0043c2d0
mov edi, dword [esp + 0x1c]
lea ecx, [esp + 0x44]
call fcn.004025e0
lea ecx, [esp + 0x20]
mov esi, eax
call fcn.004076e0
test esi, esi
je 0x40c199
lea ecx, [esp + 0x44]
call fcn.004025e0
cmp eax, esi
ja 0x40c199
lea ecx, [esp + 0x44]
call fcn.004025e0
add eax, dword [esp + 0x58]
cmp esi, eax
jbe 0x40c19e
call fcn.0043c2d0
lea edx, [esp + 0x44]
mov eax, edx
cmp eax, 0xfffffffe
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], esi
je 0x40c1ca
mov ecx, edx
call fcn.004025e0
mov ecx, dword [esp + 0x20]
add eax, dword [ecx + 0x14]
cmp dword [esp + 0x24], eax
jb 0x40c1ca
call fcn.0043c2d0
mov esi, dword [esp + 0x24]
lea ecx, [esp + 0x44]
call fcn.004024e0
mov ecx, dword [ebx + 0x3c]
mov edx, dword [ecx]
mov edx, dword [edx + 0x14]
add eax, edi
lea edi, [esp + 0x3c]
push edi
push eax
push esi
lea eax, [esp + 0x4c]
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x27]
push eax
lea eax, [ebx + 0x44]
push eax
call edx
test eax, eax
jl 0x40c3cb
cmp eax, 1
jg 0x40c388
lea ecx, [esp + 0x44]
call fcn.004025e0
lea ecx, [esp + 0x30]
mov esi, eax
call fcn.004076e0
test esi, esi
je 0x40c244
lea ecx, [esp + 0x44]
call fcn.004025e0
cmp eax, esi
ja 0x40c244
lea ecx, [esp + 0x44]
call fcn.004025e0
add eax, dword [esp + 0x58]
cmp esi, eax
jbe 0x40c249
call fcn.0043c2d0
lea eax, [esp + 0x44]
mov ecx, eax
cmp ecx, 0xfffffffe
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], esi
je 0x40c273
call fcn.004025e0
mov edx, dword [esp + 0x30]
add eax, dword [edx + 0x14]
cmp dword [esp + 0x34], eax
jb 0x40c273
call fcn.0043c2d0
mov esi, dword [esp + 0x3c]
sub esi, dword [esp + 0x34]
je 0x40c302
lea ecx, [esp + 0x44]
call fcn.004025e0
lea ecx, [esp + 0x28]
mov edi, eax
call fcn.004076e0
test edi, edi
je 0x40c2b7
lea ecx, [esp + 0x44]
call fcn.004025e0
cmp eax, edi
ja 0x40c2b7
lea ecx, [esp + 0x44]
call fcn.004025e0
add eax, dword [esp + 0x58]
cmp edi, eax
jbe 0x40c2bc
call fcn.0043c2d0
lea eax, [esp + 0x44]
mov ecx, eax
cmp ecx, 0xfffffffe
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], edi
je 0x40c2e6
call fcn.004025e0
mov edx, dword [esp + 0x28]
add eax, dword [edx + 0x14]
cmp dword [esp + 0x2c], eax
jb 0x40c2e6
call fcn.0043c2d0
mov eax, dword [ebx + 0x4c]
mov ecx, dword [esp + 0x2c]
push eax
push esi
push 1
push ecx
call fcn.0043f8bc
add esp, 0x10
cmp esi, eax
jne 0x40c3cb
lea edx, [esp + 0x13]
cmp dword [esp + 0x40], edx
mov byte [ebx + 0x41], 1
jne 0x40c3bd
test esi, esi
ja 0x40c0fa
lea ecx, [esp + 0x44]
call fcn.004024e0
cmp eax, 0x20
jae 0x40c3cb
or eax, 0xffffffff
sub eax, dword [esp + 0x58]
cmp eax, 8
ja 0x40c33f
call fcn.00458fd4
mov edi, dword [esp + 0x58]
push 0
add edi, 8
push edi
lea ecx, [esp + 0x4c]
call fcn.00402540
test al, al
je 0x40c0fa
mov ebx, dword [esp + 0x58]
lea ecx, [esp + 0x44]
mov byte [esp + 0x14], 0
xor esi, esi
call fcn.004025e0
add eax, ebx
mov dword [eax], esi
push edi
lea ecx, [esp + 0x48]
mov dword [eax + 4], esi
call fcn.00402500
mov ebx, dword [esp + 0x38]
jmp 0x40c0fa
cmp eax, 3
jne 0x40c3cb
mov eax, dword [ebx + 0x4c]
mov cl, byte [esp + 0x13]
call fcn.0040abc0
test al, al
je 0x40c3ad
mov esi, dword [ebp + 8]
lea ecx, [esp + 0x44]
call fcn.00402010
mov eax, esi
jmp 0x40c3d7
lea ecx, [esp + 0x44]
or esi, 0xffffffff
call fcn.00402010
mov eax, esi
jmp 0x40c3d7
lea ecx, [esp + 0x44]
call fcn.00402010
mov eax, dword [ebp + 8]
jmp 0x40c3d7
lea ecx, [esp + 0x44]
call fcn.00402010
or eax, 0xffffffff
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x50]
xor ecx, esp
call fcn.0043bd9a
mov esp, ebp
pop ebp
ret 4