Function at 0x100650d
Capabilities:
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x1035a78
mov eax, dword fs:[0]
push eax
sub esp, 0x60
mov eax, dword [0x10482e0]
xor eax, esp
mov dword [esp + 0x58], eax
push ebx
push esi
push edi
mov eax, dword [0x10482e0]
xor eax, esp
push eax
lea eax, [esp + 0x70]
mov dword fs:[0], eax
mov ebx, dword [ebp + 8]
or esi, 0xffffffff
cmp ebx, esi
mov eax, ecx
mov dword [esp + 0x1c], eax
jne 0x1006576
xor eax, eax
mov ecx, dword [esp + 0x70]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x58]
xor ecx, esp
call fcn.0101aef9
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [eax + 0x24]
mov edx, dword [ecx]
test edx, edx
je 0x100659c
mov ecx, dword [eax + 0x34]
mov edi, dword [ecx]
add edi, edx
cmp edx, edi
jae 0x100659c
dec dword [ecx]
mov eax, dword [eax + 0x24]
mov ecx, dword [eax]
lea edx, [ecx + 1]
mov dword [eax], edx
mov byte [ecx], bl
mov eax, ebx
jmp 0x1006556
mov ecx, dword [eax + 0x4c]
test ecx, ecx
jne 0x10065a7
mov eax, esi
jmp 0x1006556
cmp dword [eax + 0x3c], 0
jne 0x10065c1
movsx eax, bl
push ecx
push eax
call fcn.0101ba30
pop ecx
cmp eax, esi
pop ecx
mov eax, ebx
jne 0x1006556
jmp 0x10065a3
push 0
push 8
pop edi
lea esi, [esp + 0x50]
mov byte [esp + 0x1b], bl
call fcn.01006e06
and dword [esp + 0x78], 0
mov edi, dword [esp + 0x60]
lea ebx, [esp + 0x2c]
call fcn.01006e8d
mov esi, eax
call fcn.01007637
add eax, edi
lea ebx, [esp + 0x34]
lea esi, [esp + 0x4c]
mov dword [esp + 0x18], eax
call fcn.01006e8d
mov esi, eax
call fcn.01007637
mov edi, dword [esp + 0x1c]
mov ecx, dword [edi + 0x3c]
mov esi, dword [ecx]
lea ebx, [esp + 0x20]
push ebx
push dword [esp + 0x1c]
lea edx, [edi + 0x44]
push eax
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x2b]
push eax
push edx
mov dword [esp + 0x44], edx
call dword [esi + 0x14]
jmp 0x100671e
cmp eax, 1
jg 0x100673b
lea ebx, [esp + 0x3c]
lea esi, [esp + 0x4c]
call fcn.01006e8d
mov esi, eax
call fcn.01007637
mov ecx, dword [esp + 0x20]
sub ecx, eax
mov dword [esp + 0x18], ecx
je 0x1006692
push dword [edi + 0x4c]
lea ebx, [esp + 0x48]
push ecx
push 1
lea esi, [esp + 0x58]
call fcn.01006e8d
mov esi, eax
call fcn.01007637
push eax
call fcn.0101bf7b
add esp, 0x10
cmp dword [esp + 0x18], eax
jne 0x1006726
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x17]
cmp dword [esp + 0x24], eax
mov byte [edi + 0x41], 1
jne 0x1006757
test ecx, ecx
ja 0x10066c1
cmp dword [esp + 0x60], 0x20
jae 0x1006726
push 0
push 8
pop ebx
lea edi, [esp + 0x50]
call fcn.01006e49
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x60]
lea ebx, [esp + 0x2c]
lea esi, [esp + 0x4c]
mov dword [esp + 0x18], eax
call fcn.01006e8d
mov esi, eax
call fcn.01007637
add eax, dword [esp + 0x18]
lea ebx, [esp + 0x34]
lea esi, [esp + 0x4c]
mov dword [esp + 0x18], eax
call fcn.01006e8d
mov esi, eax
call fcn.01007637
mov ecx, dword [edi + 0x3c]
mov edx, dword [ecx]
lea esi, [esp + 0x20]
push esi
push dword [esp + 0x1c]
push eax
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x2b]
push eax
push dword [esp + 0x40]
call dword [edx + 0x14]
test eax, eax
jge 0x1006638
or esi, 0xffffffff
push 0
push 1
lea ecx, [esp + 0x54]
call fcn.01002db0
jmp 0x10065a3
cmp eax, 3
jne 0x1006726
movsx eax, byte [esp + 0x17]
push dword [edi + 0x4c]
push eax
call fcn.0101ba30
or esi, 0xffffffff
cmp eax, esi
pop ecx
pop ecx
je 0x1006729
mov esi, dword [ebp + 8]
jmp 0x1006729