Function at 0x43f040
Capabilities:
Write file on windows

Disassembly:
push ebx
push ebp
mov ebp, dword [0x520458]
push esi
mov esi, dword [esp + 0x14]
imul esi, dword [esp + 0x18]
push edi
xor edi, edi
cmp dword [esp + 0x20], 1
mov edx, esi
jne 0x43f090
mov eax, dword [0x5203ec]
mov ecx, dword [0x52041c]
mov dword [0x520448], eax
mov eax, dword [0x52045c]
mov dword [0x520478], edi
mov dword [0x52047c], edi
mov dword [0x520418], ecx
mov dword [0x520450], ebp
mov dword [0x520454], eax
mov eax, dword [0x520468]
mov ecx, dword [0x52046c]
mov ebx, eax
or ebx, ecx
jne 0x43f0a7
mov eax, esi
xor ecx, ecx
jmp 0x43f0af
sub eax, ebp
sbb ecx, dword [0x52045c]
xor ebx, ebx
cmp ebx, ecx
jb 0x43f0d6
ja 0x43f0bb
cmp esi, eax
jbe 0x43f0d6
mov ebx, dword [esp + 0x20]
cmp ebx, 3
je 0x43f0d2
cmp ebx, 1
je 0x43f0d2
cmp ebx, 2
je 0x43f0d2
mov edx, eax
jmp 0x43f0da
xor edx, edx
jmp 0x43f0da
mov ebx, dword [esp + 0x20]
cmp ebx, 2
jne 0x43f123
cmp dword [0x4e9618], 0xffffffff
jne 0x43f104
mov ecx, dword [0x52041c]
mov eax, dword [0x52045c]
mov dword [0x4e9618], ecx
mov dword [0x520420], ebp
mov dword [0x520424], eax
mov eax, 1
add dword [0x520428], eax
mov ecx, edi
adc dword [0x52042c], ecx
add dword [0x520430], eax
adc dword [0x520434], ecx
test edx, edx
jbe 0x43f171
mov ecx, dword [0x5203ec]
mov eax, dword [esp + 0x14]
push ecx
push edx
mov edx, dword [esp + 0x20]
push edx
push eax
call fcn.004c3ee0
mov ebp, dword [0x520458]
mov edi, eax
sub esi, edi
xor eax, eax
add esp, 0x10
add ebp, edi
adc dword [0x52045c], eax
mov dword [esp + 0x18], esi
mov dword [0x520458], ebp
test ebx, ebx
jne 0x43f175
add dword [0x520478], edi
adc dword [0x52047c], eax
jmp 0x43f175
mov dword [esp + 0x18], esi
test esi, esi
jbe 0x43f43a
mov eax, dword [0x520460]
test eax, eax
je 0x43f421
add dword [0x520470], ebp
mov ecx, dword [0x52045c]
adc dword [0x520474], ecx
cmp eax, 1
jne 0x43f1bb
mov edx, dword [0x5203ec]
push edx
call fcn.004c4691
add esp, 4
test eax, eax
je 0x43f1bb
push 0xe
call fcn.004b8280
cmp dword [0x520460], 2
jne 0x43f1f4
mov eax, dword [0x5203ec]
push eax
call fcn.004c4691
add esp, 4
test eax, eax
je 0x43f1f4
cmp dword [0x52045c], 0
ja 0x43f1f4
jb 0x43f1ed
cmp dword [0x520458], 0x10000
jae 0x43f1f4
push 0xe
call fcn.004b8280
cmp dword [0x520460], 1
jne 0x43f219
mov ecx, dword [0x520418]
cmp ecx, dword [0x52041c]
jne 0x43f219
mov edx, dword [0x5203e8]
mov dword [0x52043c], edx
jmp 0x43f26a
mov eax, dword [0x52041c]
mov ecx, dword [0x5203fc]
mov ebx, dword [0x5203e8]
mov esi, dword [0x5203ec]
push eax
push ecx
call fcn.0043eef0
push esi
mov ebp, eax
call fcn.004c3d02
add esp, 4
push ebp
push ebx
call fcn.004b8500
mov edx, dword [0x5203e8]
xor esi, esi
push edx
mov dword [0x5203ec], esi
call fcn.004c1aa4
mov dword [0x5203e8], esi
mov esi, dword [esp + 0x1c]
add esp, 4
mov ecx, dword [0x5203fc]
xor eax, eax
mov dword [0x520428], eax
mov dword [0x52042c], eax
mov dword [0x520458], eax
mov dword [0x52045c], eax
mov eax, dword [0x52041c]
push eax
push ecx
call fcn.0043eef0
push 0
mov ebx, eax
push ebx
mov ebp, 1
push ebp
call fcn.0040a520
push ebx
call fcn.004c1aa4
mov eax, dword [0x520460]
add dword [0x52041c], ebp
add esp, 4
cmp eax, 2
jne 0x43f2d2
mov edx, dword [0x52041c]
push edx
call fcn.0043e0a0
test eax, eax
jne 0x43f2d2
push 9
call fcn.004b8280
mov eax, dword [0x51ef64]
push eax
call fcn.0043e020
mov dword [0x5203e8], eax
test eax, eax
jne 0x43f2f2
push 4
call fcn.004b8280
mov eax, dword [0x5203e8]
push 0x4d9468
push eax
call fcn.004c4548
add esp, 8
mov dword [0x5203ec], eax
test eax, eax
jne 0x43f327
mov ecx, dword [0x5203e8]
push ecx
push eax
mov ecx, 0x51ef08
call fcn.00433e50
push 0xa
call fcn.004b8280
mov eax, dword [0x5203ec]
mov edx, dword [esp + 0x14]
push eax
push esi
lea eax, [edi + edx]
push ebp
push eax
call fcn.004c3ee0
mov edx, dword [esp + 0x30]
xor ecx, ecx
add esp, 0x10
add edi, eax
add dword [0x520458], eax
adc dword [0x52045c], ecx
cmp edx, 3
je 0x43f368
cmp edx, ebp
je 0x43f368
cmp edx, 2
je 0x43f368
add dword [0x520478], eax
adc dword [0x52047c], ecx
cmp esi, eax
jbe 0x43f385
mov eax, dword [0x520460]
cmp eax, 2
je 0x43f2bb
push 0xe
call fcn.004b8280
mov edx, dword [esp + 0x20]
cmp edx, ebp
je 0x43f397
cmp edx, 3
je 0x43f397
cmp edx, 2
jne 0x43f43a
cmp dword [0x520460], ebp
jne 0x43f3ea
mov ebx, dword [0x520448]
test ebx, ebx
je 0x43f3ea
mov eax, dword [0x520418]
cmp eax, dword [0x52041c]
je 0x43f3ea
mov ecx, dword [0x5203fc]
mov esi, dword [0x52043c]
push eax
push ecx
call fcn.0043eef0
push ebx
mov ebp, eax
call fcn.004c3d02
add esp, 4
push ebp
push esi
call fcn.004b8500
mov edx, dword [0x52043c]
push edx
call fcn.004c1aa4
add esp, 4
mov eax, dword [0x5203e8]
mov ecx, dword [0x5203ec]
mov edx, dword [0x52041c]
mov dword [0x52043c], eax
xor eax, eax
mov dword [0x520450], eax
mov dword [0x520454], eax
mov eax, edi
pop edi
pop esi
pop ebp
mov dword [0x520448], ecx
mov dword [0x520418], edx
pop ebx
ret 0x10
mov eax, dword [0x5203ec]
push eax
call fcn.004c4691
add esp, 4
test eax, eax
je 0x43f43a
push 0xe
call fcn.004b8280
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
ret 0x10