Function at 0x511d1c
Capabilities:
Get disk size
Get file size
Get memory capacity
Read file via mapping

Disassembly:
mov eax, 0x576d4f
call fcn.00524444
sub esp, 0x3ac
push ebx
push esi
mov esi, dword [ebp + 8]
mov ebx, dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
and dword [ebp - 0x34], 0
or dword [ebp - 0x14], 0xffffffff
mov eax, dword [esi + 0x10]
or dword [ebp - 0x28], 0xffffffff
or dword [ebp - 0x20], 0xffffffff
and dword [ebp - 4], 0
push edi
lea edi, [esi + 0x10]
mov dword [ebp - 0x10], esp
push 0x238
push esi
mov dword [ebp - 0x24], eax
call ebx
test eax, eax
je 0x511d7f
lea eax, [ebp - 0x9c]
push 0x5af2c0
push eax
mov dword [ebp - 0x9c], 0x2001
call fcn.00529cc7
mov edx, dword [esi + 4]
cmp edx, 0x3e8
jbe 0x511d9f
lea eax, [ebp - 0x70]
push 0x5af2c0
push eax
mov dword [ebp - 0x70], 0x2001
call fcn.00529cc7
mov eax, dword [esi + 0xc]
cmp eax, 1
jb 0x512419
cmp eax, 4
ja 0x512419
mov ecx, dword [esi]
test ch, 1
jne 0x511dc0
test cl, 0x20
je 0x511dda
cmp edx, 1
jae 0x511dda
lea eax, [ebp - 0x40]
push 0x5af2c0
push eax
mov dword [ebp - 0x40], 0x2001
call fcn.00529cc7
lea eax, [eax + eax*2]
shl eax, 2
push eax
push dword [esi + 8]
call ebx
test eax, eax
je 0x511e05
lea eax, [ebp - 0x94]
push 0x5af2c0
push eax
mov dword [ebp - 0x94], 0x81
call fcn.00529cc7
cmp byte [esi + 0x114], 0
jne 0x511e1c
push dword [esi + 0x118]
push dword [edi]
call ebx
test eax, eax
jne 0x511e31
cmp byte [esi + 0x114], 1
jne 0x511e87
push 0x104
push edi
call ebx
test eax, eax
je 0x511e46
lea eax, [ebp - 0x48]
push 0x5af2c0
push eax
mov dword [ebp - 0x48], 0x21
call fcn.00529cc7
cmp byte [esi + 0x114], 1
jne 0x511e87
xor eax, eax
push eax
push 1
push 3
push eax
push eax
push bind
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x14], eax
jne 0x511e87
lea eax, [ebp - 0x88]
push 0x5af2c0
push eax
mov dword [ebp - 0x88], 0x21
call fcn.00529cc7
cmp byte [esi + 0x220], 0
jne 0x511ea6
push dword [esi + 0x224]
push dword [esi + 0x11c]
call dword [sym.imp.KERNEL32.dll_IsBadWritePtr]
test eax, eax
jne 0x511ec1
cmp byte [esi + 0x220], 1
jne 0x511ed6
lea eax, [esi + 0x11c]
push 0x104
push eax
call ebx
test eax, eax
je 0x511ed6
lea eax, [ebp - 0x50]
push 0x5af2c0
push eax
mov dword [ebp - 0x50], 0x101
call fcn.00529cc7
mov ebx, dword [esi + 0x118]
cmp dword [ebp - 0x14], 0xffffffff
mov dword [ebp - 0x30], ebx
je 0x511f77
xor edi, edi
push edi
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [ebp - 0x30], ebx
je 0x511f5c
cmp ebx, edi
je 0x511f5c
push edi
push ebx
push edi
push 2
push edi
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
cmp eax, edi
mov dword [ebp - 0x20], eax
jne 0x511f34
lea eax, [ebp - 0xa0]
push 0x5af2c0
push eax
mov dword [ebp - 0xa0], 0x201
call fcn.00529cc7
push ebx
push edi
push edi
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, edi
mov dword [ebp - 0x24], eax
jne 0x511f77
lea eax, [ebp - 0x58]
push 0x5af2c0
push eax
mov dword [ebp - 0x58], 0x201
call fcn.00529cc7
lea eax, [ebp - 0x90]
push 0x5af2c0
push eax
mov dword [ebp - 0x90], 0x21
call fcn.00529cc7
cmp byte [esi + 0x220], 1
jne 0x512062
lea eax, [esi + 0x11c]
push 2
push eax
lea eax, [ebp - 0x1c]
push eax
call fcn.005244d0
and byte [ebp - 0x1a], 0
add esp, 0xc
push str.GetDiskFreeSpaceExA
push 0x5bf028
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x51200e
lea ecx, [ebp - 0xb0]
lea edx, [ebp - 0x1c]
push ecx
lea ecx, [ebp - 0xe8]
push ecx
lea ecx, [ebp - 0xc0]
push ecx
mov cl, byte [ebp - 0x1b]
sub cl, 0x3a
neg cl
sbb ecx, ecx
not ecx
and ecx, edx
push ecx
call eax
mov ecx, dword [ebp - 0xac]
xor eax, eax
cmp ecx, eax
ja 0x512062
jb 0x511ff9
mov eax, dword [ebp - 0xb0]
cmp eax, ebx
jae 0x512062
lea eax, [ebp - 0x60]
push 0x5af2c0
push eax
mov dword [ebp - 0x60], 0x501
call fcn.00529cc7
lea eax, [ebp - 0xb4]
lea ecx, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x68]
push eax
lea eax, [ebp - 0xa8]
push eax
mov al, byte [ebp - 0x1b]
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 - 0xa8]
imul eax, dword [ebp - 0x68]
imul eax, dword [ebp - 0x2c]
cmp eax, ebx
jae 0x512062
lea eax, [ebp - 0x38]
push 0x5af2c0
push eax
mov dword [ebp - 0x38], 0x501
call fcn.00529cc7
mov eax, dword [esi]
test al, 0x20
je 0x51206d
test ah, 1
jne 0x512076
test ah, 1
je 0x512091
test al, 0x40
je 0x512091
lea eax, [ebp - 0x98]
push 0x5af2c0
push eax
mov dword [ebp - 0x98], 0x2001
call fcn.00529cc7
push 0x20
lea eax, [ebp - 0xe0]
pop edi
push edi
push 0
push eax
call fcn.00524810
add esp, 0xc
lea eax, [ebp - 0xe0]
mov dword [ebp - 0xe0], edi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalMemoryStatus]
lea eax, [ebx + ebx*2]
cmp eax, dword [ebp - 0xd4]
sbb eax, eax
neg eax
mov dword [ebp - 0x2c], eax
xor edi, edi
cmp edi, dword [esi + 0xc]
jae 0x5121af
and byte [ebp - 0x15], 0
and dword [ebp - 0x1c], 0
cmp dword [ebp - 0x1c], edi
jge 0x512113
mov ecx, dword [ebp - 0x1c]
mov eax, dword [esi + 8]
lea edx, [edi + edi*2]
lea ecx, [ecx + ecx*2]
mov ebx, dword [eax + edx*4]
lea ecx, [eax + ecx*4]
lea eax, [eax + edx*4]
mov edx, dword [ecx]
cmp edx, ebx
jb 0x512105
cmp edx, dword [eax + 4]
jbe 0x51210a
cmp edx, ebx
ja 0x51210e
cmp ebx, dword [ecx + 4]
ja 0x51210e
mov byte [ebp - 0x15], 1
inc dword [ebp - 0x1c]
jmp 0x5120dc
cmp byte [ebp - 0x15], 0
jne 0x51213c
mov eax, dword [esi + 8]
lea ebx, [edi + edi*2]
shl ebx, 2
push dword [ebx + eax + 8]
call fcn.00513b83
test al, al
pop ecx
je 0x51213c
mov eax, dword [esi + 8]
add eax, ebx
mov ecx, dword [eax]
cmp ecx, dword [eax + 4]
jbe 0x51214c
mov eax, edi
sub eax, 0
je 0x51219a
dec eax
je 0x512185
dec eax
je 0x51216a
dec eax
je 0x512155
mov ebx, dword [ebp - 0x30]
inc edi
jmp 0x5120cb
lea eax, [ebp - 0x78]
push 0x5af2c0
push eax
mov dword [ebp - 0x78], 0x11
call fcn.00529cc7
lea eax, [ebp - 0xa4]
push 0x5af2c0
push eax
mov dword [ebp - 0xa4], 9
call fcn.00529cc7
lea eax, [ebp - 0x80]
push 0x5af2c0
push eax
mov dword [ebp - 0x80], 5
call fcn.00529cc7
lea eax, [ebp - 0x3c]
push 0x5af2c0
push eax
mov dword [ebp - 0x3c], 3
call fcn.00529cc7
mov eax, dword [esi]
test al, 0x80
je 0x5121be
mov cx, word [esi + 0x22c]
jmp 0x5121c1
push 9
pop ecx
push dword [esi + 0x234]
push dword [esi + 0x230]
push dword [esi + 4]
push dword [esi + 0x228]
push ecx
push eax
push ebx
mov ebx, dword [ebp - 0x24]
push ebx
lea ecx, [ebp - 0x3b8]
call fcn.00512928
mov eax, dword [esi]
mov byte [ebp - 4], 1
test al, 0x20
je 0x51233f
test al, 0x40
jne 0x51233f
lea ecx, [ebp - 0x3b8]
call fcn.00514d97
test al, al
jne 0x512224
mov eax, dword [ebp - 0x3a8]
push 0x5af2b0
mov dword [ebp - 0x44], eax
lea eax, [ebp - 0x44]
push eax
call fcn.00529cc7
cmp dword [ebp - 0x20], 0xffffffff
je 0x51225f
cmp dword [ebp - 0x14], 0xffffffff
je 0x51225f
cmp ebx, dword [esi + 0x10]
je 0x512247
xor edi, edi
cmp ebx, edi
je 0x512249
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [ebp - 0x24], edi
jmp 0x512249
xor edi, edi
push dword [ebp - 0x20]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
call ebx
push dword [ebp - 0x14]
call ebx
or dword [ebp - 0x20], 0xffffffff
jmp 0x512261
xor edi, edi
push edi
push 0x4000001
push 3
push edi
push edi
lea eax, [ebp - 0x33c]
push bind
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x14], eax
jne 0x51229a
lea eax, [ebp - 0x4c]
push 0x5af2c0
push eax
mov dword [ebp - 0x4c], 0x21
call fcn.00529cc7
push edi
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x51232a
cmp ebx, edi
je 0x51232a
push edi
push ebx
push edi
push 2
push edi
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
cmp eax, edi
mov dword [ebp - 0x20], eax
jne 0x5122da
lea eax, [ebp - 0x54]
push 0x5af2c0
push eax
mov dword [ebp - 0x54], 0x201
call fcn.00529cc7
push ebx
push edi
push edi
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, edi
mov dword [ebp - 0x24], eax
jne 0x512302
lea eax, [ebp - 0x5c]
push 0x5af2c0
push eax
mov dword [ebp - 0x5c], 0x201
call fcn.00529cc7
push ebx
push eax
lea ecx, [ebp - 0x3b8]
call fcn.00514d84
test al, al
jne 0x512341
mov eax, dword [ebp - 0x3a8]
push 0x5af2b0
mov dword [ebp - 0x64], eax
lea eax, [ebp - 0x64]
push eax
call fcn.00529cc7
lea eax, [ebp - 0x6c]
push 0x5af2c0
push eax
mov dword [ebp - 0x6c], 0x21
call fcn.00529cc7
xor edi, edi
push dword [ebp - 0x2c]
lea ecx, [ebp - 0x3b8]
push dword [esi + 0xc]
push dword [esi + 8]
call fcn.00512b52
test al, al
jne 0x512370
mov eax, dword [ebp - 0x3a8]
push 0x5af2b0
mov dword [ebp - 0x74], eax
lea eax, [ebp - 0x74]
push eax
call fcn.00529cc7
lea ecx, [ebp - 0x3b8]
call fcn.00513b9f
cmp byte [esi + 0x220], 1
jne 0x5123f1
push edi
push 0x80
push 2
push edi
push edi
lea eax, [esi + 0x11c]
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [ebp - 0x28], edi
jne 0x5123bf
lea eax, [ebp - 0x7c]
push 0x5af2c0
push eax
mov dword [ebp - 0x7c], 0x101
call fcn.00529cc7
push edi
lea ecx, [ebp - 0x3b8]
call fcn.005147be
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x512408
lea eax, [ebp - 0x84]
push 0x5af2c0
push eax
mov dword [ebp - 0x84], 0x101
call fcn.00529cc7
push dword [esi + 0x224]
lea ecx, [ebp - 0x3b8]
push dword [esi + 0x11c]
call fcn.005149ff
and byte [ebp - 4], 0
lea ecx, [ebp - 0x3b8]
call fcn.00512acf
jmp 0x512446
lea eax, [ebp - 0x8c]
push 0x5af2c0
push eax
mov dword [ebp - 0x8c], 0x41
call fcn.00529cc7
mov eax, dword [ebp - 0xb8]
mov dword [ebp - 0x34], eax
mov eax, 0x512443
ret
cmp dword [ebp - 0x20], 0xffffffff
je 0x512468
mov eax, dword [ebp - 0x24]
cmp eax, dword [esi + 0x10]
je 0x51245f
test eax, eax
je 0x51245f
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x14], 0xffffffff
je 0x512477
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x28], 0xffffffff
je 0x512486
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x34]
jmp 0x5124d9
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret