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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x18
lea eax, [esp + 8]
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x474075
mov ebx, dword [esp + 8]
mov eax, dword [esp + 0xc]
cmp ebx, 1
sbb eax, 0
jl 0x474085
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
test eax, eax
je 0x4740fd
mov ecx, dword [edx + 4]
not ecx
add ecx, eax
mov edi, ebx
sub edi, ecx
jbe 0x474291
add edi, eax
push edi
push dword [edx + 8]
call sym._realloc
mov edx, dword [ebp + 0xc]
add esp, 8
mov dword [edx + 8], eax
jmp 0x47428f
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
mov ebx, dword [edx + 4]
test eax, eax
je 0x47409c
mov ecx, ebx
not ecx
add ecx, eax
cmp ecx, 0x1e
ja 0x4740d2
cmp eax, 2
mov ecx, 0x20
cmovae ecx, eax
lea edx, [ebx + 0x20]
nop word [eax + eax]
mov edi, ecx
add ecx, ecx
cmp edx, edi
ja 0x4740b0
test eax, eax
je 0x4740d6
push edi
mov esi, dword [ebp + 0xc]
push dword [esi + 8]
call sym._realloc
mov edx, esi
add esp, 8
mov dword [esi + 8], eax
jmp 0x474147
mov edi, eax
jmp 0x47414d
push edi
call sym._malloc
add esp, 4
mov esi, eax
test ebx, ebx
je 0x47413e
inc ebx
push ebx
mov ebx, dword [ebp + 0xc]
push dword [ebx + 8]
push esi
call sym._memcpy
mov edx, ebx
add esp, 0xc
mov dword [ebx + 8], esi
jmp 0x474147
mov esi, dword [edx + 4]
mov eax, ebx
or eax, esi
je 0x47426d
lea edi, [esi + ebx]
inc edi
push edi
call sym._malloc
add esp, 4
mov ecx, eax
test esi, esi
je 0x474286
inc esi
push esi
mov eax, dword [ebp + 0xc]
push dword [eax + 8]
push ecx
mov esi, ecx
call sym._memcpy
mov ecx, esi
mov edx, dword [ebp + 0xc]
add esp, 0xc
jmp 0x47428c
mov byte [esi], 0
mov edx, dword [ebp + 0xc]
mov dword [edx + 8], esi
mov dword [edx], edi
test edi, edi
je 0x474158
mov eax, dword [edx + 4]
mov esi, eax
not esi
add esi, edi
jmp 0x47415d
mov eax, dword [edx + 4]
xor esi, esi
mov dword [esp + 4], 0
add eax, dword [edx + 8]
lea ecx, [esp + 4]
push 0
push ecx
push esi
push eax
jmp 0x47418e
xor esi, esi
add ebx, dword [edx + 8]
push 0
lea eax, [esp + 8]
push eax
push esi
push ebx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47426a
mov ecx, dword [esp + 4]
test ecx, ecx
je 0x47426a
mov edx, dword [ebp + 0xc]
mov ebx, dword [edx + 4]
add ebx, ecx
mov dword [edx + 4], ebx
mov eax, dword [edx]
cmp ecx, esi
jne 0x474210
test eax, eax
je 0x4741cd
lea ecx, [eax - 1]
mov edx, ebx
not edx
add edx, eax
cmp edx, ecx
jae 0x47421b
cmp eax, 2
mov ecx, eax
mov edx, 0x20
cmovb ecx, edx
lea edx, [eax + ebx]
nop dword [eax]
mov edi, ecx
add ecx, ecx
cmp edx, edi
ja 0x4741e0
test eax, eax
je 0x474220
push edi
mov esi, dword [ebp + 0xc]
push dword [esi + 8]
call sym._realloc
mov edx, esi
add esp, 8
mov esi, eax
mov ebx, dword [edx + 4]
jmp 0x474250
mov edi, eax
test edi, edi
jne 0x47425d
jmp 0x474180
mov edx, dword [ebp + 0xc]
jmp 0x47425f
push edi
call sym._malloc
add esp, 4
mov esi, eax
test ebx, ebx
je 0x474247
lea eax, [ebx + 1]
push eax
mov eax, dword [ebp + 0xc]
push dword [eax + 8]
push esi
call sym._memcpy
mov edx, dword [ebp + 0xc]
add esp, 0xc
jmp 0x474250
mov byte [esi], 0
xor ebx, ebx
mov edx, dword [ebp + 0xc]
nop
mov dword [edx + 8], esi
mov dword [edx], edi
test edi, edi
je 0x474180
mov eax, edi
mov esi, ebx
not esi
add esi, eax
jmp 0x474182
mov edx, dword [ebp + 0xc]
mov eax, dword [edx + 4]
mov ecx, dword [edx + 8]
mov byte [ecx + eax], 0
cmp dword [edx + 4], 0
setne al
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov byte [ecx], 0
mov edx, dword [ebp + 0xc]
mov dword [edx + 8], ecx
mov dword [edx], edi
mov dword [esp + 4], 0
test ebx, ebx
je 0x47426d
mov eax, dword [edx + 4]
lea esi, [esp + 4]
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
nop word [eax + eax]
add eax, dword [edx + 8]
push 0
push esi
push ebx
push eax
push dword [ebp + 8]
call edi
mov edx, dword [ebp + 0xc]
test eax, eax
je 0x47426d
mov ecx, dword [esp + 4]
test ecx, ecx
je 0x47426d
mov eax, dword [edx + 4]
add eax, ecx
mov dword [edx + 4], eax
sub ebx, ecx
jne 0x4742b0
jmp 0x47426d