Function at 0x413520
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x68
xor eax, eax
push ebx
mov ebx, dword [ebp + 8]
cmp ebx, eax
push esi
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], eax
push edi
mov dword [ebp - 0x14], eax
je 0x413540
cmp dword [ebp + 0xc], eax
jne 0x41355e
push ebx
call fcn.00412e30
push eax
push str.vlDufsBFopen
mov eax, 0x51f
mov esi, 1
call fcn.00412ed0
add esp, 0xc
mov eax, dword [ebp + 0xc]
push 0x47a048
push eax
call fcn.0040c1d0
mov esi, eax
push esi
push ebx
call fcn.0040af70
add esp, 0x10
mov edi, eax
push esi
mov dword [ebp - 0x10], edi
call fcn.0040c170
test edi, edi
jne 0x413593
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0xc]
mov esi, dword [0x4780d4]
push 0x72
push ecx
call esi
add esp, 0xc
test eax, eax
push edi
je 0x41367a
call dword [0x4780d0]
push edi
push 2
lea edx, [ebp - 4]
push 1
push edx
call fcn.0040b040
add esp, 0x14
cmp eax, 2
je 0x4135e9
mov esi, dword [0x4780c0]
call esi
mov ebx, dword [eax]
push edi
call fcn.0040b000
add esp, 4
call esi
mov dword [eax], ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
movsx eax, byte [ebp - 4]
movsx ecx, byte [ebp - 3]
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 0xc]
and edx, 0xff
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 8]
and eax, 0xff
mov dword [ebp - 8], eax
mov eax, dword [0x49a5fc]
xor edi, edi
mov dword [ebp - 0x1c], eax
mov eax, dword [0x4a53ec]
lea edx, [ebp - 0x64]
lea ecx, [ebp - 0x68]
push edi
push edx
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x68], 0xffffffff
mov dword [ebp - 0x24], eax
mov dword [0x4a53ec], ecx
call fcn.0041c030
add esp, 8
test eax, eax
jne 0x4136dc
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 0x10]
push eax
push ecx
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
push edx
call fcn.00412f40
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x20]
mov dword [0x4a53ec], eax
mov eax, dword [ebp - 0x14]
add esp, 0xc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0xc], 1
push 2
mov dword [ebp - 8], 0x84
mov cl, byte [ebp - 0xc]
mov dl, byte [ebp - 8]
lea eax, [ebp - 4]
push 1
push eax
mov byte [ebp - 4], cl
mov byte [ebp - 3], dl
call dword [0x4780f4]
add esp, 0x10
cmp eax, 2
je 0x41360e
mov esi, dword [0x4780c0]
call esi
mov ecx, dword [eax]
push edi
mov dword [ebp - 0x14], ecx
call fcn.0040b000
push 3
push ebx
call fcn.0040e9b0
add esp, 0xc
call esi
mov edx, dword [ebp - 0x14]
mov dword [eax], edx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x10]
push eax
mov dword [ebp - 0x18], 1
call fcn.0040b000
mov ecx, dword [ebp + 0xc]
push 0x77
push ecx
call esi
add esp, 0xc
test eax, eax
je 0x413709
mov edx, dword [ebp + 8]
push 3
push edx
call fcn.0040e9b0
add esp, 8
mov eax, dword [0x49a5fc]
mov ecx, dword [0x49a600]
push eax
push ecx
call fcn.00412570
mov eax, dword [0x49a5fc]
add esp, 8
cmp eax, edi
je 0x413738
mov edx, dword [ebp - 0x1c]
push edx
push 0x49a5fc
call fcn.004128a0
add esp, 8
mov eax, dword [ebp - 0x20]
mov dword [0x49a600], edi
pop edi
pop esi
mov dword [0x4a53ec], eax
mov eax, dword [ebp - 0x14]
pop ebx
mov esp, ebp
pop ebp
ret