Vampire The Masquerade: Bloodlines

Disassembly

* Referenced by a CALL at Address:
|:200FA817   
|
:200FA470 83EC24                  sub esp, 00000024
:200FA473 8D442404                lea eax, dword ptr [esp+04]
:200FA477 50                      push eax
:200FA478 C744240820000000        mov [esp+08], 00000020

* Reference To: KERNEL32.GlobalMemoryStatus, Ord:018Dh
                                  |
:200FA480 FF15F8301720            Call dword ptr [201730F8]
:200FA486 8B44240C                mov eax, dword ptr [esp+0C]
:200FA48A 3D0000F000              cmp eax, 00F00000
:200FA48F A3C82BB420              mov dword ptr [20B42BC8], eax
:200FA494 7D12                    jge 200FA4A8
:200FA496 50                      push eax

* Possible StringData Ref from Data Obj ->"Available memory less than 15MB!!! "
                                        ->"%i"
                                  |
:200FA497 6898CC1A20              push 201ACC98
:200FA49C E80FFEFFFF              call 200FA2B0
:200FA4A1 8B442414                mov eax, dword ptr [esp+14]
:200FA4A5 83C408                  add esp, 00000008

What does this mean?

* Reference To: KERNEL32.GlobalMemoryStatus, Ord:018Dh
                                  |
:200FA480 FF15F8301720            Call dword ptr [201730F8]

First the code calls the Windows API function GlobalMemoryStatus().

:200FA486 8B44240C                mov eax, dword ptr [esp+0C]
:200FA48A 3D0000F000              cmp eax, 00F00000
:200FA48F A3C82BB420              mov dword ptr [20B42BC8], eax

Next it copies some part of the stack to the EAX register, compares it to 15728640 and files the actual value away somewhere.

:200FA494 7D12                    jge 200FA4A8

Finally the code looks at the result of the comparison made earlier, and jumps to a specific address in the case that EAX was at least 16Mb. Otherwise it drops through to the next part...

* Possible StringData Ref from Data Obj ->"Available memory less than 15MB!!! "
                                        ->"%i"
                                  |
:200FA497 6898CC1A20              push 201ACC98
:200FA49C E80FFEFFFF              call 200FA2B0

...which actually shows the error message.

GlobalMemoryStatus() sounds interesting, doesn't it?


Jump to a section

intro | part 1: Isolating the problem | part 2: Disassembly | part 3: GlobalMemoryStatus() | part 4: The solution | part 5: Patches | part 6: Low res textures