View previous topic :: View next topic |
Author |
Message |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Sun Apr 20, 2008 5:39 pm Post subject: C++ and AA |
|
|
I am trying to use C++ to inject a AA code into a game (MapleStory). For example this simple AA script:
Code: |
[ENABLE] //NO KNOCKBACK
006FA322: //7C 03 6A 64 58 3B C7 7F 02 33 C0 33 C9 39 45 AC
db 7d
|
Now I have done RAM editing with C++ before, but could someone give me a small sample code or something.... If you want to see the script I usually use for C++ ram editing tell me, I can edit them in.
P.S. Because I am not a noob I made this, but I dont think I did it right.
Code: |
#include <windows.h>
#include <iostream>
using namespace std;
int main(){
LONG address = 0x006FA322;
int newvalue = 0xdb7d;
HWND hwnd;
HANDLE phandle;
DWORD pid;
hwnd = FindWindow(NULL, "Star Wars Battlefront II");
if (hwnd != 0) {
SetWindowText(NULL,"Maplestory No Knockback Script");
GetWindowThreadProcessId(hwnd, &pid);
phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
} else {
cout << "Open up MaplesStory first..." << endl << endl;
system("PAUSE");
return 0;
}
if (phandle != 0) {
cout << "Hacked.";
while (phandle != 0) {
WriteProcessMemory(phandle, (LPVOID)address, (LPVOID) &newvalue, 4, 0);
}
} else {
cout << "Not Hacked.";
system("PAUSE");
return 0;
}
}
|
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Apr 20, 2008 5:51 pm Post subject: |
|
|
db isn't an assembly command, its a macro for Direct Byte (changing the byte directly in CE)
You just have to write 1 byte and thats 0x7D
Next you can just use SetConsoleTitle instead of SetWindowText
Unless its a pointer/you want to freeze the value, you don't have to constantly write the value to it. just once will be fine, and if u wanna check i believe you can fill in the last parameter of WriteProcessMemory and then check to make sure bytesWritten is larger then 0
Don't use System("pause"); use _getchar(); or cin.ignore(); cin.sync();
Btw:
You're finding the window for Battlefont II but your using a maplestory hack.....
_________________
|
|
Back to top |
|
 |
Overload Master Cheater
Reputation: 0
Joined: 08 Feb 2008 Posts: 293
|
Posted: Sun Apr 20, 2008 6:56 pm Post subject: |
|
|
lurc wrote: | db isn't an assembly command, its a macro for Direct Byte (changing the byte directly in CE)
You just have to write 1 byte and thats 0x7D
Next you can just use SetConsoleTitle instead of SetWindowText
Unless its a pointer/you want to freeze the value, you don't have to constantly write the value to it. just once will be fine, and if u wanna check i believe you can fill in the last parameter of WriteProcessMemory and then check to make sure bytesWritten is larger then 0
Don't use System("pause"); use _getchar(); or cin.ignore(); cin.sync();
Btw:
You're finding the window for Battlefont II but your using a maplestory hack..... |
1) I though db meant "define byte"??
2) *Noob C++ comment* Does SetWindowText set the text for the console? or the window he has a handle on?
But yes, i do know that you do not need to keep writing the value. Just add a loop that keeps checking to make sure its written.
_________________
Blog
Quote: | Rhys says:
you can be my maid
Rhys says:
ill buy you a french maid outfit
Tyler says:
Sounds good
Rhys says:
ill hold you to that |
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Apr 20, 2008 7:00 pm Post subject: |
|
|
Your right, thats my bad, it is Define Byte.
I'm not sure... attempt to get the hWnd of a Console then try it, cause i dont think you can have the parameter NULL.
_________________
|
|
Back to top |
|
 |
Overload Master Cheater
Reputation: 0
Joined: 08 Feb 2008 Posts: 293
|
Posted: Sun Apr 20, 2008 7:27 pm Post subject: |
|
|
Okay, well just correcting you, i'm actually surprised i could correct anyone on CEF -_-
and why did this guy post 2 threads
_________________
Blog
Quote: | Rhys says:
you can be my maid
Rhys says:
ill buy you a french maid outfit
Tyler says:
Sounds good
Rhys says:
ill hold you to that |
|
|
Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Sun Apr 20, 2008 7:42 pm Post subject: |
|
|
Sorry, that was my bad, my computer froze up and something weird happened. It got deleted.
And ty for your help, I will try that. I also forgot, this is the old script I use, I have a better C++ ram editor, It keeps writing the byte, and does some other things better.
P.S. I edited my BattleFront 2 hacking program to do this lol. I forgot to change everything to MapleStory.
EDIT: STILL DOESN'T WORK...
If I remember correctly doesn't GG disable some commands in C++ and stuff while it is open, ik this is a Maplestory question.
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Apr 20, 2008 8:04 pm Post subject: |
|
|
lol, WriteProcessMemory is hooked in ring3 (user) and its Nt Call (NtReadVirtualMemory i believe) is hooked in ring0 (kernel)
_________________
|
|
Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Sun Apr 20, 2008 9:03 pm Post subject: |
|
|
So.... I should use Kernel? Like cheat engine does... Doesn't it....
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Apr 20, 2008 9:06 pm Post subject: |
|
|
Yea, you'll have to create a driver to use Kernel Mode API to write memory. Take a look at CE's DBKernel source.
_________________
|
|
Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Mon Apr 21, 2008 1:33 am Post subject: |
|
|
lurc wrote: | Yea, you'll have to create a driver to use Kernel Mode API to write memory. Take a look at CE's DBKernel source. |
Why don't you just tell him why people use DLL's? Oh, and the C++ equivalent to "db 90" is "_emit 0x90".
|
|
Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Mon Apr 21, 2008 5:20 am Post subject: |
|
|
Ok, I will do that later today (g2g to school); and I don't want to make a dll, there are alot of added problems when doing that... Unless you mean for the driver, lol.
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Mon Apr 21, 2008 7:48 am Post subject: |
|
|
If you do do a dll then you'll have access to all of MapleStory's memory, but if u want an EXE you'll probly have to create a driver, UNLESS you have a seperate dll that gets injected to maplestory that you File Map with your exe.
_________________
|
|
Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Mon Apr 21, 2008 2:41 pm Post subject: |
|
|
Yeah, I don't want to do any injecting crap, so I am just going to make a driver.
+rep for you help.
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Apr 21, 2008 6:43 pm Post subject: |
|
|
Chaosis13 wrote: | Yeah, I don't want to do any injecting crap, so I am just going to make a driver.
+rep for you help. |
Injection is a lot easier then making a driver.
_________________
- Retired. |
|
Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Sat Apr 26, 2008 1:12 pm Post subject: |
|
|
Could I use DBVM??? (Goto cheat engine homepage).
If so how would I implement it?
|
|
Back to top |
|
 |
|