Function at 0x586690
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x154
mov eax, dword [0x6af320]
xor eax, ebp
mov dword [ebp - 4], eax
mov byte [ebp - 0x125], 1
push 0x6346b0
lea ecx, [ebp + 8]
call fcn.0056e5f0
push eax
call dword [sym.imp.MSVCR120.dll__wfopen]
add esp, 8
mov dword [ebp - 0x130], eax
cmp dword [ebp - 0x130], 0
jne 0x58670c
cmp dword [ebp + 0x10], 0
je 0x586705
lea eax, [ebp - 0x124]
push eax
call fcn.005879d0
add esp, 4
mov dword [ebp - 0x144], eax
mov ecx, dword [ebp - 0x144]
push ecx
mov ecx, dword [ebp + 0x10]
call fcn.00430160
lea ecx, [ebp - 0x124]
call fcn.00413150
xor al, al
jmp 0x5868e5
cmp dword [ebp + 0x14], 0
je 0x58671f
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
mov dword [ebp - 0x13c], eax
jmp 0x586729
mov dword [ebp - 0x13c], 0
mov ecx, dword [ebp - 0x13c]
mov dword [ebp - 0x154], ecx
xor edx, edx
mov word [ebp - 0x2c], dx
xor eax, eax
mov dword [ebp - 0x2a], eax
mov dword [ebp - 0x26], eax
mov dword [ebp - 0x22], eax
mov dword [ebp - 0x1e], eax
mov dword [ebp - 0x1a], eax
mov dword [ebp - 0x16], eax
mov dword [ebp - 0x12], eax
mov dword [ebp - 0xe], eax
mov dword [ebp - 0xa], eax
mov word [ebp - 6], ax
mov ecx, dword [ebp + 0xc]
call fcn.00413000
mov dword [ebp - 0x140], eax
mov dword [ebp - 0x12c], 0
cmp dword [ebp - 0x140], 0
je 0x586842
push 0
mov ecx, dword [ebp + 0xc]
call fcn.00413810
push eax
push 0
call fcn.00586f50
add esp, 0xc
mov dword [ebp - 0x12c], eax
mov ecx, dword [ebp - 0x12c]
add ecx, 1
push ecx
call fcn.005a5d06
add esp, 4
mov dword [ebp - 0x150], eax
mov edx, dword [ebp - 0x150]
mov dword [ebp - 0x134], edx
mov eax, dword [ebp - 0x12c]
push eax
mov ecx, dword [ebp + 0xc]
call fcn.00413810
push eax
mov ecx, dword [ebp - 0x134]
push ecx
call fcn.00586f50
add esp, 0xc
mov edx, dword [ebp - 0x130]
push edx
push 1
mov eax, dword [ebp - 0x12c]
push eax
mov ecx, dword [ebp - 0x134]
push ecx
call dword [sym.imp.MSVCR120.dll_fwrite]
add esp, 0x10
cmp eax, 1
jne 0x586810
mov dword [ebp - 0x138], 1
jmp 0x58681a
mov dword [ebp - 0x138], 0
mov dl, byte [ebp - 0x138]
mov byte [ebp - 0x125], dl
mov eax, dword [ebp - 0x134]
mov dword [ebp - 0x148], eax
mov ecx, dword [ebp - 0x148]
push ecx
call dword [sym.imp.MSVCR120.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov edx, dword [ebp - 0x12c]
push edx
lea eax, [ebp - 0x2c]
push eax
mov ecx, dword [ebp - 0x140]
push ecx
push str._d_wide_chars_to__s_d_bytes
lea edx, [ebp - 0xf4]
push edx
call dword [sym.imp.MSVCR120.dll__swprintf]
add esp, 0x14
cmp dword [ebp + 0x10], 0
je 0x58687e
lea eax, [ebp - 0xf4]
push eax
mov ecx, dword [ebp + 0x10]
call fcn.00415f50
movzx ecx, byte [ebp - 0x125]
test ecx, ecx
jne 0x5868be
cmp dword [ebp + 0x10], 0
je 0x5868be
lea edx, [ebp - 0x10c]
push edx
call fcn.005879d0
add esp, 4
mov dword [ebp - 0x14c], eax
mov eax, dword [ebp - 0x14c]
push eax
mov ecx, dword [ebp + 0x10]
call fcn.00430160
lea ecx, [ebp - 0x10c]
call fcn.00413150
mov ecx, dword [ebp - 0x130]
push ecx
call dword [sym.imp.MSVCR120.dll_fclose]
add esp, 4
cmp dword [ebp + 0x14], 0
je 0x5868df
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp - 0x154]
mov dword [edx], eax
mov al, byte [ebp - 0x125]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005f24e0
mov esp, ebp
pop ebp
ret