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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x45959a
mov eax, dword fs:[0]
push eax
sub esp, 0x60
mov eax, dword [0x477fc0]
xor eax, esp
mov dword [esp + 0x58], eax
push ebx
push esi
push edi
mov eax, dword [0x477fc0]
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 edi, ecx
mov dword [esp + 0x28], edi
jne 0x410469
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.004390c2
mov esp, ebp
pop ebp
ret 4
mov eax, dword [edi + 0x24]
mov ecx, dword [eax]
test ecx, ecx
je 0x41048f
mov eax, dword [edi + 0x34]
mov edx, dword [eax]
add edx, ecx
cmp ecx, edx
jae 0x41048f
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 0x410449
mov eax, dword [edi + 0x4c]
test eax, eax
jne 0x41049a
mov eax, esi
jmp 0x410449
cmp dword [edi + 0x3c], 0
jne 0x4104b4
push eax
movsx eax, bl
push eax
call fcn.0043be2f
pop ecx
cmp eax, esi
pop ecx
mov eax, ebx
jne 0x410449
jmp 0x410496
lea esi, [esp + 0x4c]
mov byte [esp + 0x17], bl
call fcn.00410b33
and dword [esp + 0x78], 0
mov eax, dword [esp + 0x60]
lea ebx, [esp + 0x34]
mov dword [esp + 0x18], eax
call fcn.00410bb2
mov esi, eax
call fcn.00410c23
add eax, dword [esp + 0x18]
lea ebx, [esp + 0x2c]
lea esi, [esp + 0x4c]
mov dword [esp + 0x18], eax
call fcn.00410bb2
mov esi, eax
call fcn.00410c23
mov ecx, dword [edi + 0x3c]
mov esi, dword [ecx]
lea ebx, [esp + 0x1c]
push ebx
push dword [esp + 0x1c]
lea edx, [edi + 0x44]
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x2b]
push eax
push edx
mov dword [esp + 0x40], edx
call dword [esi + 0x14]
jmp 0x41060e
cmp eax, 1
jg 0x410630
lea ebx, [esp + 0x3c]
lea esi, [esp + 0x4c]
call fcn.00410bb2
mov esi, eax
call fcn.00410c23
mov ecx, dword [esp + 0x1c]
sub ecx, eax
mov dword [esp + 0x18], ecx
je 0x410582
push dword [edi + 0x4c]
lea ebx, [esp + 0x48]
push ecx
push 1
lea esi, [esp + 0x58]
call fcn.00410bb2
mov esi, eax
call fcn.00410c23
push eax
call fcn.0043c1bb
add esp, 0x10
cmp dword [esp + 0x18], eax
jne 0x410616
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x17]
cmp dword [esp + 0x20], eax
mov byte [edi + 0x41], 1
jne 0x41064c
test ecx, ecx
ja 0x4105b1
cmp dword [esp + 0x60], 0x20
jae 0x410616
push 0
push 8
pop ebx
lea edi, [esp + 0x50]
call fcn.00410b6b
mov edi, dword [esp + 0x28]
mov eax, dword [esp + 0x60]
lea ebx, [esp + 0x34]
lea esi, [esp + 0x4c]
mov dword [esp + 0x18], eax
call fcn.00410bb2
mov esi, eax
call fcn.00410c23
add eax, dword [esp + 0x18]
lea ebx, [esp + 0x2c]
lea esi, [esp + 0x4c]
mov dword [esp + 0x18], eax
call fcn.00410bb2
mov esi, eax
call fcn.00410c23
mov ecx, dword [edi + 0x3c]
mov edx, dword [ecx]
lea esi, [esp + 0x1c]
push esi
push dword [esp + 0x1c]
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x2b]
push eax
push dword [esp + 0x3c]
call dword [edx + 0x14]
test eax, eax
jge 0x410528
or esi, 0xffffffff
or dword [esp + 0x78], 0xffffffff
push 0
push 1
lea ecx, [esp + 0x54]
call fcn.00412467
jmp 0x410496
cmp eax, 3
jne 0x410616
movsx eax, byte [esp + 0x17]
push dword [edi + 0x4c]
push eax
call fcn.0043be2f
or esi, 0xffffffff
cmp eax, esi
pop ecx
pop ecx
je 0x410619
mov esi, dword [ebp + 8]
jmp 0x410619