Function at 0x4387e0
Capabilities:
Write file on windows

Disassembly:
push ebx
push ebp
mov ebp, dword [0x509848]
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 0x438830
mov eax, dword [0x5097dc]
mov ecx, dword [0x50980c]
mov dword [0x509838], eax
mov eax, dword [0x50984c]
mov dword [0x509868], edi
mov dword [0x50986c], edi
mov dword [0x509808], ecx
mov dword [0x509840], ebp
mov dword [0x509844], eax
mov eax, dword [0x509858]
mov ecx, dword [0x50985c]
mov ebx, eax
or ebx, ecx
jne 0x438847
mov eax, esi
xor ecx, ecx
jmp 0x43884f
sub eax, ebp
sbb ecx, dword [0x50984c]
xor ebx, ebx
cmp ebx, ecx
jb 0x438876
ja 0x43885b
cmp esi, eax
jbe 0x438876
mov ebx, dword [esp + 0x20]
cmp ebx, 3
je 0x438872
cmp ebx, 1
je 0x438872
cmp ebx, 2
je 0x438872
mov edx, eax
jmp 0x43887a
xor edx, edx
jmp 0x43887a
mov ebx, dword [esp + 0x20]
cmp ebx, 2
jne 0x4388c3
cmp dword [0x4d8f50], 0xffffffff
jne 0x4388a4
mov ecx, dword [0x50980c]
mov eax, dword [0x50984c]
mov dword [0x4d8f50], ecx
mov dword [0x509810], ebp
mov dword [0x509814], eax
mov eax, 1
add dword [0x509818], eax
mov ecx, edi
adc dword [0x50981c], ecx
add dword [0x509820], eax
adc dword [0x509824], ecx
test edx, edx
jbe 0x438911
mov ecx, dword [0x5097dc]
mov eax, dword [esp + 0x14]
push ecx
push edx
mov edx, dword [esp + 0x20]
push edx
push eax
call fcn.004b39f8
mov ebp, dword [0x509848]
mov edi, eax
sub esi, edi
xor eax, eax
add esp, 0x10
add ebp, edi
adc dword [0x50984c], eax
mov dword [esp + 0x18], esi
mov dword [0x509848], ebp
test ebx, ebx
jne 0x438915
add dword [0x509868], edi
adc dword [0x50986c], eax
jmp 0x438915
mov dword [esp + 0x18], esi
test esi, esi
jbe 0x438bdc
mov eax, dword [0x509850]
test eax, eax
je 0x438bc3
add dword [0x509860], ebp
mov ecx, dword [0x50984c]
adc dword [0x509864], ecx
cmp eax, 1
jne 0x43895b
mov edx, dword [0x5097dc]
push edx
call fcn.004b3862
add esp, 4
test eax, eax
je 0x43895b
push 0xe
call fcn.004a78d0
cmp dword [0x509850], 2
jne 0x438994
mov eax, dword [0x5097dc]
push eax
call fcn.004b3862
add esp, 4
test eax, eax
je 0x438994
cmp dword [0x50984c], 0
ja 0x438994
jb 0x43898d
cmp dword [0x509848], 0x10000
jae 0x438994
push 0xe
call fcn.004a78d0
cmp dword [0x509850], 1
jne 0x4389b9
mov ecx, dword [0x509808]
cmp ecx, dword [0x50980c]
jne 0x4389b9
mov edx, dword [0x5097d8]
mov dword [0x50982c], edx
jmp 0x438a0a
mov eax, dword [0x50980c]
mov ecx, dword [0x5097ec]
mov ebx, dword [0x5097d8]
mov esi, dword [0x5097dc]
push eax
push ecx
call fcn.00438690
push esi
mov ebp, eax
call fcn.004b3dae
add esp, 4
push ebp
push ebx
call fcn.004a7b50
mov edx, dword [0x5097d8]
xor esi, esi
push edx
mov dword [0x5097dc], esi
call fcn.004b1201
mov dword [0x5097d8], esi
mov esi, dword [esp + 0x1c]
add esp, 4
mov ecx, dword [0x5097ec]
xor eax, eax
mov dword [0x509818], eax
mov dword [0x50981c], eax
mov dword [0x509848], eax
mov dword [0x50984c], eax
mov eax, dword [0x50980c]
push eax
push ecx
call fcn.00438690
push 0
mov ebx, eax
push ebx
push 0
mov ebp, 1
push ebp
call fcn.00409f00
push ebx
call fcn.004b1201
mov eax, dword [0x509850]
add dword [0x50980c], ebp
add esp, 4
cmp eax, 2
jne 0x438a74
mov edx, dword [0x50980c]
push edx
call fcn.00437810
test eax, eax
jne 0x438a74
push 9
call fcn.004a78d0
mov eax, dword [0x508354]
push eax
call fcn.00437780
mov dword [0x5097d8], eax
test eax, eax
jne 0x438a94
push 4
call fcn.004a78d0
mov eax, dword [0x5097d8]
push 0x4c9108
push eax
call fcn.004b3ef0
add esp, 8
mov dword [0x5097dc], eax
test eax, eax
jne 0x438ac9
mov ecx, dword [0x5097d8]
push ecx
push eax
mov ecx, 0x508304
call fcn.0042d4e0
push 0xa
call fcn.004a78d0
mov eax, dword [0x5097dc]
mov edx, dword [esp + 0x14]
push eax
push esi
lea eax, [edi + edx]
push ebp
push eax
call fcn.004b39f8
mov edx, dword [esp + 0x30]
xor ecx, ecx
add esp, 0x10
add edi, eax
add dword [0x509848], eax
adc dword [0x50984c], ecx
cmp edx, 3
je 0x438b0a
cmp edx, ebp
je 0x438b0a
cmp edx, 2
je 0x438b0a
add dword [0x509868], eax
adc dword [0x50986c], ecx
cmp esi, eax
jbe 0x438b27
mov eax, dword [0x509850]
cmp eax, 2
je 0x438a5d
push 0xe
call fcn.004a78d0
mov edx, dword [esp + 0x20]
cmp edx, ebp
je 0x438b39
cmp edx, 3
je 0x438b39
cmp edx, 2
jne 0x438bdc
cmp dword [0x509850], ebp
jne 0x438b8c
mov ebx, dword [0x509838]
test ebx, ebx
je 0x438b8c
mov eax, dword [0x509808]
cmp eax, dword [0x50980c]
je 0x438b8c
mov ecx, dword [0x5097ec]
mov esi, dword [0x50982c]
push eax
push ecx
call fcn.00438690
push ebx
mov ebp, eax
call fcn.004b3dae
add esp, 4
push ebp
push esi
call fcn.004a7b50
mov edx, dword [0x50982c]
push edx
call fcn.004b1201
add esp, 4
mov eax, dword [0x5097d8]
mov ecx, dword [0x5097dc]
mov edx, dword [0x50980c]
mov dword [0x50982c], eax
xor eax, eax
mov dword [0x509840], eax
mov dword [0x509844], eax
mov eax, edi
pop edi
pop esi
pop ebp
mov dword [0x509838], ecx
mov dword [0x509808], edx
pop ebx
ret 0x10
mov eax, dword [0x5097dc]
push eax
call fcn.004b3862
add esp, 4
test eax, eax
je 0x438bdc
push 0xe
call fcn.004a78d0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
ret 0x10