Function at 0x51bc0f
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x64
mov eax, dword [0x5ca1c8]
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.0051b03d
mov ecx, dword [ebp - 0x50]
mov esi, eax
mov eax, dword [ebx + 0x154]
mov edi, edx
lea edx, [ebx + 0x55c]
mov dword [ecx + 0x2a4], eax
mov eax, dword [ebx + 0x104]
mov dword [ecx + 0x2a8], eax
mov eax, dword [ecx]
mov dword [eax + 0xdc], edx
mov eax, dword [ebp - 0x4c]
test eax, eax
jne 0x51bc8f
push 0x25
pop eax
jmp 0x51be90
cmp byte [eax + 1], 0
je 0x51bc87
mov eax, dword [ebx + 0x8670]
or eax, dword [ebx + 0x8674]
je 0x51bcaa
push 0x59f440
jmp 0x51bcee
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 0x51bce0
mov eax, dword [ebp - 0x44]
push dword [eax]
push str.Cant_open__s_for_writing
push ebx
call fcn.005129bc
add esp, 0xc
push 0x17
jmp 0x51bc89
push eax
call dword [sym.imp.MSVCR120.dll__close]
mov dword [esp], 0x59f420
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 0x51bcc9
mov edx, dword [ebx + 0x1b0]
mov ecx, dword [ebx + 0x1b4]
cmp edx, 0xffffffff
jne 0x51bd17
cmp ecx, edx
je 0x51bd26
push ecx
push edx
mov ecx, ebx
call fcn.0051a917
mov eax, dword [ebp - 0x48]
add esp, 8
xor ecx, ecx
cmp dword [ebx + 0x8674], ecx
jg 0x51bd7e
jl 0x51bd3a
cmp dword [ebx + 0x8670], ecx
jae 0x51bd7e
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 0x51bd6c
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 0x51bcd3
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.00513354
mov dword [ebp - 0x44], eax
pop ecx
test eax, eax
jne 0x51be81
mov ecx, dword [ebp - 0x60]
mov dword [ebp - 0x4c], ecx
test ecx, ecx
jle 0x51be6b
mov eax, dword [ebx + 0x8674]
mov edx, dword [ebx + 0x8670]
mov dword [ebp - 0x44], eax
mov eax, edx
or eax, dword [ebp - 0x44]
je 0x51bde3
mov eax, dword [ebp - 0x44]
cmp dword [ebp - 0x5c], eax
jg 0x51be43
jl 0x51bdcd
cmp ecx, edx
ja 0x51be43
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 0x51be66
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.0051a948
test eax, eax
jne 0x51be62
push edi
push esi
mov ecx, ebx
call fcn.0051b0c6
mov dword [ebp - 0x44], eax
pop ecx
pop ecx
test eax, eax
je 0x51bd7e
jmp 0x51be81
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 0x51bde9
push 0x2a
jmp 0x51be68
push 0x37
pop esi
jmp 0x51be84
mov ecx, dword [ebp - 0x50]
call fcn.0051a948
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.0055fedc
mov esp, ebp
pop ebp
ret