Function at 0x4cf039
Capabilities:
Get file size
Read file on windows

Disassembly:
mov eax, 0x5aba0b
call fcn.00591b5c
sub esp, 0x1e0
mov eax, dword [0x6c0bc0]
xor eax, dword [ebp + 4]
mov dword [ebp - 0x74], eax
mov dword [ebp - 0x1ec], ecx
mov eax, dword [ebp - 0x1ec]
movzx eax, byte [eax + 8]
cmp eax, 0xaa
je 0x4cf073
push 0
call fcn.004d177c
pop ecx
and byte [ebp - 0x19], 0
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.004d5a6a
pop ecx
pop ecx
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
jne 0x4cf094
xor al, al
jmp 0x4cf558
push 0
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x4cf0bb
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
mov al, 1
jmp 0x4cf558
cmp dword [ebp - 0x18], 0xffffffff
jne 0x4cf137
cmp dword [ebp + 0xc], 0
je 0x4cf124
lea ecx, [ebp - 0x3c]
call fcn.004cde9c
and dword [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.004cfd54
lea ecx, [ebp - 0x3c]
call fcn.0055420c
push eax
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x10]
mov ecx, dword [ebp + 8]
call fcn.004d0c2d
push eax
push str.filename
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x28]
push str.Failed_to_get_file_size_when_loading_string_from_file
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x10]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x3c]
call fcn.004ce1b7
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
xor al, al
jmp 0x4cf558
mov eax, dword [ebp - 0x18]
add eax, 4
push eax
mov ecx, dword [ebp - 0x1ec]
call fcn.004cd870
movzx eax, al
test eax, eax
jne 0x4cf18c
cmp dword [ebp + 0xc], 0
je 0x4cf179
push str.Out_of_memory_reading_file_into_string_buffer
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x10]
push dword [ebp - 0x18]
push str.fileSize
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x2c]
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
xor al, al
jmp 0x4cf558
and dword [ebp - 0x20], 0
push 0
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x18]
mov eax, dword [ebp - 0x1ec]
mov eax, dword [eax + 0xc]
mov ecx, dword [ebp - 0x1ec]
add eax, dword [ecx + 0x14]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x4cf243
mov eax, dword [ebp - 0x1ec]
mov eax, dword [eax + 0xc]
mov ecx, dword [ebp - 0x1ec]
mov ecx, dword [ecx + 0x14]
and byte [eax + ecx], 0
cmp dword [ebp + 0xc], 0
je 0x4cf23e
lea ecx, [ebp - 0x58]
call fcn.004cde9c
mov dword [ebp - 4], 1
lea ecx, [ebp - 0x58]
call fcn.004cfd54
lea ecx, [ebp - 0x58]
call fcn.0055420c
push eax
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x10]
mov ecx, dword [ebp + 8]
call fcn.004d0c2d
push eax
push str.filename
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x28]
push str.Failed_to_read_data_from_file
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x10]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x58]
call fcn.004ce1b7
jmp 0x4cf549
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp - 0x18]
je 0x4cf2c9
mov eax, dword [ebp - 0x1ec]
mov eax, dword [eax + 0xc]
mov ecx, dword [ebp - 0x1ec]
mov ecx, dword [ecx + 0x14]
and byte [eax + ecx], 0
cmp dword [ebp + 0xc], 0
je 0x4cf2c4
push dword [ebp - 0x18]
call fcn.004d004f
pop ecx
push eax
push str.filesize
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x28]
push dword [ebp - 0x20]
call fcn.004d004f
pop ecx
push eax
push str.bytes_received
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x28]
mov ecx, dword [ebp + 8]
call fcn.004d0c2d
push eax
push str.filename
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x28]
push str.Failed_to_read_the_entire_file
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp + 0xc]
call dword [eax + 0x10]
jmp 0x4cf549
mov eax, dword [ebp - 0x1ec]
mov eax, dword [eax + 0x14]
add eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x1ec]
mov dword [ecx + 0x14], eax
mov eax, dword [ebp - 0x1ec]
mov eax, dword [eax + 0xc]
mov ecx, dword [ebp - 0x1ec]
mov ecx, dword [ecx + 0x14]
and byte [eax + ecx], 0
mov eax, dword [ebp - 0x1ec]
mov eax, dword [eax + 0xc]
movzx eax, byte [eax]
cmp eax, 0xffffffff
jne 0x4cf3b0
mov eax, dword [ebp - 0x1ec]
mov eax, dword [eax + 0xc]
movzx eax, byte [eax + 1]
cmp eax, 0xfffffffe
jne 0x4cf3b0
lea ecx, [ebp - 0x114]
call fcn.004b4e90
mov dword [ebp - 4], 2
lea ecx, [ebp - 0x70]
call fcn.004d17b0
mov byte [ebp - 4], 3
lea eax, [ebp - 0x70]
push eax
mov eax, dword [ebp - 0x1ec]
push dword [eax + 0x14]
mov eax, dword [ebp - 0x1ec]
push dword [eax + 0xc]
push 0xfde9
push 0x4b0
lea ecx, [ebp - 0x114]
call fcn.004b8649
mov ecx, dword [ebp - 0x1ec]
call fcn.004cd0cb
lea ecx, [ebp - 0x70]
call fcn.004d1628
push eax
lea ecx, [ebp - 0x70]
call fcn.0055420c
push eax
mov ecx, dword [ebp - 0x1ec]
call fcn.004cdb7e
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x70]
call fcn.004d283f
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x114]
call fcn.004b4f06
jmp 0x4cf545
mov eax, dword [ebp - 0x1ec]
mov eax, dword [eax + 0xc]
movzx eax, byte [eax]
cmp eax, 0xfffffffe
jne 0x4cf47b
mov eax, dword [ebp - 0x1ec]
mov eax, dword [eax + 0xc]
movzx eax, byte [eax + 1]
cmp eax, 0xffffffff
jne 0x4cf47b
lea ecx, [ebp - 0x1cc]
call fcn.004b4e90
mov dword [ebp - 4], 4
lea ecx, [ebp - 0x12c]
call fcn.004d17b0
mov byte [ebp - 4], 5
lea eax, [ebp - 0x12c]
push eax
mov eax, dword [ebp - 0x1ec]
push dword [eax + 0x14]
mov eax, dword [ebp - 0x1ec]
push dword [eax + 0xc]
push 0xfde9
push 0x4b1
lea ecx, [ebp - 0x1cc]
call fcn.004b8649
mov ecx, dword [ebp - 0x1ec]
call fcn.004cd0cb
lea ecx, [ebp - 0x12c]
call fcn.004d1628
push eax
lea ecx, [ebp - 0x12c]
call fcn.0055420c
push eax
mov ecx, dword [ebp - 0x1ec]
call fcn.004cdb7e
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x12c]
call fcn.004d283f
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x1cc]
call fcn.004b4f06
jmp 0x4cf545
mov eax, dword [ebp - 0x1ec]
cmp dword [eax + 0x14], 3
jle 0x4cf545
mov eax, dword [ebp - 0x1ec]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x1d0], eax
mov eax, dword [ebp - 0x1d0]
movzx eax, byte [eax]
cmp eax, 0xef
jne 0x4cf545
mov eax, dword [ebp - 0x1d0]
movzx eax, byte [eax + 1]
cmp eax, 0xbb
jne 0x4cf545
mov eax, dword [ebp - 0x1d0]
movzx eax, byte [eax + 2]
cmp eax, 0xbf
jne 0x4cf545
lea ecx, [ebp - 0x1e8]
call fcn.004d17b0
mov dword [ebp - 4], 6
mov eax, dword [ebp - 0x1ec]
mov eax, dword [eax + 0x14]
sub eax, 3
push eax
mov eax, dword [ebp - 0x1d0]
add eax, 3
push eax
lea ecx, [ebp - 0x1e8]
call fcn.004d2c5e
mov ecx, dword [ebp - 0x1ec]
call fcn.004cd0cb
lea ecx, [ebp - 0x1e8]
call fcn.004d1628
push eax
lea ecx, [ebp - 0x1e8]
call fcn.0055420c
push eax
mov ecx, dword [ebp - 0x1ec]
call fcn.004cdb7e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x1e8]
call fcn.004d283f
mov byte [ebp - 0x19], 1
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
mov al, byte [ebp - 0x19]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x74]
xor ecx, dword [ebp + 4]
call fcn.0058cc82
leave
ret 8