Function at 0x435170
Capabilities:
Write file on windows

Disassembly:
push ebx
push ebp
mov ebp, dword [0x514e48]
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 0x4351c0
mov eax, dword [0x514ddc]
mov ecx, dword [0x514e0c]
mov dword [0x514e38], eax
mov eax, dword [0x514e4c]
mov dword [0x514e68], edi
mov dword [0x514e6c], edi
mov dword [0x514e08], ecx
mov dword [0x514e40], ebp
mov dword [0x514e44], eax
mov eax, dword [0x514e58]
mov ecx, dword [0x514e5c]
mov ebx, eax
or ebx, ecx
jne 0x4351d7
mov eax, esi
xor ecx, ecx
jmp 0x4351df
sub eax, ebp
sbb ecx, dword [0x514e4c]
xor ebx, ebx
cmp ebx, ecx
jb 0x435206
ja 0x4351eb
cmp esi, eax
jbe 0x435206
mov ebx, dword [esp + 0x20]
cmp ebx, 3
je 0x435202
cmp ebx, 1
je 0x435202
cmp ebx, 2
je 0x435202
mov edx, eax
jmp 0x43520a
xor edx, edx
jmp 0x43520a
mov ebx, dword [esp + 0x20]
cmp ebx, 2
jne 0x435253
cmp dword [0x4d6dd8], 0xffffffff
jne 0x435234
mov ecx, dword [0x514e0c]
mov eax, dword [0x514e4c]
mov dword [0x4d6dd8], ecx
mov dword [0x514e10], ebp
mov dword [0x514e14], eax
mov eax, 1
add dword [0x514e18], eax
mov ecx, edi
adc dword [0x514e1c], ecx
add dword [0x514e20], eax
adc dword [0x514e24], ecx
test edx, edx
jbe 0x4352a1
mov ecx, dword [0x514ddc]
mov eax, dword [esp + 0x14]
push ecx
push edx
mov edx, dword [esp + 0x20]
push edx
push eax
call fcn.004b1c88
mov ebp, dword [0x514e48]
mov edi, eax
sub esi, edi
xor eax, eax
add esp, 0x10
add ebp, edi
adc dword [0x514e4c], eax
mov dword [esp + 0x18], esi
mov dword [0x514e48], ebp
test ebx, ebx
jne 0x4352a5
add dword [0x514e68], edi
adc dword [0x514e6c], eax
jmp 0x4352a5
mov dword [esp + 0x18], esi
test esi, esi
jbe 0x43556c
mov eax, dword [0x514e50]
test eax, eax
je 0x435553
add dword [0x514e60], ebp
mov ecx, dword [0x514e4c]
adc dword [0x514e64], ecx
cmp eax, 1
jne 0x4352eb
mov edx, dword [0x514ddc]
push edx
call fcn.004b1af2
add esp, 4
test eax, eax
je 0x4352eb
push 0xe
call fcn.004a59d0
cmp dword [0x514e50], 2
jne 0x435324
mov eax, dword [0x514ddc]
push eax
call fcn.004b1af2
add esp, 4
test eax, eax
je 0x435324
cmp dword [0x514e4c], 0
ja 0x435324
jb 0x43531d
cmp dword [0x514e48], 0x10000
jae 0x435324
push 0xe
call fcn.004a59d0
cmp dword [0x514e50], 1
jne 0x435349
mov ecx, dword [0x514e08]
cmp ecx, dword [0x514e0c]
jne 0x435349
mov edx, dword [0x514dd8]
mov dword [0x514e2c], edx
jmp 0x43539a
mov eax, dword [0x514e0c]
mov ecx, dword [0x514dec]
mov ebx, dword [0x514dd8]
mov esi, dword [0x514ddc]
push eax
push ecx
call fcn.00435020
push esi
mov ebp, eax
call fcn.004b203e
add esp, 4
push ebp
push ebx
call fcn.004a5c50
mov edx, dword [0x514dd8]
xor esi, esi
push edx
mov dword [0x514ddc], esi
call fcn.004aef60
mov dword [0x514dd8], esi
mov esi, dword [esp + 0x1c]
add esp, 4
mov ecx, dword [0x514dec]
xor eax, eax
mov dword [0x514e18], eax
mov dword [0x514e1c], eax
mov dword [0x514e48], eax
mov dword [0x514e4c], eax
mov eax, dword [0x514e0c]
push eax
push ecx
call fcn.00435020
push 0
mov ebx, eax
push ebx
push 0
mov ebp, 1
push ebp
call fcn.00409da0
push ebx
call fcn.004aef60
mov eax, dword [0x514e50]
add dword [0x514e0c], ebp
add esp, 4
cmp eax, 2
jne 0x435404
mov edx, dword [0x514e0c]
push edx
call fcn.004341a0
test eax, eax
jne 0x435404
push 9
call fcn.004a59d0
mov eax, dword [0x513954]
push eax
call fcn.00434110
mov dword [0x514dd8], eax
test eax, eax
jne 0x435424
push 4
call fcn.004a59d0
mov eax, dword [0x514dd8]
push 0x4c70f8
push eax
call fcn.004b2180
add esp, 8
mov dword [0x514ddc], eax
test eax, eax
jne 0x435459
mov ecx, dword [0x514dd8]
push ecx
push eax
mov ecx, 0x513904
call fcn.0042a0d0
push 0xa
call fcn.004a59d0
mov eax, dword [0x514ddc]
mov edx, dword [esp + 0x14]
push eax
push esi
lea eax, [edi + edx]
push ebp
push eax
call fcn.004b1c88
mov edx, dword [esp + 0x30]
xor ecx, ecx
add esp, 0x10
add edi, eax
add dword [0x514e48], eax
adc dword [0x514e4c], ecx
cmp edx, 3
je 0x43549a
cmp edx, ebp
je 0x43549a
cmp edx, 2
je 0x43549a
add dword [0x514e68], eax
adc dword [0x514e6c], ecx
cmp esi, eax
jbe 0x4354b7
mov eax, dword [0x514e50]
cmp eax, 2
je 0x4353ed
push 0xe
call fcn.004a59d0
mov edx, dword [esp + 0x20]
cmp edx, ebp
je 0x4354c9
cmp edx, 3
je 0x4354c9
cmp edx, 2
jne 0x43556c
cmp dword [0x514e50], ebp
jne 0x43551c
mov ebx, dword [0x514e38]
test ebx, ebx
je 0x43551c
mov eax, dword [0x514e08]
cmp eax, dword [0x514e0c]
je 0x43551c
mov ecx, dword [0x514dec]
mov esi, dword [0x514e2c]
push eax
push ecx
call fcn.00435020
push ebx
mov ebp, eax
call fcn.004b203e
add esp, 4
push ebp
push esi
call fcn.004a5c50
mov edx, dword [0x514e2c]
push edx
call fcn.004aef60
add esp, 4
mov eax, dword [0x514dd8]
mov ecx, dword [0x514ddc]
mov edx, dword [0x514e0c]
mov dword [0x514e2c], eax
xor eax, eax
mov dword [0x514e40], eax
mov dword [0x514e44], eax
mov eax, edi
pop edi
pop esi
pop ebp
mov dword [0x514e38], ecx
mov dword [0x514e08], edx
pop ebx
ret 0x10
mov eax, dword [0x514ddc]
push eax
call fcn.004b1af2
add esp, 4
test eax, eax
je 0x43556c
push 0xe
call fcn.004a59d0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
ret 0x10