| View previous topic :: View next topic |
| Author |
Message |
M.CORP Grandmaster Cheater Supreme
Reputation: 28
Joined: 28 Oct 2009 Posts: 1010
|
Posted: Sun Jan 09, 2011 2:43 pm Post subject: |
|
|
| 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.....
_________________
|
|
| Back to top |
|
 |
educofu Expert Cheater
Reputation: 3
Joined: 21 Aug 2009 Posts: 171 Location: Brazil,MG,OP
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Tue Jan 11, 2011 7:30 am Post subject: |
|
|
| 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
|
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 |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Jan 11, 2011 7:57 am Post subject: |
|
|
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 |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Tue Jan 11, 2011 8:32 pm Post subject: |
|
|
| 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 |
|
 |
|