Function at 0x4ae984
Capabilities:
Get memory capacity

Disassembly:
push ebp
mov ebp, esp
mov ecx, 0xd
push 0
push 0
dec ecx
jne 0x4ae98c
push ecx
push ebx
push esi
mov dword [ebp - 4], edx
mov ebx, eax
mov eax, dword [ebp - 4]
call fcn.00404be8
xor eax, eax
push ebp
push 0x4aec54
push dword fs:[eax]
mov dword fs:[eax], esp
mov dword [ebp - 0x34], 0x20
lea eax, [ebx + 8]
mov edx, dword [ebp - 4]
call fcn.0040477c
cmp byte [0x519bec], 0
je 0x4aeb26
lea eax, [ebp - 0x38]
mov ecx, 0x4aec6c
mov edx, dword [ebx + 8]
call fcn.00404a44
mov eax, dword [ebp - 0x38]
call fcn.00409bcc
test al, al
je 0x4aec17
lea eax, [ebp - 0x3c]
mov ecx, 0x4aec6c
mov edx, dword [ebx + 8]
call fcn.00404a44
mov edx, dword [ebp - 0x3c]
mov eax, ebx
call fcn.004aecc8
mov eax, dword [ebx + 0x28]
mov edx, dword [eax]
call dword [edx + 0x14]
dec eax
test eax, eax
jl 0x4aec17
inc eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 8], 0
lea eax, [ebp - 0x34]
push eax
call sub.kernel32.dll_GlobalMemoryStatus
cmp dword [ebp - 0x28], 0xe4e1c0
jb 0x4aec17
lea ecx, [ebp - 0x40]
mov edx, dword [ebp - 8]
mov eax, dword [ebx + 0x28]
mov esi, dword [eax]
call dword [esi + 0xc]
mov eax, dword [ebp - 0x40]
lea edx, [ebp - 0xc]
call fcn.00408f5c
cmp dword [ebp - 0xc], 0
je 0x4aeb15
mov dl, 1
mov eax, dword [0x496ad0]
call fcn.00497850
mov esi, eax
lea eax, [ebp - 0x44]
mov edx, dword [ebp - 0xc]
mov dl, byte [edx]
mov byte [eax + 1], dl
mov byte [eax], 1
lea edx, [ebp - 0x44]
lea eax, [ebp - 0x48]
call fcn.004031cc
lea eax, [ebp - 0x4c]
mov edx, dword [ebp - 0xc]
mov dl, byte [edx + 1]
mov byte [eax + 1], dl
mov byte [eax], 1
lea edx, [ebp - 0x4c]
lea eax, [ebp - 0x48]
mov cl, 2
call fcn.0040319c
lea edx, [ebp - 0x48]
lea eax, [ebp - 0x10]
call fcn.0040499c
mov eax, dword [ebp - 0x10]
mov edx, 0x4aec80
call fcn.00404b44
je 0x4aeacb
mov eax, dword [ebp - 0x10]
mov edx, 0x4aec8c
call fcn.00404b44
jne 0x4aeae5
lea eax, [ebp - 0x50]
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebx + 8]
call fcn.00404a44
mov edx, dword [ebp - 0x50]
mov eax, esi
call fcn.00497944
jmp 0x4aeafd
lea eax, [ebp - 0x54]
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebx + 8]
call fcn.00404a44
mov edx, dword [ebp - 0x54]
mov eax, esi
call fcn.00497cf8
lea edx, [ebp - 0x58]
mov eax, dword [ebp - 0xc]
call fcn.004ae348
mov edx, dword [ebp - 0x58]
mov ecx, esi
mov eax, dword [ebx + 0xc]
mov esi, dword [eax]
call dword [esi + 0x3c]
inc dword [ebp - 8]
dec dword [ebp - 0x14]
jne 0x4aea26
jmp 0x4aec17
lea eax, [ebp - 0x5c]
mov ecx, 0x4aec6c
mov edx, dword [ebx + 8]
call fcn.00404a44
mov eax, dword [ebp - 0x5c]
call fcn.00409bcc
test al, al
je 0x4aec17
lea eax, [ebp - 0x60]
mov ecx, 0x4aec6c
mov edx, dword [ebx + 8]
call fcn.00404a44
mov edx, dword [ebp - 0x60]
mov eax, ebx
call fcn.004aecc8
mov eax, dword [ebx + 0x28]
mov edx, dword [eax]
call dword [edx + 0x14]
dec eax
test eax, eax
jl 0x4aec17
inc eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 8], 0
lea eax, [ebp - 0x34]
push eax
call sub.kernel32.dll_GlobalMemoryStatus
cmp dword [ebp - 0x28], 0xe4e1c0
jb 0x4aec17
lea ecx, [ebp - 0x64]
mov edx, dword [ebp - 8]
mov eax, dword [ebx + 0x28]
mov esi, dword [eax]
call dword [esi + 0xc]
mov eax, dword [ebp - 0x64]
lea edx, [ebp - 0xc]
call fcn.00408f5c
cmp dword [ebp - 0xc], 0
je 0x4aec0b
mov dl, 1
mov eax, dword [0x496ad0]
call fcn.00497850
mov esi, eax
mov eax, dword [ebp - 0xc]
mov al, byte [eax]
cmp al, 0x5f
je 0x4aebcc
cmp al, 0x79
jne 0x4aebe6
lea eax, [ebp - 0x68]
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebx + 8]
call fcn.00404a44
mov edx, dword [ebp - 0x68]
mov eax, esi
call fcn.00497944
jmp 0x4aebfe
lea eax, [ebp - 0x6c]
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebx + 8]
call fcn.00404a44
mov edx, dword [ebp - 0x6c]
mov eax, esi
call fcn.00497cf8
mov ecx, esi
mov edx, dword [ebp - 0xc]
mov eax, dword [ebx + 0xc]
mov esi, dword [eax]
call dword [esi + 0x3c]
inc dword [ebp - 8]
dec dword [ebp - 0x14]
jne 0x4aeb7c
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4aec5b
lea eax, [ebp - 0x6c]
mov edx, 8
call fcn.0040474c
lea eax, [ebp - 0x40]
mov edx, 3
call fcn.0040474c
lea eax, [ebp - 0x10]
mov edx, 2
call fcn.0040474c
lea eax, [ebp - 4]
call fcn.00404728
ret