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++ and AA
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Sun Apr 20, 2008 5:39 pm    Post subject: C++ and AA Reply with quote

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
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Apr 20, 2008 5:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Overload
Master Cheater
Reputation: 0

Joined: 08 Feb 2008
Posts: 293

PostPosted: Sun Apr 20, 2008 6:56 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Apr 20, 2008 7:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Overload
Master Cheater
Reputation: 0

Joined: 08 Feb 2008
Posts: 293

PostPosted: Sun Apr 20, 2008 7:27 pm    Post subject: Reply with quote

Okay, well just correcting you, i'm actually surprised i could correct anyone on CEF -_-

and why did this guy post 2 threads Confused

_________________
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
View user's profile Send private message MSN Messenger
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Sun Apr 20, 2008 7:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Apr 20, 2008 8:04 pm    Post subject: Reply with quote

lol, WriteProcessMemory is hooked in ring3 (user) and its Nt Call (NtReadVirtualMemory i believe) is hooked in ring0 (kernel)
_________________
Back to top
View user's profile Send private message
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Sun Apr 20, 2008 9:03 pm    Post subject: Reply with quote

So.... I should use Kernel? Like cheat engine does... Doesn't it....
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Apr 20, 2008 9:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Mon Apr 21, 2008 1:33 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Mon Apr 21, 2008 5:20 am    Post subject: Reply with quote

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
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Mon Apr 21, 2008 7:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Mon Apr 21, 2008 2:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Apr 21, 2008 6:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Sat Apr 26, 2008 1:12 pm    Post subject: Reply with quote

Could I use DBVM??? (Goto cheat engine homepage).

If so how would I implement it?
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 1, 2  Next
Page 1 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