Function at 0x418640
Capabilities:
Write file on windows

Disassembly:
mov eax, 0x7fc4
call fcn.005865a0
mov eax, dword [0x65ada4]
xor eax, esp
mov dword [esp + 0x7fc0], eax
mov eax, dword [esp + 0x7fd4]
push ebx
mov ebx, dword [esp + 0x7fe0]
push ebp
mov ebp, dword [esp + 0x7fd4]
push esi
mov esi, dword [esp + 0x7fd4]
push edi
mov edi, dword [esp + 0x7fe0]
mov edx, dword [edi]
mov ecx, dword [edi + 4]
push edx
mov dword [esp + 0x20], eax
mov eax, dword [ebp + 4]
push eax
push esi
push str.GTBLOB_TA_d_BLSEG_ld_VAR_d__n
mov dword [esp + 0x3c], edi
mov dword [esp + 0x28], ecx
mov dword [esp + 0x24], 0
call fcn.00575440
mov ecx, dword [esp + 0x7ff8]
cmp byte [ebp + 0x12], 0
push ecx
lea edx, [esp + 0x38]
push edx
push esi
push ebp
setne byte [esp + 0x33]
call fcn.00415940
mov esi, eax
add esp, 0x20
test esi, esi
jne 0x41876f
cmp byte [esp + 0x13], al
jne 0x4186f6
mov ecx, dword [esp + 0x24]
push eax
mov eax, dword [esp + 0x7ff4]
push 2
push eax
push ecx
call fcn.00423b20
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x41876f
mov eax, dword [edi]
test eax, eax
jne 0x418709
mov edx, dword [edi + 8]
mov edi, dword [esp + 0x18]
mov dword [esp + 0x20], edx
jmp 0x418726
movsx edi, byte [esp + 0x13]
neg edi
sbb edi, edi
lea ecx, [esp + 0x30]
and edi, 0xffff905a
mov dword [esp + 0x20], ecx
add edi, 0x7fa0
cmp eax, 1
jne 0x41878d
mov edx, dword [esp + 0x1c]
push ebx
push edx
call dword [sym.imp.MSVCR90.dll_fopen]
mov esi, eax
add esp, 8
mov dword [esp + 0x14], esi
test esi, esi
jne 0x418791
mov eax, dword [esp + 0x1c]
push ebx
push eax
mov esi, 0x713
push 0x2ee2
push esi
call fcn.00406f10
add esp, 0x10
mov eax, dword [esp + 0x14]
test eax, eax
je 0x41876f
push eax
call dword [sym.imp.MSVCR90.dll_fclose]
add esp, 4
mov ecx, dword [esp + 0x7fd8]
push ecx
push 0x2ee2
push 0
call fcn.00406f10
add esp, 0xc
mov eax, esi
jmp 0x4188b2
mov esi, dword [esp + 0x14]
mov ebx, dword [esp + 0x18]
test ebx, ebx
je 0x41882e
lea ecx, [ecx]
cmp ebx, edi
jb 0x4187a8
sub ebx, edi
jmp 0x4187b6
mov dword [esp + 0x18], 0
mov edi, ebx
mov ebx, dword [esp + 0x18]
cmp byte [esp + 0x13], 0
mov ecx, dword [esp + 0x20]
je 0x4187e7
mov edx, dword [esp + 0x7ff0]
push ecx
push edi
push edx
push ebp
call fcn.0043c2e0
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x41875d
add dword [esp + 0x7ff0], edi
mov esi, dword [esp + 0x14]
jmp 0x418807
mov edx, dword [esp + 0x24]
lea eax, [esp + 0x28]
push eax
push edi
push ecx
push edx
call fcn.00423d00
add esp, 0x10
test eax, eax
mov eax, dword [esp + 0x28]
jne 0x418865
cmp eax, edi
jne 0x418865
mov eax, dword [esp + 0x2c]
cmp dword [eax], 1
jne 0x418826
push esi
push edi
lea ecx, [esp + 0x38]
push 1
push ecx
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
cmp eax, edi
jne 0x418848
test ebx, ebx
jne 0x4187a0
test esi, esi
je 0x418884
push esi
call dword [sym.imp.MSVCR90.dll_fclose]
add esp, 4
test eax, eax
je 0x418884
mov dword [esp + 0x14], 0
mov edx, dword [esp + 0x1c]
push edx
mov esi, 0x715
push 0x2ee2
push esi
call fcn.00406f10
add esp, 0xc
jmp 0x41875d
push eax
push edi
mov esi, 1
push esi
push 0x2ee2
push 0x735
call fcn.00406f10
add esp, 0x14
jmp 0x41875d
call fcn.004185c0
mov esi, eax
test esi, esi
jne 0x41876f
cmp byte [esp + 0x13], al
jne 0x4188b0
mov eax, dword [esp + 0x24]
push eax
call fcn.004240d0
mov esi, eax
add esp, 4
test esi, esi
jne 0x41876f
xor eax, eax
mov ecx, dword [esp + 0x7fd0]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00586584
add esp, 0x7fc4
ret