Advertisement
Guest User

containerFunction

a guest
Sep 27th, 2013
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.91 KB | None | 0 0
  1. function getContaingerName(contID : integer) : string;        // purse iD = 16087
  2. var
  3.   ptr, next , cid, container, offsetName: integer;
  4.   found , lastNode : boolean;
  5.   name : string;
  6. begin
  7.   ptr := func.MemReadInteger($9EA13C);
  8.   ptr := func.MemReadInteger(ptr + $08);
  9.   next := func.MemReadInteger(ptr + $04);
  10.   found := false;
  11.   lastNode := false;
  12.  
  13.   while (not lastNode and not found) do
  14.   begin
  15.     cid := func.MemReadInteger(next + $0C);
  16.     if (contID < cid) then
  17.       next := func.MemReadInteger(next + $00)
  18.     else if (contID > cid) then
  19.       next := func.MemReadInteger(next + $08)
  20.     else
  21.       found := true;
  22.  
  23.     if (next = ptr) then
  24.     lastNode := true;
  25.   end;
  26.  
  27.   if (found) then
  28.   begin
  29.     container := func.MemReadInteger(next + $10);
  30.     offsetName := $20;
  31.     name := func.MemReadString(container + offsetName);
  32.     result := name;
  33.   end
  34.   else
  35.     result := 'Closed';
  36. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement