Function at 0x10041690
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10085fa8
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push esi
push edi
mov eax, dword [0x100c20a0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov ecx, dword [edi + 0x14]
mov ebx, dword [ebp + 8]
test ecx, ecx
je 0x100416ca
push ebx
call fcn.10067b90
push dword [ebx + 0xc]
call dword [0x1008c22c]
cmp dword [edi + 0x50], 0
jne 0x100419fa
mov dword [ebp - 0x34], 0x100ad8f8
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 4], 0
cmp dword [edi + 0x54], 0
je 0x10041791
mov eax, dword [edi + 0x28]
test eax, eax
je 0x10041732
push dword [edi + 0x20]
lea ecx, [ebp - 0x34]
push eax
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x30], 0
call fcn.1003d5d0
call dword [0x1008c1dc]
mov byte [ebp - 4], 1
push ecx
push eax
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x24], 0x100ad8f8
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
call fcn.1003e620
mov byte [ebp - 4], 2
mov esi, dword [ebp - 0x18]
push esi
push 0x100ade20
lea ecx, [ebp - 0x34]
call fcn.1003dd70
mov byte [ebp - 4], 0
test esi, esi
je 0x10041919
push esi
call fcn.1006a76f
add esp, 4
jmp 0x10041919
mov eax, dword [edi + 0xcc]
cmp eax, 0x3e8
jge 0x100417b6
inc eax
mov dword [edi + 0xcc], eax
lea eax, [edi + 0x2c]
push eax
lea ecx, [ebp - 0x34]
call fcn.1003d830
jmp 0x10041919
mov eax, dword [edi + 0x40]
inc dword [edi + 0xd0]
add eax, 0xfffffffc
push eax
push 0
lea eax, [ebp - 0x24]
push eax
lea ecx, [edi + 0x3c]
mov dword [edi + 0xcc], 1
call fcn.1003e020
push eax
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], 3
call fcn.1003d830
lea ecx, [ebp - 0x24]
mov byte [ebp - 4], 0
call fcn.10021af0
cmp dword [ebp - 0x28], 0
lea ecx, [ebp - 0x34]
jne 0x1004180b
push 1
push 0x100addf0
call fcn.1003d5d0
jmp 0x1004183a
mov eax, dword [ebp - 0x30]
inc eax
push eax
call fcn.1003dc00
test eax, eax
je 0x1004183a
mov esi, dword [ebp - 0x30]
mov eax, dword [ebp - 0x2c]
sub eax, esi
push 0x100addf0
push eax
mov eax, dword [ebp - 0x28]
lea eax, [eax + esi*2]
push eax
call fcn.1006ba47
add esp, 0xc
inc esi
mov dword [ebp - 0x30], esi
push dword [edi + 0xd0]
lea ecx, [ebp - 0x34]
call fcn.1003d8c0
cmp dword [ebp - 0x28], 0
lea ecx, [ebp - 0x34]
jne 0x1004185f
push 1
push 0x10097104
call fcn.1003d5d0
jmp 0x1004188d
mov eax, dword [ebp - 0x30]
inc eax
push eax
call fcn.1003dc00
test eax, eax
je 0x1004188d
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x2c]
sub eax, ecx
push 0x10097104
push eax
mov eax, dword [ebp - 0x28]
lea eax, [eax + ecx*2]
push eax
call fcn.1006ba47
add esp, 0xc
inc dword [ebp - 0x30]
mov eax, dword [edi + 0x40]
push 4
add eax, 0xfffffffc
push eax
lea eax, [ebp - 0x24]
push eax
lea ecx, [edi + 0x3c]
call fcn.1003e020
mov byte [ebp - 4], 4
mov ebx, dword [eax + 0xc]
test ebx, ebx
je 0x100418fe
mov esi, ebx
lea ecx, [esi + 2]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x100418b2
sub esi, ecx
sar esi, 1
cmp dword [ebp - 0x28], 0
lea ecx, [ebp - 0x34]
jne 0x100418d3
push esi
push ebx
call fcn.1003d5d0
jmp 0x100418fe
mov eax, dword [ebp - 0x30]
add eax, esi
push eax
call fcn.1003dc00
test eax, eax
je 0x100418fe
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x2c]
sub eax, ecx
push ebx
push eax
mov eax, dword [ebp - 0x28]
lea eax, [eax + ecx*2]
push eax
call fcn.1006ba47
add esp, 0xc
add dword [ebp - 0x30], esi
lea ecx, [ebp - 0x24]
mov byte [ebp - 4], 0
call fcn.10021af0
lea eax, [ebp - 0x34]
push eax
lea ecx, [edi + 0x2c]
call fcn.1003d830
mov ebx, dword [ebp + 8]
mov esi, dword [ebp - 0x28]
test esi, esi
je 0x100419fa
cmp dword [ebp - 0x30], 0
jne 0x10041930
push esi
jmp 0x100419f2
push ecx
lea eax, [ebp - 0x20]
push eax
mov ecx, ebx
call fcn.1003d310
lea eax, [edi + 0x64]
mov dword [ebp + 8], eax
test eax, eax
je 0x10041950
add eax, 4
push eax
call dword [0x1008c24c]
mov esi, dword [ebp - 0x28]
push 0x100ade34
lea eax, [ebp - 0x14]
push esi
push eax
mov dword [ebp - 0x14], 0
call fcn.1006c557
mov eax, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x18]
add esp, 0xc
test eax, eax
je 0x100419da
push 2
push 0
push eax
call fcn.1006c6f5
add esp, 0xc
push dword [ebp - 0x14]
call fcn.1006cacd
mov ecx, dword [ebp - 0x14]
add esp, 4
test ecx, ecx
je 0x100419da
cmp eax, dword [edi + 0x4c]
jl 0x100419bf
push ecx
call fcn.1006cba1
add esp, 4
lea eax, [ebp - 0x14]
push 0x100ade3c
push esi
push eax
mov dword [ebp - 0x14], 0
call fcn.1006c557
mov ecx, dword [ebp - 0x14]
add esp, 0xc
test ecx, ecx
je 0x100419da
push ecx
push 1
push dword [ebp - 0x20]
push ebx
call fcn.1006cd6f
push dword [ebp - 0x14]
call fcn.1006cba1
add esp, 0x14
lea ecx, [ebp + 8]
call fcn.100456a0
test ebx, ebx
je 0x100419ef
push ebx
call fcn.10069769
add esp, 4
push dword [ebp - 0x28]
call fcn.1006a76f
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4