Function at 0x509ce3
Capabilities:
Get memory capacity

Disassembly:
mov eax, 0x69f575
call fcn.006375a8
mov eax, dword [0x7a3c08]
sub esp, 0x2c
shr eax, 2
push esi
push edi
test al, 1
je 0x509d1a
call fcn.004a3ee5
mov esi, dword [eax + 4]
mov edi, esi
jmp 0x509d14
mov ecx, dword [esi + 8]
push 1
mov eax, dword [ecx]
call dword [eax + 0x14]
mov esi, dword [esi]
cmp esi, edi
jne 0x509d0a
mov eax, dword fs:[0x2c]
mov ecx, dword [0x7d3240]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x7ac208]
cmp eax, dword [ecx + 4]
jle 0x509d66
mov esi, 0x7ac208
push esi
call fcn.0063772c
cmp dword [0x7ac208], 0xffffffff
pop ecx
jne 0x509d66
mov eax, dword [0x7a00b8]
mov dword [0x7ac200], eax
mov eax, dword [0x7a00bc]
push esi
mov dword [0x7ac204], eax
call fcn.006376ed
pop ecx
mov ecx, dword [0x7ac200]
mov eax, dword [0x7ac204]
add ecx, 2
mov edx, dword [0x7a00bc]
push ebx
push 0
pop edi
adc eax, edi
cmp eax, edx
jg 0x509dc9
mov eax, dword [0x7a00b8]
jl 0x509d8f
cmp ecx, eax
jae 0x509dc9
mov ebx, 0x7ac1ac
mov dword [0x7ac200], eax
push ebx
mov dword [0x7ac204], edx
call fcn.00469175
mov esi, 0x7abe68
mov ecx, esi
call fcn.0050a653
add esi, 0x24
cmp esi, 0x7ac1a4
jl 0x509daa
push ebx
mov dword [ebp - 4], edi
call fcn.00469268
or dword [ebp - 4], 0xffffffff
push 5
mov edx, 0x7abda0
pop esi
mov eax, dword [edx]
mov ecx, dword [edx - 4]
mov dword [edx], ecx
sub ecx, eax
mov dword [edx + 4], ecx
mov eax, dword [edx - 8]
mov dword [edx - 8], edi
add dword [edx + 8], eax
mov dword [edx + 0x10], eax
adc dword [edx + 0xc], edi
lea edx, [edx + 0x1c]
sub esi, 1
jne 0x509dd1
cmp byte [0x7abd4a], 0
je 0x509e08
mov esi, dword [0x7abd64]
shl esi, 0x14
jmp 0x509e0e
mov esi, dword [0x7abd3c]
movzx eax, byte [0x7abd50]
neg eax
sbb eax, eax
and eax, esi
push eax
push 0x7abe58
call dword [sym.imp.KERNEL32.DLL_InterlockedExchange]
lea eax, [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.DLL_GlobalMemoryStatus]
push edi
push esi
push edi
push dword [ebp - 0x30]
call fcn.0050596b
push edi
push eax
mov eax, dword [ebp - 0x20]
add eax, 0xf3800000
push edi
push eax
call fcn.0050596b
push edi
mov edi, dword [sym.imp.KERNEL32.DLL_InterlockedExchangeAdd]
mov ebx, eax
push 0x7abe58
mov dword [ebp - 0x14], edx
call edi
push 0
push 0x7abe54
mov esi, eax
call edi
mov ecx, eax
mov eax, esi
cdq
push edx
push eax
mov eax, ecx
cdq
push edx
push eax
call fcn.0050596b
xor ecx, ecx
sub ebx, eax
mov dword [ebp - 0x10], ebx
mov eax, 0x100000
sbb ecx, edx
jne 0x509e9b
cmp ebx, eax
ja 0x509e9b
and dword [ebp - 0x14], 0
mov esi, eax
mov dword [ebp - 0x10], esi
jmp 0x509ea1
mov esi, dword [ebp - 0x10]
mov dword [ebp - 0x14], ecx
cmp byte [0x7abd5d], 0
mov ebx, 0x7abe50
je 0x509ed3
cmp byte [0x7abd5e], 0
je 0x509ed7
push 0
push ebx
call edi
neg eax
sbb eax, eax
and eax, 0xffff63c0
add eax, 0x13880
cmp dword [0x7a31d4], eax
jae 0x509ed7
push 0
jmp 0x509ee1
cmp byte [0x7abd4b], 0
jne 0x509ef4
push esi
and dword [0x7abe60], 0
push ebx
call dword [sym.imp.KERNEL32.DLL_InterlockedExchange]
jmp 0x509fe9
call fcn.0054249f
push 0
add eax, eax
push 0x7abe58
mov dword [ebp - 0x14], eax
call edi
push 0
push 0x7abe54
mov edi, eax
call dword [sym.imp.KERNEL32.DLL_InterlockedExchangeAdd]
cdq
mov ecx, eax
mov esi, edx
mov eax, edi
cdq
sub eax, ecx
push 0
sbb edx, esi
mov esi, dword [ebp - 0x14]
add eax, esi
pop edi
adc edx, edi
cmp edi, edx
ja 0x509f3a
jb 0x509f36
cmp esi, eax
ja 0x509f3a
mov esi, eax
mov edi, edx
mov ecx, dword [ebp - 0x20]
xor eax, eax
sub ecx, esi
mov esi, dword [ebp - 0x10]
sbb eax, edi
shrd ecx, eax, 1
shr eax, 1
push eax
mov eax, dword [0x7abd68]
imul dword [0x7a31d4]
push ecx
xor ecx, ecx
add eax, dword [0x7abe60]
push ecx
adc edx, ecx
add eax, 0x100000
push esi
adc edx, ecx
push edx
push eax
call fcn.0050596b
push edx
push eax
call fcn.0050596b
mov edi, eax
mov dword [ebp - 0x14], edx
push edi
push ebx
call dword [sym.imp.KERNEL32.DLL_InterlockedExchange]
cmp byte [0x7abd60], 0
je 0x509fdc
mov ecx, dword [0x7abd54]
sub ecx, dword [0x7abe5c]
mov eax, dword [0x7abe64]
test eax, eax
je 0x509faf
cmp edi, esi
jne 0x509fb3
cmp dword [ebp - 0x14], 0
jne 0x509fb3
test ecx, ecx
jns 0x509fe3
test eax, eax
je 0x509fbd
dec eax
mov dword [0x7abe64], eax
mov eax, dword [0x7abe60]
add eax, ecx
mov ecx, 0x1000000
cmp eax, ecx
jle 0x509fcf
mov eax, ecx
test eax, eax
jns 0x509fd5
xor eax, eax
mov dword [0x7abe60], eax
jmp 0x509fe3
and dword [0x7abe60], 0
mov edi, dword [sym.imp.KERNEL32.DLL_InterlockedExchangeAdd]
mov eax, 0x7ada00
mov byte [ebp - 0x14], 1
push eax
mov dword [ebp - 0x18], eax
call fcn.00469175
push 0
push ebx
mov dword [ebp - 4], 1
call edi
push 0
push 0x7abe4c
mov esi, eax
call edi
cmp eax, esi
jle 0x50a02e
push 0
push ebx
call edi
push 0
push 0x7abe4c
mov esi, eax
call edi
sub eax, esi
push eax
call fcn.0054225a
call fcn.005423a8
pop ebx
test eax, eax
je 0x50a06f
call fcn.005423a8
lea esi, [eax + 0x14]
call fcn.00461dee
sub eax, dword [esi]
cmp byte [0x7abd5f], 0
mov dword [0x7abe5c], eax
je 0x50a076
imul ecx, dword [0x7abd4c], 0xea60
cmp eax, ecx
jb 0x50a076
mov eax, ecx
cdq
push edx
push eax
call fcn.005422b9
jmp 0x50a076
and dword [0x7abe5c], 0
push 0x7ada00
mov dword [ebp - 4], 2
call fcn.00469268
mov eax, dword [0x7abd80]
inc eax
pop edi
pop esi
cmp eax, 0x14
jb 0x50a097
push 0x14
pop eax
mov ecx, dword [ebp - 0xc]
mov dword [0x7abd80], eax
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4