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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x434a5a
mov eax, dword fs:[0]
push eax
sub esp, 0x60
mov eax, dword [0x4422c4]
xor eax, esp
mov dword [esp + 0x58], eax
push ebx
push esi
push edi
mov eax, dword [0x4422c4]
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 + 0x20], edi
jne 0x40a286
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.00419556
mov esp, ebp
pop ebp
ret 4
mov eax, dword [edi + 0x24]
mov ecx, dword [eax]
test ecx, ecx
je 0x40a2ac
mov eax, dword [edi + 0x34]
mov edx, dword [eax]
add edx, ecx
cmp ecx, edx
jae 0x40a2ac
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 0x40a266
mov eax, dword [edi + 0x4c]
test eax, eax
jne 0x40a2b7
mov eax, esi
jmp 0x40a266
cmp dword [edi + 0x3c], 0
jne 0x40a2d1
push eax
movsx eax, bl
push eax
call fcn.0041a128
pop ecx
cmp eax, esi
pop ecx
mov eax, ebx
jne 0x40a266
jmp 0x40a2b3
lea esi, [esp + 0x4c]
mov byte [esp + 0x13], bl
call fcn.0040a99d
and dword [esp + 0x78], 0
lea eax, [esp + 0x34]
mov ecx, esi
call fcn.0040aa19
mov esi, eax
call fcn.0040b23e
mov ebx, dword [esp + 0x60]
mov dword [esp + 0x14], eax
lea eax, [esp + 0x2c]
lea ecx, [esp + 0x4c]
call fcn.0040aa19
mov esi, eax
call fcn.0040b23e
mov ecx, dword [edi + 0x3c]
lea esi, [esp + 0x18]
push esi
mov esi, dword [esp + 0x18]
add ebx, esi
push ebx
mov dword [esp + 0x2c], eax
push dword [esp + 0x2c]
mov eax, dword [ecx]
lea esi, [esp + 0x28]
push esi
lea esi, [esp + 0x24]
push esi
lea edx, [edi + 0x44]
lea esi, [esp + 0x27]
push esi
push edx
mov dword [esp + 0x44], edx
call dword [eax + 0x14]
jmp 0x40a420
cmp eax, 1
jg 0x40a43d
lea eax, [esp + 0x3c]
lea ecx, [esp + 0x4c]
call fcn.0040aa19
mov esi, eax
call fcn.0040b23e
mov ebx, dword [esp + 0x18]
sub ebx, eax
je 0x40a399
lea eax, [esp + 0x44]
lea ecx, [esp + 0x4c]
call fcn.0040aa19
mov esi, eax
call fcn.0040b23e
push dword [edi + 0x4c]
push ebx
push 1
push eax
call fcn.0041a408
add esp, 0x10
cmp ebx, eax
jne 0x40a428
lea eax, [esp + 0x13]
cmp dword [esp + 0x1c], eax
mov byte [edi + 0x41], 1
jne 0x40a459
test ebx, ebx
ja 0x40a3c8
cmp dword [esp + 0x60], 0x20
jae 0x40a428
push 0
push 8
pop ebx
lea edi, [esp + 0x50]
call fcn.0040a9d5
mov edi, dword [esp + 0x20]
lea eax, [esp + 0x34]
lea ecx, [esp + 0x4c]
call fcn.0040aa19
mov esi, eax
call fcn.0040b23e
mov ebx, dword [esp + 0x60]
mov dword [esp + 0x14], eax
lea eax, [esp + 0x2c]
lea ecx, [esp + 0x4c]
call fcn.0040aa19
mov esi, eax
call fcn.0040b23e
mov ecx, dword [edi + 0x3c]
mov edx, dword [ecx]
lea esi, [esp + 0x18]
push esi
mov esi, dword [esp + 0x18]
add ebx, esi
push ebx
push eax
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x27]
push eax
push dword [esp + 0x40]
call dword [edx + 0x14]
test eax, eax
jge 0x40a349
or esi, 0xffffffff
push 0
push 1
lea ecx, [esp + 0x54]
call fcn.004021c6
jmp 0x40a2b3
cmp eax, 3
jne 0x40a428
movsx eax, byte [esp + 0x13]
push dword [edi + 0x4c]
push eax
call fcn.0041a128
or esi, 0xffffffff
cmp eax, esi
pop ecx
pop ecx
je 0x40a42b
mov esi, dword [ebp + 8]
jmp 0x40a42b