Function at 0x519f15
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x64
mov eax, dword [0x5c31c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
push esi
push edi
push 0x5c
mov eax, dword [ebx]
mov dword [ebp - 0x50], ebx
mov eax, dword [eax + 0x8684]
mov dword [ebp - 0x44], eax
push dword [eax]
call dword [sym.imp.MSVCR120.dll_strchr]
mov ebx, dword [ebx]
mov dword [ebp - 0x4c], eax
xor eax, eax
pop ecx
pop ecx
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x58], eax
call fcn.00519343
mov ecx, dword [ebp - 0x50]
mov esi, eax
mov eax, dword [ebx + 0x154]
mov edi, edx
lea edx, [ebx + 0x55c]
mov dword [ecx + 0x2a8], eax
mov eax, dword [ebx + 0x104]
mov dword [ecx + 0x2ac], eax
mov eax, dword [ecx]
mov dword [eax + 0xdc], edx
mov eax, dword [ebp - 0x4c]
test eax, eax
jne 0x519f95
push 0x25
pop eax
jmp 0x51a196
cmp byte [eax + 1], 0
je 0x519f8d
mov eax, dword [ebx + 0x8670]
or eax, dword [ebx + 0x8674]
je 0x519fb0
push 0x59bc80
jmp 0x519ff4
mov eax, dword [ecx]
push dword [eax + 0x334]
mov eax, dword [ebp - 0x44]
push 0x8301
push dword [eax]
call dword [sym.imp.MSVCR120.dll__open]
add esp, 0xc
test eax, eax
jns 0x519fe6
mov eax, dword [ebp - 0x44]
push dword [eax]
push str.Cant_open__s_for_writing
push ebx
call fcn.00510cc2
add esp, 0xc
push 0x17
jmp 0x519f8f
push eax
call dword [sym.imp.MSVCR120.dll__close]
mov dword [esp], 0x59bcd8
mov eax, dword [ebp - 0x44]
push dword [eax]
call dword [sym.imp.MSVCR120.dll_fopen]
mov dword [ebp - 0x48], eax
pop ecx
pop ecx
test eax, eax
je 0x519fcf
mov edx, dword [ebx + 0x1b0]
mov ecx, dword [ebx + 0x1b4]
cmp edx, 0xffffffff
jne 0x51a01d
cmp ecx, edx
je 0x51a02c
push ecx
push edx
mov ecx, ebx
call fcn.00518c1d
mov eax, dword [ebp - 0x48]
add esp, 8
xor ecx, ecx
cmp dword [ebx + 0x8674], ecx
jg 0x51a084
jl 0x51a040
cmp dword [ebx + 0x8670], ecx
jae 0x51a084
lea ecx, [ebp - 0x40]
push ecx
push eax
call dword [sym.imp.MSVCR120.dll__fileno]
pop ecx
push eax
call dword [sym.imp.MSVCR120.dll__fstat64]
pop ecx
pop ecx
test eax, eax
je 0x51a072
push dword [ebp - 0x48]
call dword [sym.imp.MSVCR120.dll_fclose]
mov eax, dword [ebp - 0x44]
pop ecx
push dword [eax]
push str.Cant_get_the_size_of__s
jmp 0x519fd9
mov eax, dword [ebp - 0x28]
mov dword [ebx + 0x8670], eax
mov eax, dword [ebp - 0x24]
mov dword [ebx + 0x8674], eax
mov ecx, dword [ebp - 0x50]
lea eax, [ebp - 0x60]
push eax
mov edx, 0x4000
call fcn.0051165a
mov dword [ebp - 0x44], eax
pop ecx
test eax, eax
jne 0x51a187
mov ecx, dword [ebp - 0x60]
mov dword [ebp - 0x4c], ecx
test ecx, ecx
jle 0x51a171
mov eax, dword [ebx + 0x8674]
mov edx, dword [ebx + 0x8670]
mov dword [ebp - 0x44], eax
mov eax, edx
or eax, dword [ebp - 0x44]
je 0x51a0e9
mov eax, dword [ebp - 0x44]
cmp dword [ebp - 0x5c], eax
jg 0x51a149
jl 0x51a0d3
cmp ecx, edx
ja 0x51a149
sub edx, ecx
push 0
pop ecx
sbb eax, ecx
mov dword [ebx + 0x8670], edx
mov dword [ebx + 0x8674], eax
mov dword [ebp - 0x4c], ecx
lea edx, [ebx + 0x55c]
push dword [ebp - 0x48]
push ecx
push 1
push edx
call dword [sym.imp.MSVCR120.dll_fwrite]
mov ecx, dword [ebp - 0x4c]
add esp, 0x10
cmp eax, ecx
jne 0x51a16c
mov eax, dword [ebp - 0x54]
add eax, ecx
mov ecx, dword [ebp - 0x58]
push 0
pop edx
adc ecx, edx
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x58], ecx
mov dword [ebx + 0x45c], ecx
mov ecx, dword [ebp - 0x50]
mov dword [ebx + 0x458], eax
call fcn.00518c4e
test eax, eax
jne 0x51a168
push edi
push esi
mov ecx, ebx
call fcn.005193cc
mov dword [ebp - 0x44], eax
pop ecx
pop ecx
test eax, eax
je 0x51a084
jmp 0x51a187
mov eax, edx
lea edx, [ebx + 0x55c]
sub ecx, eax
add edx, eax
xor eax, eax
mov dword [ebp - 0x4c], ecx
mov dword [ebx + 0x8670], eax
mov dword [ebx + 0x8674], eax
jmp 0x51a0ef
push 0x2a
jmp 0x51a16e
push 0x37
pop esi
jmp 0x51a18a
mov ecx, dword [ebp - 0x50]
call fcn.00518c4e
mov ecx, dword [ebp - 0x44]
test eax, eax
push 0x2a
pop edx
cmovne ecx, edx
mov dword [ebp - 0x44], ecx
mov esi, dword [ebp - 0x44]
push dword [ebp - 0x48]
call dword [sym.imp.MSVCR120.dll_fclose]
pop ecx
mov eax, esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055daac
mov esp, ebp
pop ebp
ret