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 


Coding Format - Creating Game Hacks Visual Studio C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
DEVCORE
Cheater
Reputation: 0

Joined: 11 Aug 2018
Posts: 28

PostPosted: Thu Sep 13, 2018 11:46 pm    Post subject: Coding Format - Creating Game Hacks Visual Studio C++ Reply with quote

Hey again,

I am very new to coding and game hacking so please try to help me with not too much complexity. I have some questions below:

1) When coding my game hacks I used to just code everything in one code, all in the main.cpp - Where I have learnt this is not good to do when your code becomes longer. I have researched on header files but don't know if I should make everything all in seperate header files?

2) Lets say I want to make a variable for game address and offsets, should these be in its own header file?

3) Also what should I do if I want to split these up into their own groups and sections? Like all the codes for Triggerbot, all the codes for wall hacks, all the codes for bunny hop etc. How should I split these up instead of writing it all in main?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8515
Location: 127.0.0.1

PostPosted: Fri Sep 14, 2018 10:01 am    Post subject: Reply with quote

1. The end result is ultimately up to you and just preference. Breaking things into separate code is not a requirement or anything, and is nothing more than personal preference in what you prefer to do with your code.

It helps make things cleaner and easier to read for others if you plan to release and share the code.

2. It can be easier to manage the data if you place them inside of a header file as macro defines, such as:
Code:

#define GAMEBASE_MODULE_NAME    "Game.dll"
#define GAMEBASE_OFFSET         0x12345
#define PLAYER_HEALTH_OFFSET    0x123
#define PLAYER_MANA_OFFSET      0x321


But again, not a requirement, just preference and up to you. You can do these in the main file just the same and it will work fine.

3. You may want to look into using classes if you wish to break things apart more in-depth and using multiple files. You can then use things in separated files such as:
TriggerBot.h/TriggerBot.cpp
WallHack.h/WallHack.cpp

and so on, where each thing is its own class.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
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