Home
Tutorials
Code Snippets
Code Samples
Downloads
Links

The Blog
Our Projects
About
Contact

::Add RageStorm to Favorites!::

The Blog | Our Projects | Guest Book | About | Contact

 
Code Snippet - Kondor Trainer
Author:Arkon
Category:Win32API
File Size:~ 1.87 KB
Uploaded at:27-Nov-02 02:58:44 pm
Description:
  This is a smiple trainer for our game Kondor, check it out! It shows how to write/read from proccess's memory.
  
// Alrighta, this will give you 99 lives in our game, Kondor1!
// This is a very lame "hack", but you can learn how to use Read/WriteProccessMemory etc...
// Wanna take a real look? Download Kondor1 and check this out, http://qsoft.ragestorm.com/projects/kondor/kondor.zip
#include <windows.h>
#include <stdio.h>

unsigned int LIVES = 99, CurrentLives = 0;
#define LIVES_ADDR 0x83DE2DFC

HWND HKondorWnd = NULL;
DWORD pID = 0;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
 char GameName[120];
 
 strcpy(GameName, "KONDOR");
 GetConsoleTitle(GameName, sizeof(GameName)); // Yeah Kondor1 is under DOS...
 HKondorWnd = FindWindow("tty", GameName);
 if (!HKondorWnd)
 {
  MessageBox(NULL, "Kondor is not found!", "Kondor Trainer by QSoft", 0);
  return(0);
 }

 // Get Kondor1's process ID
 GetWindowThreadProcessId(HKondorWnd, &pID);

 // Open the process for read/write operation
 HANDLE pHandle = OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_READ | PROCESS_VM_OPERATION, false, pID);
 if (!pHandle)
 {
  MessageBox(NULL, "Can't open process!", "Kondor Trainer by QSoft", 0);
  return(0);
 }
 
 // Get current number of lives
 if (!ReadProcessMemory(pHandle, (void *)LIVES_ADDR, (void *)&CurrentLives, 2, 0))
 {
  MessageBox(NULL, "Can't read from process!", "Kondor Trainer by QSoft", 0);
  CloseHandle(pHandle);
  return(0);
 }

 char tmp[256];
 sprintf(tmp, "You have %d lives!", CurrentLives);
 MessageBox(NULL, tmp, "Kondor Trainer by QSoft", 0);

 // Put new value of lives
 if (!WriteProcessMemory(pHandle, (void *)LIVES_ADDR, (void *)&LIVES, 2, 0))
 {
  MessageBox(NULL, "Can't write to process!", "Kondor Trainer by QSoft", 0);
  CloseHandle(pHandle);
  return(0);
 }
 
 // Clean up
 CloseHandle(pHandle);
 MessageBox(NULL, "Ahanka Ahanka Baby!", "Kondor Trainer by QSoft", 0);
 
 return(1);
}
=0){ mysqli_data_seek($res,$row); $resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res); if (isset($resrow[$col])){ return $resrow[$col]; } } return false; } function ViewComments($pt, $pid, $topic, $conn) { $res = mysqli_query($conn, "SELECT ThreadID FROM CommentThreads WHERE ParentType='$pt' AND ParentID='$pid'") or die("type+id not found"); if (mysqli_num_rows($res) == 0) { echo "\r\n"; // no comments for this thread, just let the user enter one. echo ""; echo ""; echo "
User Contributed Comments(None)
"; displaySubmissionForm($pt, $pid, "", "", "", $topic); echo "
"; return; } $threadid = mysqli_result($res, 0); $res = mysqli_query($conn, "SELECT * FROM Comments WHERE ThreadID='$threadid' ORDER BY Date ASC") or die("no entries"); $colsel = 0; $index = 0; $bgcolors = Array(0 => "#5d88bb", 1 => "#6699dd"); $comments_count = mysqli_num_rows($res); echo ""; if ($comments_count != 0) { echo ""; echo ""; } //comments exist end if echo "
User Contributed Comments(" .$comments_count .")
\r\n"; while($comment = mysqli_fetch_array($res)) { $index = $index + 1; // Point to last inserted comment... if ($index == $comments_count) echo "\r\n"; $submitter = $comment[Name]; // Add email if exists if (strlen($comment[EMail])) { $submitter = "$submitter"; } echo ""; $colsel = ($colsel + 1) & 1; } echo "
 [" .strval($index) ."] " .$submitter ." | " .$comment[Date] ."

" .$comment[Comment] ."
"; displaySubmissionForm($pt, $pid, "", "", "", $topic); echo "
"; } return; function displaySubmissionForm($pt, $pid, $comment, $name, $email, $topic) { //if (strlen($comment) == 0) $comment = ""; if (strlen($name) != 0) $name = "value=\"" .$name ."\""; if (strlen($email) != 0) $email = "value=\"" .$email ."\""; print << NOTE:
Comments that will hurt anyone in any way will be deleted.
Don't ask for features, advertise or curse.
If you want to leave a message to the author use the contacts,
if you have any question in relation to your comments please use the forum.
Comments which violate any of these requests will be deleted without further
notice. Use the comment system decently.

Post your comment:
Name:
email:
Comment:
END; } ?>