Function at 0x438350
Capabilities:
Write file on windows

Disassembly:
push ebx
push ebp
mov ebp, dword [0x508838]
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 0x4383a0
mov eax, dword [0x5087cc]
mov ecx, dword [0x5087fc]
mov dword [0x508828], eax
mov eax, dword [0x50883c]
mov dword [0x508858], edi
mov dword [0x50885c], edi
mov dword [0x5087f8], ecx
mov dword [0x508830], ebp
mov dword [0x508834], eax
mov eax, dword [0x508848]
mov ecx, dword [0x50884c]
mov ebx, eax
or ebx, ecx
jne 0x4383b7
mov eax, esi
xor ecx, ecx
jmp 0x4383bf
sub eax, ebp
sbb ecx, dword [0x50883c]
xor ebx, ebx
cmp ebx, ecx
jb 0x4383e6
ja 0x4383cb
cmp esi, eax
jbe 0x4383e6
mov ebx, dword [esp + 0x20]
cmp ebx, 3
je 0x4383e2
cmp ebx, 1
je 0x4383e2
cmp ebx, 2
je 0x4383e2
mov edx, eax
jmp 0x4383ea
xor edx, edx
jmp 0x4383ea
mov ebx, dword [esp + 0x20]
cmp ebx, 2
jne 0x438433
cmp dword [0x4d7f50], 0xffffffff
jne 0x438414
mov ecx, dword [0x5087fc]
mov eax, dword [0x50883c]
mov dword [0x4d7f50], ecx
mov dword [0x508800], ebp
mov dword [0x508804], eax
mov eax, 1
add dword [0x508808], eax
mov ecx, edi
adc dword [0x50880c], ecx
add dword [0x508810], eax
adc dword [0x508814], ecx
test edx, edx
jbe 0x438481
mov ecx, dword [0x5087cc]
mov eax, dword [esp + 0x14]
push ecx
push edx
mov edx, dword [esp + 0x20]
push edx
push eax
call fcn.004b29b8
mov ebp, dword [0x508838]
mov edi, eax
sub esi, edi
xor eax, eax
add esp, 0x10
add ebp, edi
adc dword [0x50883c], eax
mov dword [esp + 0x18], esi
mov dword [0x508838], ebp
test ebx, ebx
jne 0x438485
add dword [0x508858], edi
adc dword [0x50885c], eax
jmp 0x438485
mov dword [esp + 0x18], esi
test esi, esi
jbe 0x43874c
mov eax, dword [0x508840]
test eax, eax
je 0x438733
add dword [0x508850], ebp
mov ecx, dword [0x50883c]
adc dword [0x508854], ecx
cmp eax, 1
jne 0x4384cb
mov edx, dword [0x5087cc]
push edx
call fcn.004b2822
add esp, 4
test eax, eax
je 0x4384cb
push 0xe
call fcn.004a68d0
cmp dword [0x508840], 2
jne 0x438504
mov eax, dword [0x5087cc]
push eax
call fcn.004b2822
add esp, 4
test eax, eax
je 0x438504
cmp dword [0x50883c], 0
ja 0x438504
jb 0x4384fd
cmp dword [0x508838], 0x10000
jae 0x438504
push 0xe
call fcn.004a68d0
cmp dword [0x508840], 1
jne 0x438529
mov ecx, dword [0x5087f8]
cmp ecx, dword [0x5087fc]
jne 0x438529
mov edx, dword [0x5087c8]
mov dword [0x50881c], edx
jmp 0x43857a
mov eax, dword [0x5087fc]
mov ecx, dword [0x5087dc]
mov ebx, dword [0x5087c8]
mov esi, dword [0x5087cc]
push eax
push ecx
call fcn.00438200
push esi
mov ebp, eax
call fcn.004b2d6e
add esp, 4
push ebp
push ebx
call fcn.004a6b50
mov edx, dword [0x5087c8]
xor esi, esi
push edx
mov dword [0x5087cc], esi
call fcn.004b01c1
mov dword [0x5087c8], esi
mov esi, dword [esp + 0x1c]
add esp, 4
mov ecx, dword [0x5087dc]
xor eax, eax
mov dword [0x508808], eax
mov dword [0x50880c], eax
mov dword [0x508838], eax
mov dword [0x50883c], eax
mov eax, dword [0x5087fc]
push eax
push ecx
call fcn.00438200
push 0
mov ebx, eax
push ebx
push 0
mov ebp, 1
push ebp
call fcn.0040a020
push ebx
call fcn.004b01c1
mov eax, dword [0x508840]
add dword [0x5087fc], ebp
add esp, 4
cmp eax, 2
jne 0x4385e4
mov edx, dword [0x5087fc]
push edx
call fcn.00437380
test eax, eax
jne 0x4385e4
push 9
call fcn.004a68d0
mov eax, dword [0x507344]
push eax
call fcn.004372f0
mov dword [0x5087c8], eax
test eax, eax
jne 0x438604
push 4
call fcn.004a68d0
mov eax, dword [0x5087c8]
push 0x4c8108
push eax
call fcn.004b2eb0
add esp, 8
mov dword [0x5087cc], eax
test eax, eax
jne 0x438639
mov ecx, dword [0x5087c8]
push ecx
push eax
mov ecx, 0x5072f4
call fcn.0042d2a0
push 0xa
call fcn.004a68d0
mov eax, dword [0x5087cc]
mov edx, dword [esp + 0x14]
push eax
push esi
lea eax, [edi + edx]
push ebp
push eax
call fcn.004b29b8
mov edx, dword [esp + 0x30]
xor ecx, ecx
add esp, 0x10
add edi, eax
add dword [0x508838], eax
adc dword [0x50883c], ecx
cmp edx, 3
je 0x43867a
cmp edx, ebp
je 0x43867a
cmp edx, 2
je 0x43867a
add dword [0x508858], eax
adc dword [0x50885c], ecx
cmp esi, eax
jbe 0x438697
mov eax, dword [0x508840]
cmp eax, 2
je 0x4385cd
push 0xe
call fcn.004a68d0
mov edx, dword [esp + 0x20]
cmp edx, ebp
je 0x4386a9
cmp edx, 3
je 0x4386a9
cmp edx, 2
jne 0x43874c
cmp dword [0x508840], ebp
jne 0x4386fc
mov ebx, dword [0x508828]
test ebx, ebx
je 0x4386fc
mov eax, dword [0x5087f8]
cmp eax, dword [0x5087fc]
je 0x4386fc
mov ecx, dword [0x5087dc]
mov esi, dword [0x50881c]
push eax
push ecx
call fcn.00438200
push ebx
mov ebp, eax
call fcn.004b2d6e
add esp, 4
push ebp
push esi
call fcn.004a6b50
mov edx, dword [0x50881c]
push edx
call fcn.004b01c1
add esp, 4
mov eax, dword [0x5087c8]
mov ecx, dword [0x5087cc]
mov edx, dword [0x5087fc]
mov dword [0x50881c], eax
xor eax, eax
mov dword [0x508830], eax
mov dword [0x508834], eax
mov eax, edi
pop edi
pop esi
pop ebp
mov dword [0x508828], ecx
mov dword [0x5087f8], edx
pop ebx
ret 0x10
mov eax, dword [0x5087cc]
push eax
call fcn.004b2822
add esp, 4
test eax, eax
je 0x43874c
push 0xe
call fcn.004a68d0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
ret 0x10