+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member H1N1's Avatar
    Join Date
    Jun 2010
    Posts
    76

    ReadProcessMemory Byte Matching = Failing!!!

    Hey everyone,

    I have been up all night working on something and now im stuck, for like the thousands time lol

    I am trying to use ReadProcessMemory in order to check This address : $00401110

    For these bytes : 0x55, 0x89, 0xe5, 0x83, 0xec, 0x14, 0x6a, 0x02, 0xff, 0x15, 0x38, 0x82, 0xbf, 0x00, 0xe8, 0xfd, 0xfe, 0xff, 0xff, 0x8d, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x8d, 0xbc, 0x27, 0x00, 0x00, 0x00, 0x00


    Now, i double checked this on Cheat Engine and heres what i have :



    Here is what i have put together (Im pretty noobish so don't bite my head off) :

    FUNCTION:
    Code:
    program Project2;
    
    {$APPTYPE CONSOLE}
    
    uses
      SysUtils, windows;
    
    var
      Pid, Pidhandle, Data, NewValue : integer;
      Address, Written: Cardinal;
    
    begin
      try
        { TODO -oUser -cConsole Main : Insert code here }
    
        Pid := 4804;          // The Process ID Of The Process Being Read
        Address := $00401110; // The Address Where To Start Reading From
        Data := 4;            // Number Of Bytes To Read wtfax?
    
        Pidhandle := OpenProcess(PROCESS_ALL_ACCESS,False,Pid);
    
        ReadProcessMemory(Pidhandle, ptr(Address), @NewValue, Data, Written);
    
        writeln(NewValue);
    
        closehandle(Pidhandle);
    
        readln;
    
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
    end.
    RESULT : 85....



    Could anyone PLEASE give me a helping hand so that i can actually retrieve that exact chunck of bytes? i would really appreciate it as i have wasted 2 days on this now.


    Thank you all so much,

    Kind Regards
    Last edited by H1N1; 23-01-2012 at 16:48.

  2. #2
    Member H1N1's Avatar
    Join Date
    Jun 2010
    Posts
    76
    Alright, So far, cracksmans suggestion : NewValue : array [0..3] of byte

    And a little brain power from me, the new updated source is :

    Code:
    program FUCK;
    
    {$APPTYPE CONSOLE}
    
    uses
      SysUtils, windows;
    
    
    function BTOH(const bin: array of byte): string;
    const HexSymbols = '0123456789ABCDEF';
    var i: integer;
    begin
      SetLength(Result, 2*Length(bin));
      for i :=  0 to Length(bin)-4 do begin
        Result[1 + 4*i + 0] := HexSymbols[1 + bin[i] shr 4];
        Result[1 + 4*i + 1] := HexSymbols[1 + bin[i] and $1F];
      end;
    end;
    
    
    function BTOS(const bin: array of byte): AnsiString;
    var i: integer;
    begin
      SetLength(Result, Length(bin));
      for i := 0 to Length(bin)-1 do
        Result[1+i] := AnsiChar(bin[i]);
    end;
    
    var
      Pid, Pidhandle, Data : integer;
      Address, Written: Cardinal;
      NewValue : array [0..3] of byte;
    
    begin
      try
        { TODO -oUser -cConsole Main : Insert code here }
    
        Pid := 4804;          // The Process ID Of The Process Being Read
        Address := $00401110; // The Address Where To Start Reading From
        Data := 1;            // Number Of Bytes To Read wtfax?
    
        Pidhandle := OpenProcess(PROCESS_ALL_ACCESS,False,Pid);
    
        ReadProcessMemory(Pidhandle, ptr(Address), @NewValue, SizeOf(NewValue), Written);
    
        writeln(BTOH(NewValue));
    
        closehandle(Pidhandle);
    
        readln;
    
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
    end.
    Its now returning 55000000, what now? >_<
    Last edited by H1N1; 23-01-2012 at 18:07.

  3. #3
    Senior Member counterstrikewi's Avatar
    Join Date
    Apr 2009
    Location
    \??\.\PhysicalDrive0:\+00h
    Posts
    1,982
    set data = 14
    declare newvalue as [0..13]
    DelphiBasics - Ultimate Delphi Resource for Beginners
    www.delphibasics.info

  4. #4
    Senior Member cracksman's Avatar
    Join Date
    Dec 2006
    Location
    behind your little sister
    Posts
    1,611
    we already fixed it btw.
    I Retired. stop asking me questions. you can find me on msn or ic0de.

  5. #5
    Senior Member zorgion's Avatar
    Join Date
    May 2009
    Location
    Hueco Mundo
    Posts
    627
    lol.
    http://home.no/zorgion/bsod.jpg

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Byte Conversion
    By t3rmin4t0r in forum Visual Basic Help
    Replies: 3
    Last Post: 17-11-2010, 16:19
  2. Replies: 5
    Last Post: 18-05-2010, 14:53
  3. ReadProcessMemory Problem
    By Mc_Rapier in forum General Programming Help
    Replies: 24
    Last Post: 26-07-2009, 14:31
  4. [vb] Byte Array
    By steve10120 in forum General Programming Help
    Replies: 12
    Last Post: 10-09-2008, 01:33
  5. array of byte
    By LEE_ROY in forum Delphi Help
    Replies: 5
    Last Post: 14-06-2007, 17:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.