Well I was looking around in Cheat engine lately and I found some crap. I figured I haven't done anything with them yet, and probably won't, for a while, thus, you might make use of some of these addys.
I was toying with the idea of making those booleans accessible via scripts in Open Sauce :iamafag:
The following I was planning on releasing in Open Sauce (and still am) however I need to find the addy in dedi still.
This was an Idea I had for modifying the jump height/velocity of the player. It turns out that Cheat_Super_Jump multiplies the default velocity (in stock maps, 1.7 mps) by 4.
I forget how jump velocity works in tandem with jump height in the game but hey.
Code:
SJ Bool-
00815CA4
SJ Modifier
00612388
-set to 4 by default. Fun to use on Hugeass or Coldsnap.
Timberland as well. :P
Another note, that Super jump MUST be enabled in order for this method of modifying jump height to work.
I'm going to use this as a log to the interesting values that I find in Halo.
Currently on my list to be found are: Maximum Health, Max shields, and Grenades.
With those I expect to find the actual health, shields, and 'nades the player is holding. If you have ideas feel free to let meh know.
The only thing that needs to be enabled with OS is the console. OS can override the devmode check for runtime script commands (read: console commands). Also, all you need to have is a lookup function or the actual global index of cheat_super_jump and then just access the value definition using the HSExternalGlobals() function or w/e I had named it in the Script related code files (I think I defined it in the ScriptLibrary component source)
an object's heath/shields and a unit's grenades are already defined in the OS codebase
an object's heath/shields and a unit's grenades are already defined in the OS codebase
If that's so I think I'll want to be exposing those values so scripters may manipulate them, even though i'm not sure about how to do it 100%.
Yeah, FireScythe showed me the parts of Open Sauce I need to add my custom globals so expect my own build or something like that some time this month maybe.
unit_get_heath/unit_get_shield (just make 'set' versions)
however, player_add_equipment can set all three things (including weapons). also, these would need to be functions, not globals.
I don't suppose there's a unit_set_equipment that can be used on AI. One would be able to have an elite draw an energy sword when it's shield is low then.
I don't suppose there's a unit_set_equipment that can be used on AI. One would be able to have an elite draw an energy sword when it's shield is low then.
ai_actors, then iterate over each unit checking their shield.
also, there are already methods for setting the health/shield properties: unit(s)_set_maximum_vitality & unit(s)_set_current_vitality
This was posted on Halomaps yesterday. The program seems safe. I used it today and nothing bad happened.
jcap edit: If it comes up as a keylogger, it's probably the same false positive that several apps use to monitor your keyboard for button presses. It's necessary because otherwise pressing "page up" would not do anything. Even the original AllDev for CE by Paulus (right?) dropped what some apps considered a keylogger on your computer.
After that stint.... I will be grabbing a reference that skarma oh-so-encouragingly sent me, and taking a look at Halo when it loads Map Cache files. If anyone already has stuff on that subject, I'd appreciate it if you'd share.
That doesn't help anybody without any context whatsoever, you might as well not even post them. It looks like the player_datum struct in OS (the only one not in OS is "PLAYER_OFFSET_CTF"), but all of these offsets are 0x4 lower than they should be, why is that?
That doesn't help anybody without any context whatsoever, you might as well not even post them. It looks like the player_datum struct in OS (the only one not in OS is "PLAYER_OFFSET_CTF"), but all of these offsets are 0x4 lower than they should be, why is that?
I found some nice, easy-to-find addresses in sapien_dualcore and since I haven't updated the thread in a while I thought I'd share. I would have used OS_Sapienbeta but Sapienbeta doesn't play well with dual cores. :(
(floats)
camera speed is: @ 00A32EE8
X Value for camera position is: 00DB46DC
Y Value is: 00DB46E0
Z Value is: 00DB46E4
What I envision, for the xy and z values are to, say, put a bar on a value so the camera can't pass that point.
One of the things I would like to get is the object that is selected by the user, then get the rotation of an object, and increment it by, say, 5. E: Angle snapping, basically.
Ok two new addys, 00B179B0 00B179D0. one gets the physically selected objects index and the other goes to 0 when an object is selected. Both only change when selected from 3d view.
[...]The source code is freely available somewhere (I think I posted it on Halomods). I made a few classes for it in C++.
EDIT: Here are the classes. God my C++ skills sucked back in 2004. As CrashTECH pointed out, the locations are liable to change from version to version, but IIRC the locations I chose are never deleted and reallocated. You can be sure they are valid once you've found the correct offset. The offset has likely changed since I wrote this. You should use a memory searching tool (TSearch works very well) to find the initial offset, upon which all others are based.
Sorry for the length.
Player.h:
Code:
/*
Player.h
Contains a class that provides functions for reading in and retrieving player information
in Halo.
/*
#ifdef _DEBUG
#define CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#endif
//this is a class I have to detect memory leaks for me -- don't worry about it
*/
#define PC_GM_CLASS 0x0
#define PC_GM_SCORE 0x0//PC ingame is obviously not supported right now.
int my_itoa(const int number, char *data);//base can only be 10, and ASSUMES the data buffer supplied is big enough to hold the number
class Player
{
int player_score;
short player_deaths;
short player_assists;
short player_kills;
short player_betrayals;
short player_suicides;
char player_team;
char player_ingame;
std::string player_name;
std::string player_ipadd;
std::string player_cdkey;
//end of player data
//start of class data
int SIZE;//offset between players
int ASSISTS;//offset of assists from kills
int DEATHS;//offset of deaths from kills (beginning of player info structure)
int SUICIDES;//offset of suicides from kills
int TKS;//offset of TKs for each player from kills
int NAMES;//offset of name from player's kills.
int TEAMS;//IMPORTANT: this is the offset of player teams from player 1 kills! this is an array of characters! ***NOT PART OF THE STRUCTURE***
int PLAYERIN;//IMPORTANT: this is the offset of player teams from player 1 score! this is an array of separate structures! ***NOT PART OF THE PLAYER INFO STRUCTURE**
int PLAYERSZ;//Size of the abovementioned structure
//start of individual class data
unsigned int player_class_location;
unsigned int player_score_location;
unsigned int player_number;
unsigned long process_PID;
HANDLE hProc;//the handle to the process
public:
Player();
Player(const unsigned long &PID, const unsigned int &type, const unsigned int &player_number);
~Player();
int Score();
short Deaths();
short Kills();
short Betrayals();
short Assists();
short Suicides();
char Team();
char In_game();
const char *Name();
int Refresh();
int Refresh_Score();
int Refresh_Kills();
int Refresh_Assists();
int Refresh_Deaths();
int Refresh_Suicides();
int Refresh_Betrayals();
int Refresh_Team();
int Refresh_In_Game();
int Refresh_Name();
//end of player info
//start of class info
void Set_PID(const unsigned long &PID);
void Set_Location(const unsigned long &class_location, const unsigned long &score_location, const unsigned long &ipadd_location);
void Set_Player_Number(const unsigned int &player_num);
void Set_Size(const unsigned long &size);
void Set_Type(const unsigned long &type);
bool Handle_Is_Null();
unsigned int Open_Halo();
};//our player class
hProc = OpenProcess(PROCESS_VM_READ, FALSE, process_PID);//attempt to open the process
if(hProc == NULL)
{
hProc = NULL;//assign a NULL value
}//we failed. Oh. Noes. We'll try again when refreshing
int Player::Refresh()
{
int result = 1;// we start with one so we can mutiply
char name[13];//temp buffer for name
ipaddr_union address;//for the IP address
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more then fail
}
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>((player_score_location) + ((player_number-1)*4) + 0 ), (void*)&player_score , 4, 0);//read scores
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>((player_class_location) + ((player_number-1)*SIZE) + 0 ), (void*)&player_kills , 2, 0);//read kills
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>((player_class_location) + ((player_number-1)*SIZE) + DEATHS ), (void*)&player_deaths , 2, 0);//read deaths
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>((player_class_location) + ((player_number-1)*SIZE) +SUICIDES), (void*)&player_suicides , 2, 0);//read suicides
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>((player_class_location) + ((player_number-1)*SIZE) + ASSISTS), (void*)&player_assists , 2, 0);//read assists
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>((player_class_location) + ((player_number-1)*SIZE) + TKS ), (void*)&player_betrayals, 2, 0);//read TKs
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>((player_score_location) + ((player_number-1)*PLAYERSZ)+ PLAYERIN), (void*)&player_ingame , 1, 0);//read ingame
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>((player_class_location) + ((player_number-1)*SIZE) + TEAMS ), (void*)&player_team , 1, 0);//read team
for(unsigned int name_index = 0; name_index < MAX_NAMELENGTH; name_index += 2)
{
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>((player_class_location) + ((player_number-1)*SIZE) + NAMES + name_index), (void*)&name[(name_index / 2)], 1, 0);//read name
}
name[12] = '\0';//nullify the name
player_name = name;//the name is what we just read
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more then fail
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more then fail
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more then fail
}//if hProc still is messed
int result = 1;
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more then fail
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more then fail
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more then fail
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more then fail
}//if hProc still is messed
int result = 1;
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>((player_class_location) + ((player_number-1)*SIZE) + TEAMS ), (void*)&player_team , 1, 0);//read team
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more then fail
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more then fail
}//if hProc still is messed
int result = 1;
char name[13];
for(unsigned int name_index = 0; name_index < MAX_NAMELENGTH; name_index += 2)
{
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>((player_class_location) + ((player_number-1)*SIZE) + NAMES + name_index), (void*)&name[(name_index / 2)], 1, 0);//read name
}
name[12] = '\0';//nullify the name
player_name = name;//the name is what we just read
return result;
}
void Player::Set_PID(const unsigned long &PID)
{
process_PID=PID;
}
void Player::Set_Location(const unsigned long &class_location, const unsigned long &score_location, const unsigned long &ipadd_location)
{
player_class_location = class_location;
player_score_location = score_location;
player_ipadd_location = ipadd_location;
}
void Player::Set_Player_Number(const unsigned int &player_num)
{
player_number = player_num;
}
void Player::Set_Size(const unsigned long &size)
{
SIZE = size;
}
unsigned int Player::Open_Halo()
{
hProc = OpenProcess(PROCESS_VM_READ, FALSE, process_PID);
return (hProc != NULL);//return 1 for success
}
int my_itoa(const int number, char *data)
{
std::string buf;
std::string buffer;
int num = std::abs(number);
const unsigned int numdigits = (log((float)num) / log(10.0f)) + 1;
unsigned int dig_buf;
for(int i = 1; i <= numdigits; ++i)
{
dig_buf = static_cast<int>(std::pow(10.0f, i-1));
const int CTF = 1;
const int SLAYER = 2;
const int ODDBALL = 3;
const int KOTH = 4;
const int RACE = 5;//gametypes
const char gametypes[5][15] = {"CTF","Slayer","Oddball","KOTH","Race"};//gametype strings
class Server
{
unsigned long server_PID;//the PID of the server
unsigned long server_isEnabled;//is it enabled? did the user check off this box?
unsigned long server_Number;//i.e. 1 for "Halo Console (1)", 2 for "Halo Console (2)"
unsigned long server_Type;//type of server, i.e. Halo PC DS, Halo CE game
unsigned long server_Gametype;//gametype on server
unsigned long server_gametype_loc;//location of gametype on server proc
HANDLE hProc;//handle to the process
HANDLE server_thread;//handle to the thread for this process
public:
Server();//default constructor
~Server();//destructor
std::vector<Player*> Players;//vector of POINTERS to Player objects
ConsoleLogger Console;//for logging the console data if it is a DS
const char *Gametype();//returns gametype string of current gametype on server
const unsigned long PID();
HANDLE Thread();//returns a handle to the current thread
const unsigned long isEnabled();
const unsigned long Number();
const unsigned long Type();//echoes the variables above
const int Refresh(void);//refresh all
const int Set_PID(const unsigned long PID);
const int Set_Thread(HANDLE hThread);
const int Set_Enabled(const unsigned long isEnabled);
const int Set_Number(const unsigned long Number);//sets the variables above
const int Set_Type(const unsigned int Type);//set type
const int Set_All(const unsigned long PID, HANDLE hThread, const unsigned long isEnabled, const unsigned long Number, const unsigned long Type);
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more, then fail
}//if hProc still is messed
for(unsigned int i = 0; i < MAX_PLAYERS; ++i)
{
if(Players[i]->Handle_Is_Null())//null handle
{
Players[i]->Open_Halo();//try to open the process
}
result *= Players[i]->Refresh();
}
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>(server_gametype_loc), (void*)&server_Gametype, 1, 0);//read gametype
return result;
}
const int Server::Set_PID(const unsigned long PID)
{
server_PID = PID;
for(unsigned int i=0; i < MAX_PLAYERS; ++i)
{
Players[i]->Set_PID(PID);
}
if(hProc == NULL)
{
MessageBox(0, "Couldn't open the Halo process for reading. \nIf you are sure Halo is running and you have access, send an email to Kybo Ren at:\nkyboren@gmail.com", "Warning", MB_OK | MB_ICONWARNING);
return 0;//0 is fail
}//we try once more, then fail
}//if hProc still is messed
int result = 1;
result *= ReadProcessMemory(hProc, reinterpret_cast<void*>(server_gametype_loc), (void*)&server_Gametype, 1, 0);//read gametype
return gametypes[server_Gametype];
}
No guarantees on anything, but it did work when I wrote it. [...] this could be a helpful reference. Good luck.
Damn, Kybo Ren, wonder what ever came of that guy?
On a lighter note, a single call to ReadProcessMemory would probably yield better results. 1) Less overhead and 2) You're reading from a separate process which may actually update (the game state in this case) before you do your next call. So you could very well retain old player information all the while you're getting new information from the multiple Read (or Write) calls. You'd want to treat the other program like a database.
E: Those field offsets will never change unless they want to break all prior game saves. Part of the reason why I never chose to introduce certain game-state upgrades in OS. It would have broken all prior game saves.