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 


[C++] Program to Hack Fast and Easy in your way [updated V3]
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
M.CORP
Grandmaster Cheater Supreme
Reputation: 28

Joined: 28 Oct 2009
Posts: 1010

PostPosted: Sun Jan 09, 2011 2:43 pm    Post subject: Reply with quote

NoMercy wrote:
Why are you coding everything in 1 big function?

I believe FindWindow() + GetWindowThread() is not a very good way, you should use create32toolsnapshot() +next etc. Google knows everything about those.

EDIT:
HWND hwnd;
hwnd = FindWindow()

why not?

HWND hwnd = FindWindow() , or does VC automatically fix this?

same as

i = i+ x
i += x, is just better?

I made that trainer months ago so i haven't really done much back then and that's why i only have 1 big function.
Although it's just 1 big function, all it does is just change the value of the address and just print messages.....

_________________
Shameless Self Advertising Very Happy!
Steam
Just lurking around...
Back to top
View user's profile Send private message
educofu
Expert Cheater
Reputation: 3

Joined: 21 Aug 2009
Posts: 171
Location: Brazil,MG,OP

PostPosted: Mon Jan 10, 2011 10:49 am    Post subject: This post has 1 review(s) Reply with quote

Slugsnack wrote:
how about double ?


double = 8 bytes long float

hack(address_d,first 4 bytes)
hack(address_d+4,"last 4 bytes" )

iPromise wrote:
What if my program had no reliable window name? What then?


can some1 help me with that?

Wiccaan wrote:
educofu wrote:
Wiccaan wrote:
There is no error checking if the window fails to open. None of the reading/write functions check if the handle is even set etc. and don't give any information upon failing.

Also avoid system() all together. If you need to pause the console, which you shouldn't anyway since its a console, use something like:

Code:
std::cin.sync();
std::cin.ignore();


Or

Code:
_getch();


actually it does check if the windows is sucessfully opened:
Code:
if(!hWindow || !hProcess)cout << "Error opening the process" << endl;


but it for sure ill be better if i changed the function to return or modify a variable according if it successfully attached to create the main loop.

thanks for the info on system("pause") ^^ going to change that


All you are doing is printing a message, the flow still continues as if the functions never failed.


updated.

--also
im creating a DotA bot with that^^ (like runnig from arrows,etc)

_________________
"I finally started thinking outside of the box, only to find myself in a larger box."
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Tue Jan 11, 2011 7:30 am    Post subject: Reply with quote

educofu wrote:
Slugsnack wrote:
how about double ?


double = 8 bytes long float

hack(address_d,first 4 bytes)
hack(address_d+4,"last 4 bytes" )

iPromise wrote:
What if my program had no reliable window name? What then?


can some1 help me with that?

Wiccaan wrote:
educofu wrote:
Wiccaan wrote:
There is no error checking if the window fails to open. None of the reading/write functions check if the handle is even set etc. and don't give any information upon failing.

Also avoid system() all together. If you need to pause the console, which you shouldn't anyway since its a console, use something like:

Code:
std::cin.sync();
std::cin.ignore();


Or

Code:
_getch();


actually it does check if the windows is sucessfully opened:
Code:
if(!hWindow || !hProcess)cout << "Error opening the process" << endl;


but it for sure ill be better if i changed the function to return or modify a variable according if it successfully attached to create the main loop.

thanks for the info on system("pause") ^^ going to change that


All you are doing is printing a message, the flow still continues as if the functions never failed.


updated.

--also
im creating a DotA bot with that^^ (like runnig from arrows,etc)

Let me make one thing clearer to you so you can understand what I was getting at. Consider this declaration:
char lpString[] = "lalalaasdlk;f;aklsdjf";

sizeof(lpString) will always evaluate to 4 or 8 depending whether you are on a 32 or 64 bit system. I'll let you ponder this one. Similarly, reading a double is impossible since you will always cast it to an int. Unfortunately this would not even return to us a double casted to an int. You instead read the first 4 bytes of the double and cast that to an int. The way in which doubles are represented in memory means that the int is unlikely to be anywhere near close in value.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Jan 11, 2011 7:57 am    Post subject: Reply with quote

that sizeof should work.

edit: also i'm retarded and can't read properly because it's 9 am and i'm still not asleep
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Tue Jan 11, 2011 8:32 pm    Post subject: Reply with quote

Sorry. I was unclear. If that sizeof statement appears in the same scope as the declaration of lpString then it will evaluate correctly. However if you pass it as a parameter to another function, it just becomes a pointer in which case it will evaluate to 4 or 8.
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