Function at 0x5124e8
Capabilities:
Get disk size
Get file size
Read file via mapping

Disassembly:
mov eax, 0x576d67
call fcn.00524444
sub esp, 0xc0
push ebx
or dword [ebp - 0x14], 0xffffffff
or dword [ebp - 0x20], 0xffffffff
or dword [ebp - 0x1c], 0xffffffff
push esi
mov esi, dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x10], esp
xor ebx, ebx
mov eax, dword [edi]
push 0x10c
push edi
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], eax
mov dword [ebp - 4], ebx
call esi
test eax, eax
jne 0x512834
cmp byte [edi + 0x104], bl
jne 0x51254a
push dword [edi + 0x108]
push dword [edi]
call esi
test eax, eax
jne 0x512834
cmp byte [edi + 0x104], 1
jne 0x51259c
push 0x104
push edi
call esi
test eax, eax
jne 0x512834
cmp byte [edi + 0x104], 1
jne 0x51259c
push ebx
push 1
push 3
push ebx
push ebx
push bind
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x14], eax
jne 0x51259c
lea eax, [ebp - 0x54]
push 0x5af2c0
push eax
mov dword [ebp - 0x54], 0x21
call fcn.00529cc7
push 0x10c
push dword [ebp + 0x14]
call esi
test eax, eax
jne 0x51281f
mov eax, dword [ebp + 0x14]
cmp byte [eax + 0x104], bl
jne 0x5125cf
push dword [eax + 0x108]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_IsBadWritePtr]
test eax, eax
jne 0x51281f
mov eax, dword [ebp + 0x14]
cmp byte [eax + 0x104], 1
jne 0x5125eb
push 0x104
push eax
call esi
test eax, eax
jne 0x51281f
cmp dword [ebp - 0x14], 0xffffffff
mov esi, dword [edi + 0x108]
je 0x512674
push ebx
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
je 0x51265f
cmp esi, ebx
je 0x51265f
push ebx
push esi
push ebx
push 2
push ebx
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
cmp eax, ebx
mov dword [ebp - 0x1c], eax
jne 0x512637
lea eax, [ebp - 0x34]
push 0x5af2c0
push eax
mov dword [ebp - 0x34], 0x201
call fcn.00529cc7
push esi
push ebx
push ebx
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, ebx
mov dword [ebp - 0x24], eax
jne 0x512674
lea eax, [ebp - 0x58]
push 0x5af2c0
push eax
mov dword [ebp - 0x58], 0x201
call fcn.00529cc7
lea eax, [ebp - 0x3c]
push 0x5af2c0
push eax
mov dword [ebp - 0x3c], 0x21
call fcn.00529cc7
mov eax, dword [ebp + 0x14]
cmp byte [eax + 0x104], 1
jne 0x512741
push 2
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.005244d0
add esp, 0xc
mov byte [ebp - 0x16], bl
push str.GetDiskFreeSpaceExA
push 0x5bf028
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
je 0x5126f6
lea ecx, [ebp - 0x68]
lea edx, [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x78]
push ecx
lea ecx, [ebp - 0x80]
push ecx
mov cl, byte [ebp - 0x17]
sub cl, 0x3a
neg cl
sbb ecx, ecx
not ecx
and ecx, edx
push ecx
call eax
mov eax, dword [ebp - 0x64]
cmp eax, ebx
ja 0x512741
jb 0x5126e1
mov eax, dword [ebp - 0x68]
cmp eax, esi
jae 0x512741
lea eax, [ebp - 0x50]
push 0x5af2c0
push eax
mov dword [ebp - 0x50], 0x501
call fcn.00529cc7
lea eax, [ebp - 0x6c]
lea ecx, [ebp - 0x18]
push eax
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x44]
push eax
mov al, byte [ebp - 0x17]
sub al, 0x3a
neg al
sbb eax, eax
not eax
and eax, ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceA]
mov eax, dword [ebp - 0x44]
imul eax, dword [ebp - 0x2c]
imul eax, dword [ebp - 0x4c]
cmp eax, esi
jae 0x512741
lea eax, [ebp - 0x5c]
push 0x5af2c0
push eax
mov dword [ebp - 0x5c], 0x501
call fcn.00529cc7
push ebx
lea ecx, [ebp - 0xcc]
push dword [ebp + 0x18]
push dword [ebp + 0xc]
push dword [ebp + 8]
push esi
push dword [ebp - 0x24]
call fcn.005179d2
lea ecx, [ebp - 0xcc]
mov byte [ebp - 4], 1
call fcn.00517aaa
cmp al, bl
jne 0x512784
mov eax, dword [ebp - 0xbc]
push 0x5af2b0
mov dword [ebp - 0x60], eax
lea eax, [ebp - 0x60]
push eax
call fcn.00529cc7
lea ecx, [ebp - 0xcc]
call fcn.00517d41
mov eax, dword [ebp + 0x14]
cmp byte [eax + 0x104], 1
jne 0x5127fc
push ebx
push 0x80
push 2
push ebx
push ebx
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp - 0x20], esi
jne 0x5127d0
lea eax, [ebp - 0x30]
push 0x5af2c0
push eax
mov dword [ebp - 0x30], 0x101
call fcn.00529cc7
push esi
lea ecx, [ebp - 0xcc]
call fcn.005187d5
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x51280f
lea eax, [ebp - 0x38]
push 0x5af2c0
push eax
mov dword [ebp - 0x38], 0x101
call fcn.00529cc7
push dword [eax + 0x108]
lea ecx, [ebp - 0xcc]
push dword [eax]
call fcn.00518a63
lea ecx, [ebp - 0xcc]
mov byte [ebp - 4], bl
call fcn.00517a62
jmp 0x51285a
lea eax, [ebp - 0x40]
push 0x5af2c0
push eax
mov dword [ebp - 0x40], 0x101
call fcn.00529cc7
lea eax, [ebp - 0x48]
push 0x5af2c0
push eax
mov dword [ebp - 0x48], 0x21
call fcn.00529cc7
mov eax, dword [ebp - 0x70]
mov dword [ebp - 0x28], eax
mov eax, 0x512855
ret
cmp dword [ebp - 0x1c], 0xffffffff
je 0x51287b
mov eax, dword [ebp - 0x24]
cmp eax, dword [edi]
je 0x512872
cmp eax, ebx
je 0x512872
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x14], 0xffffffff
je 0x51288a
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x20], 0xffffffff
je 0x512899
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x28]
jmp 0x5128eb
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret