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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
push edi
push str.CreateFileA
push str.Kernel32.dll
call dword [sym.imp.KERNEL32.DLL_LoadLibraryA]
push eax
call fcn.100078a2
pop ecx
xor ebx, ebx
pop ecx
mov ecx, dword [ebp + 0xc]
push ebx
push ebx
push 3
push ebx
push 1
push 0x80000000
mov dword [ecx], ebx
push dword [ebp + 8]
call eax
mov edi, eax
cmp edi, 0xffffffff
mov dword [ebp + 8], edi
je 0x1000663b
mov esi, dword [sym.imp.KERNEL32.DLL_SetFilePointer]
push 2
push ebx
push 0xfffffffffffffffc
push edi
call esi
lea eax, [ebp - 0x14]
push ebx
push eax
lea eax, [ebp - 0x18]
push 4
push eax
push edi
mov edi, dword [sym.imp.KERNEL32.DLL_ReadFile]
call edi
mov eax, dword [ebp - 0x18]
push 2
push ebx
push 0xfffffffffffffff8
push dword [ebp + 8]
mov dword [ebp - 0x10], eax
call esi
lea eax, [ebp - 0x14]
push ebx
push eax
lea eax, [ebp - 4]
push 4
push eax
push dword [ebp + 8]
call edi
push ebx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov ecx, dword [ebp - 4]
cmp ecx, eax
ja 0x10006632
push 2
push ebx
neg ecx
push ecx
push dword [ebp + 8]
call esi
mov eax, dword [ebp - 4]
mov esi, dword [sym.imp.MSVCRT.dll_malloc]
add eax, 0xfffffff8
push eax
call esi
cmp eax, ebx
pop ecx
mov dword [ebp - 8], eax
jne 0x10006642
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
lea ecx, [ebp - 0x14]
push ebx
push ecx
mov ecx, dword [ebp - 4]
add ecx, 0xfffffff8
push ecx
push eax
push dword [ebp + 8]
call edi
mov eax, dword [ebp - 4]
cmp eax, 8
jb 0x1000663b
cmp eax, 0x3e8
ja 0x1000663b
push 0x44
add eax, 0xfffffff8
xor edx, edx
pop ecx
div ecx
xor edi, edi
test eax, eax
jle 0x1000669f
mov eax, dword [ebp - 8]
mov dword [ebp - 0xc], eax
push dword [ebp - 0x10]
push 0x44
push dword [ebp - 0xc]
call fcn.100079ea
mov eax, dword [ebp - 4]
add esp, 0xc
add eax, 0xfffffff8
xor edx, edx
push 0x44
add dword [ebp - 0xc], 0x44
pop ecx
inc edi
div ecx
cmp edi, eax
jl 0x10006679
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
xor eax, eax
lea edi, [ebp - 0x23]
mov byte [ebp - 0x24], bl
mov dword [ebp - 0x10], ebx
stosd dword es:[edi], eax
mov eax, dword [ebp + 0x10]
cmp dword [eax], 0xffffffff
jne 0x100066d6
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
push 0x44
xor edx, edx
mov dword [eax], ecx
mov eax, dword [ebp - 4]
add eax, 0xfffffff8
pop ecx
div ecx
jmp 0x1000663d
push 5
lea eax, [ebp - 0x24]
push ebx
push eax
call sub.MSVCRT.dll_memset
mov eax, dword [ebp - 4]
add eax, 0xfffffff8
push eax
call esi
mov ecx, eax
add esp, 0x10
cmp ecx, ebx
mov dword [ebp - 0x1c], ecx
je 0x1000663b
mov eax, dword [ebp - 4]
push 0x44
add eax, 0xfffffff8
xor edx, edx
pop esi
mov dword [ebp - 0xc], ebx
div esi
test eax, eax
jle 0x10006762
mov ebx, dword [ebp - 8]
mov dword [ebp + 8], ecx
lea eax, [ebx + 4]
push 4
push eax
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.MSVCRT.dll_strncpy]
push dword [ebp + 0x10]
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.MSVCRT.dll__strcmpi]
add esp, 0x14
test eax, eax
jne 0x1000674a
mov edi, dword [ebp + 8]
inc dword [ebp - 0x10]
add dword [ebp + 8], 0x44
push 0x11
pop ecx
mov esi, ebx
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 4]
push 0x44
add eax, 0xfffffff8
xor edx, edx
pop ecx
inc dword [ebp - 0xc]
div ecx
add ebx, 0x44
cmp dword [ebp - 0xc], eax
jl 0x10006715
push dword [ebp - 8]
call dword [sym.imp.MSVCRT.dll_free]
mov eax, dword [ebp + 0xc]
pop ecx
mov ecx, dword [ebp - 0x1c]
mov dword [eax], ecx
mov eax, dword [ebp - 0x10]
jmp 0x1000663d