Function at 0x40bd48
Capabilities:
Get memory capacity

Disassembly:
sub esp, 0x54
xor ecx, ecx
mov edx, dword [esp + 0x64]
push ebx
add edx, 0xfff
shr edx, 0xc
push ebp
mov ebx, dword [esp + 0x64]
push esi
push edi
mov dword [esp + 0x60], eax
lea eax, [esp + 0x60]
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], edx
call fcn.0040bf8c
xor al, 1
je 0x40be4c
mov ecx, 8
xor eax, eax
lea edi, [esp + 0x34]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x34]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalMemoryStatus]
mov eax, dword [esp + 0x4c]
mov edx, 0xcccccccd
mul edx
shr edx, 4
cmp dword [esp + 0x50], edx
jb 0x40be03
mov edx, dword [esp + 0x60]
cmp dword [edx + 0x24], 0
jne 0x40bdd8
mov esi, dword [edx + 0x64]
mov dword [esp + 0x14], esi
xor edi, edi
mov dword [esp + 0x18], edi
fild qword [esp + 0x14]
fcomp dword [edx + 0x5c]
fnstsw ax
sahf
jae 0x40be03
jp 0x40be03
lea eax, [esp + 0x60]
call fcn.0040bff4
xor al, 1
je 0x40be1f
mov edx, dword [esp + 0x60]
mov dword [esp + 0x54], edx
push 0
mov eax, dword [esp + 0x58]
call fcn.0040cf58
mov eax, dword [esp + 0x60]
call fcn.0040b8ac
jmp 0x40be1f
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x58], ecx
push 0
mov eax, dword [esp + 0x5c]
call fcn.0040cf58
mov eax, dword [esp + 0x60]
call fcn.0040b8ac
cmp dword [esp + 0x24], 0
jne 0x40be4c
lea eax, [esp + 0x60]
call fcn.0040bf8c
xor al, 1
je 0x40be4c
lea eax, [esp + 0x60]
call fcn.0040bff4
xor al, 1
je 0x40be4c
pop edi
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 0x54
ret 0x10
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx + 0x48]
mov esi, dword [esp + 0x28]
mov byte [edx + esi], 8
mov edi, dword [esp + 0x2c]
mov eax, 1
cmp edi, eax
jbe 0x40be86
lea ecx, [edi - 1]
push ecx
push 9
mov edx, dword [esp + 0x2c]
mov esi, dword [edx + 0x48]
mov edi, dword [esp + 0x30]
lea ecx, [edi + esi + 1]
push ecx
call fcn.00411238
add esp, 0xc
push dword [esp + 0x28]
mov eax, dword [esp + 0x28]
call fcn.0040d710
mov esi, dword [esp + 0x60]
mov edx, dword [esp + 0x2c]
add dword [esi + 0x64], edx
mov ecx, dword [esp + 0x24]
mov edi, dword [esp + 0x2c]
sub dword [ecx + 0x44], edi
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x24]
shl eax, 0xc
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x70]
add eax, dword [edx]
shl esi, 0xc
test ebx, ebx
mov dword [esp + 0x5c], eax
mov dword [edi], esi
je 0x40bf7e
mov esi, dword [esp + 0x28]
mov ecx, dword [esp + 0x28]
mov ebp, 1
and ecx, 0x1f
shr esi, 5
shl ebp, cl
test ebx, 0x20
mov edi, dword [esp + 0x24]
je 0x40bf12
mov edx, dword [esp + 0x24]
cmp dword [edx + 0x24], 0
jne 0x40bf0a
lea ecx, [edx + 0x20]
push dword [edx + 0xc]
mov eax, ecx
call fcn.0040ec58
mov ecx, dword [edi + 0x20]
mov edx, ebp
or dword [ecx + esi*4], edx
test ebx, 1
je 0x40bf35
cmp dword [edi + 0x1c], 0
jne 0x40bf2d
lea edx, [edi + 0x18]
push dword [edi + 0xc]
mov eax, edx
call fcn.0040ec58
mov edx, dword [edi + 0x18]
mov ecx, ebp
or dword [edx + esi*4], ecx
test ebx, 2
je 0x40bf45
mov edx, dword [edi + 0x28]
mov ecx, ebp
or dword [edx + esi*4], ecx
test ebx, 8
je 0x40bf55
mov edx, dword [edi + 0x30]
mov ecx, ebp
or dword [edx + esi*4], ecx
cmp byte [edi + 0x4c], 0
je 0x40bf7e
test ebx, 0x10
je 0x40bf7e
cmp dword [edi + 0x3c], 0
jne 0x40bf76
lea ecx, [edi + 0x38]
push dword [edi + 0xc]
mov eax, ecx
call fcn.0040ec58
mov ecx, dword [edi + 0x38]
mov edx, ebp
or dword [ecx + esi*4], edx
mov eax, dword [esp + 0x5c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
ret 0x10