Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


help in using pointers in delphi
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Krähne
Expert Cheater
Reputation: 0

Joined: 06 Jun 2010
Posts: 108
Location: Inside of my Kernel

PostPosted: Sun Mar 27, 2011 11:01 am    Post subject: Reply with quote

elshabory wrote:
thanks but the link did not work
gives :
"Sorry, the file you requested is not available."
"The file has been deleted by the uploader. sendspace is not able to help you in this matter"


Just try again... i have changed the link.

_________________
Excuse me if you don't understand what I just said, but "english" isn't my native language.


Last edited by Krähne on Sun Mar 27, 2011 10:24 pm; edited 2 times in total
Back to top
View user's profile Send private message MSN Messenger
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Sun Mar 27, 2011 12:07 pm    Post subject: Reply with quote

DaasCook wrote:
Remember: The module must have been loaded by the calling process.

So, as him are getting the module of another process, will doesn't work.

I'm developing another way for get the module base, take a while... Rolling Eyes

Whoops, I was thinking that I was passing the process handle in, as there are many API with an "Ex" suffix that are for interprocess communication. Use EnumProcessModules or CreateToolhelp32Snapshot.


Last edited by Innovation on Sat Apr 23, 2011 10:51 am; edited 1 time in total
Back to top
View user's profile Send private message
elshabory
Newbie cheater
Reputation: 0

Joined: 02 Mar 2011
Posts: 20

PostPosted: Sat Apr 23, 2011 3:32 am    Post subject: Reply with quote

mr DaasCook
thanks for your source
it was workink fine
after updating my av
it seems to be a virus problem
can you fix your project source for me ??
i will be so glade
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Sat Apr 23, 2011 10:52 am    Post subject: Reply with quote

elshabory wrote:
mr DaasCook
thanks for your source
it was workink fine
after updating my av
it seems to be a virus problem
can you fix your project source for me ??
i will be so glade

Either disable your anti-virus or add an exception.


Last edited by Innovation on Thu Apr 19, 2012 4:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
elshabory
Newbie cheater
Reputation: 0

Joined: 02 Mar 2011
Posts: 20

PostPosted: Fri Apr 29, 2011 8:55 am    Post subject: Reply with quote

Innovation wrote:
elshabory wrote:
thanks for replay



Code:
var
 WindowHandle: HWND;
 ProcessIdentifier: DWORD;
 ProcessHandle: THandle;
 ModuleHandle: HMODULE;
 MemoryBuffer: DWORD;
 NumberOfBytesRead: Integer;
begin
 WindowHandle := FindWindow(nil, 'Window Name');
 ProcessIdentifier := GetWindowThreadProcessId(WindowHandle, @ProcessIdentifier);
 ProcessHandle := OpenProcess(PROCESS_ALL_ACCESS, false, ProcessIdentifier);
 GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, 'test.exe', @ModuleHandle);
 ReadProcessMemory(ProcessHandle, Ptr(ModuleHandle + $2E7AC), @MemoryBuffer, SizeOf(MemoryBuffer), NumberOfBytesRead);
 ReadProcessMemory(ProcessHandle, Ptr(MemoryBuffer + $7C), @MemoryBuffer, SizeOf(MemoryBuffer), NumberOfBytesRead);
 ReadProcessMemory(ProcessHandle, Ptr(MemoryBuffer + $21C), @MemoryBuffer, SizeOf(MemoryBuffer), NumberOfBytesRead);
 ReadProcessMemory(ProcessHandle, Ptr(MemoryBuffer + $8), @MemoryBuffer, SizeOf(MemoryBuffer), NumberOfBytesRead);
 // Do what you want with the value held by MemoryBuffer here...
 CloseHandle(ProcessHandle);
end;


can you please fix this code ??
Back to top
View user's profile Send private message
Krähne
Expert Cheater
Reputation: 0

Joined: 06 Jun 2010
Posts: 108
Location: Inside of my Kernel

PostPosted: Sat Apr 30, 2011 3:09 am    Post subject: Reply with quote

elshabory wrote:
Innovation wrote:
elshabory wrote:
thanks for replay



Code:
var
 WindowHandle: HWND;
 ProcessIdentifier: DWORD;
 ProcessHandle: THandle;
 ModuleHandle: HMODULE;
 MemoryBuffer: DWORD;
 NumberOfBytesRead: Integer;
begin
 WindowHandle := FindWindow(nil, 'Window Name');
 ProcessIdentifier := GetWindowThreadProcessId(WindowHandle, @ProcessIdentifier);
 ProcessHandle := OpenProcess(PROCESS_ALL_ACCESS, false, ProcessIdentifier);
 GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, 'test.exe', @ModuleHandle);
 ReadProcessMemory(ProcessHandle, Ptr(ModuleHandle + $2E7AC), @MemoryBuffer, SizeOf(MemoryBuffer), NumberOfBytesRead);
 ReadProcessMemory(ProcessHandle, Ptr(MemoryBuffer + $7C), @MemoryBuffer, SizeOf(MemoryBuffer), NumberOfBytesRead);
 ReadProcessMemory(ProcessHandle, Ptr(MemoryBuffer + $21C), @MemoryBuffer, SizeOf(MemoryBuffer), NumberOfBytesRead);
 ReadProcessMemory(ProcessHandle, Ptr(MemoryBuffer + $8), @MemoryBuffer, SizeOf(MemoryBuffer), NumberOfBytesRead);
 // Do what you want with the value held by MemoryBuffer here...
 CloseHandle(ProcessHandle);
end;


can you please fix this code ??


Have you read the answers? Rolling Eyes

_________________
Excuse me if you don't understand what I just said, but "english" isn't my native language.
Back to top
View user's profile Send private message MSN Messenger
elshabory
Newbie cheater
Reputation: 0

Joined: 02 Mar 2011
Posts: 20

PostPosted: Sun May 01, 2011 8:27 pm    Post subject: Reply with quote

mr DaasCook
i have read the answers
i am full new in delphi
i just wont a pointer trainer template
so forgive me
and please fix this code for me
Back to top
View user's profile Send private message
Krähne
Expert Cheater
Reputation: 0

Joined: 06 Jun 2010
Posts: 108
Location: Inside of my Kernel

PostPosted: Sun May 01, 2011 11:58 pm    Post subject: Reply with quote

elshabory wrote:
mr DaasCook
i have read the answers
i am full new in delphi
i just wont a pointer trainer template
so forgive me
and please fix this code for me


I'm really sorry dude. but I can not give the job done, no more than what I've done.

Don't run, if you can't walk.

_________________
Excuse me if you don't understand what I just said, but "english" isn't my native language.
Back to top
View user's profile Send private message MSN Messenger
ej52
Cheater
Reputation: 0

Joined: 29 Mar 2011
Posts: 39
Location: Mother City

PostPosted: Mon May 02, 2011 12:15 am    Post subject: Reply with quote

DaasCook wrote:

Don't run, if you can't walk.


Agreed ... there are plenty of tuts all over the web on alot of the questions being asked here on CEF.

Sure it would be great if someone fixes your code 4 you, but are you really learning that way?
Take the advice ppl have given you and figure it out yourself, thts the only way you really learn.

_________________
Hitler dNt HiDe WaT mOtHa NaTurE pRoViDe ... Razz
Back to top
View user's profile Send private message
elshabory
Newbie cheater
Reputation: 0

Joined: 02 Mar 2011
Posts: 20

PostPosted: Mon May 02, 2011 11:43 am    Post subject: Reply with quote

ej52 wrote:
DaasCook wrote:

Don't run, if you can't walk.


Agreed ... there are plenty of tuts all over the web on alot of the questions being asked here on CEF.

Sure it would be great if someone fixes your code 4 you, but are you really learning that way?
Take the advice ppl have given you and figure it out yourself, thts the only way you really learn.


ok
i am a trainer programmer
not delphi coder
so i want the template
i dont wont go far in delphi
only the template
and the example i give is not belong to any game
just example
i hope help !!!
Back to top
View user's profile Send private message
Krähne
Expert Cheater
Reputation: 0

Joined: 06 Jun 2010
Posts: 108
Location: Inside of my Kernel

PostPosted: Tue May 03, 2011 12:35 am    Post subject: Reply with quote

@ej52: Exactly... Wink

@elshabory: if you has zero answers after 3 days, i will show you the complete example of memory editions for you needs, nothing advanced, hope someone can help you before i do.

And... if you really want learn by yourself, google can help alot.

_________________
Excuse me if you don't understand what I just said, but "english" isn't my native language.
Back to top
View user's profile Send private message MSN Messenger
elshabory
Newbie cheater
Reputation: 0

Joined: 02 Mar 2011
Posts: 20

PostPosted: Tue May 03, 2011 1:15 pm    Post subject: Reply with quote

DaasCook wrote:
@ej52: Exactly... Wink

@elshabory: if you has zero answers after 3 days, i will show you the complete example of memory editions for you needs, nothing advanced, hope someone can help you before i do.

And... if you really want learn by yourself, google can help alot.



ok mr DaasCook
i am waiting
i hope you fine
and nothing bad happen to you

i see your project
i get confuset
all i wont is one button with the code
and any thing needed to make this button poke a multilevel pointer
i search google
canot find complate mlpointer trainer source
so i am wating
el shabory
Back to top
View user's profile Send private message
Krähne
Expert Cheater
Reputation: 0

Joined: 06 Jun 2010
Posts: 108
Location: Inside of my Kernel

PostPosted: Thu May 12, 2011 11:48 am    Post subject: Reply with quote

elshabory wrote:
DaasCook wrote:
@ej52: Exactly... Wink

@elshabory: if you has zero answers after 3 days, i will show you the complete example of memory editions for you needs, nothing advanced, hope someone can help you before i do.

And... if you really want learn by yourself, google can help alot.



ok mr DaasCook
i am waiting
i hope you fine
and nothing bad happen to you

i see your project
i get confuset
all i wont is one button with the code
and any thing needed to make this button poke a multilevel pointer
i search google
canot find complate mlpointer trainer source
so i am wating
el shabory


After careful thought, i decided don't create the example, because you will not going to understand it, so... i will not waste my time.

I prefered give you the job done, hope you understand, Greetings!.

Code:
PsAPI; //Add this to "uses"

function GetModuleBaseAddress(ProcessID: Cardinal; MName: String): Pointer;
var
  Modules         : Array of HMODULE;
  cbNeeded, i     : Cardinal;
  ModuleInfo      : TModuleInfo;
  ModuleName      : Array[0..MAX_PATH] of Char;
  PHandle         : THandle;
begin
  Result := nil;
  SetLength(Modules, 1024);
  PHandle := OpenProcess(PROCESS_QUERY_INFORMATION + PROCESS_VM_READ, False, ProcessID);
  if (PHandle <> 0) then
  begin
    EnumProcessModules(PHandle, @Modules[0], 1024 * SizeOf(HMODULE), cbNeeded); //Getting the enumeration of modules
    SetLength(Modules, cbNeeded div SizeOf(HMODULE)); //Setting the number of modules
    for i := 0 to Length(Modules) - 1 do //Start the bucle
    begin
      GetModuleBaseName(PHandle, Modules[i], ModuleName, SizeOf(ModuleName)); //Getting the name of module
      if AnsiCompareText(MName, ModuleName) = 0 then //If the module name match with the name of module we are looking for...
      begin
        GetModuleInformation(PHandle, Modules[i], @ModuleInfo, SizeOf(ModuleInfo)); //Get the information of module
        Result := ModuleInfo.lpBaseOfDll; //Return the information we want (The image base address)
        CloseHandle(PHandle);
        Exit;
      end;
    end;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  WHandle : HWND;
  PHandle: THandle;
  Address, X, Buffer: DWORD;
  NewValue: Cardinal;
  ProcessID : Cardinal;
begin
  ProcessID := 0;
  NewValue := $09;
  WHandle := FindWindow(nil, 'test');
  GetWindowThreadProcessId(WHandle, @ProcessID);
  Address := Integer(GetModuleBaseAddress(ProcessID, 'test.exe')) + Integer($0002E7AC);
  PHandle := OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID);
  ReadProcessMemory(PHandle, Ptr(Address + $7C), Addr(Buffer), 4, X);
  ReadProcessMemory(PHandle, Ptr(Buffer + $21C), Addr(Buffer), 4, X);
  ReadProcessMemory(PHandle, Ptr(Buffer + $8), Addr(Buffer), 4, X);
  WriteProcessMemory(PHandle, Ptr(Buffer), @NewValue, 1, X);
  CloseHandle(PHandle);
end;

_________________
Excuse me if you don't understand what I just said, but "english" isn't my native language.
Back to top
View user's profile Send private message MSN Messenger
meam
How do I cheat?
Reputation: 0

Joined: 20 Jun 2022
Posts: 1

PostPosted: Mon Jun 20, 2022 1:03 am    Post subject: Reply with quote

Its a nice code, i have been using it for base address for few of my programs.
But i noticed it does not work for old fighter plane game F-22 Raptor.

What could be the issue ?

For that reason I had to make this trainer with CE (not public) where i can add ammo for weapons
and move plane in all XYZ directions, but i had plan to make a Teleport function to save / load plane position.
This is where i didnt succeeded.
I have to see what CE script can do, if it can read / write text file then i dont need to create my own program.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites