View previous topic :: View next topic |
Author |
Message |
d4ne How do I cheat? Reputation: 0
Joined: 06 Dec 2016 Posts: 7
|
Posted: Tue Dec 06, 2016 5:47 pm Post subject: A 32-bit process can not access modules in a 64-bit process |
|
|
I'm trying to create a trainer for a game. Which causes a error (I think) because im trying to access the game memory of a 64 bit game with a 32 bit command.
My source code: pastebin (dot) com/SD738MFJ
And the memory class I found in a youtube tutorial: youtube (dot) com/watch?v=TWUK-fK7xD8 or preview: pastebin (dot) com/tkEZyMV7
Sadly I'm receiving the following error code:
An unhandled exception of type 'System (dot) ComponentModel (dot) Win32Exception' occurred in System (dot) dll
Additional information: A 32-bit process can not access modules in a 64-bit process.
This error should be caused by the following line I guess:
Code: | memory (dot) WriteUInt32(prestigeAddress, 1); |
Does anyone know what I could do now or if there's a fix for this? Or do I need a whole new Memory Processing class?
I would appreciate any kind of help
|
|
Back to top |
|
|
Kavvman Master Cheater Reputation: 2
Joined: 17 Apr 2004 Posts: 316
|
Posted: Tue Dec 06, 2016 6:48 pm Post subject: |
|
|
You can't write to 64bit memory from a 32bit program.
_________________
... |
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
|
|
Back to top |
|
|
d4ne How do I cheat? Reputation: 0
Joined: 06 Dec 2016 Posts: 7
|
Posted: Wed Dec 07, 2016 6:08 am Post subject: |
|
|
Yes I've got that working sadly i'm receiving a new error now:
int address = module.BaseAddress.ToInt32() + baseAddress.ToInt32();
return GetAddress((IntPtr)address, offsets);
causes the following error in the memory class:
An unhandled exception of type 'System.OverflowException' occurred in mscorlib.dll
Additional information: The arithmetic operation has caused an overflow.
So I assume the memory class I've found on youtube is out of date right?
|
|
Back to top |
|
|
Matze500 Expert Cheater Reputation: 8
Joined: 25 Jan 2012 Posts: 241 Location: Germany
|
Posted: Wed Dec 07, 2016 11:55 am Post subject: |
|
|
int address = module.BaseAddress.ToInt32() + baseAddress.ToInt32();
to
long address = module.BaseAddress.ToInt64() + baseAddress.ToInt64();
You are on 64bit and adresses are 8byte long
_________________
|
|
Back to top |
|
|
Kavvman Master Cheater Reputation: 2
Joined: 17 Apr 2004 Posts: 316
|
Posted: Wed Dec 07, 2016 12:18 pm Post subject: |
|
|
size_t and ptrdiff_t types are your friends.
This article helped me tremendously when i first switched from 32 to 64bit
http://www.viva64.com/en/l/full/
But honestly, i like Delphi better - NativeInt, NativeUint and you are good. C++ is a lot strict with its types
_________________
... |
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
|
Posted: Wed Dec 07, 2016 3:08 pm Post subject: |
|
|
ViZZion wrote: | size_t and ptrdiff_t types are your friends.
This article helped me tremendously when i first switched from 32 to 64bit
http://www.viva64.com/en/l/full/
But honestly, i like Delphi better - NativeInt, NativeUint and you are good. C++ is a lot strict with its types |
He's not using C++, hes using C#. Those datatypes are useless to him.
_________________
- Retired. |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Dec 07, 2016 6:03 pm Post subject: |
|
|
Should change all of your methods to use IntPtr instead of int or long for all of the addresses.
If you're just adding an offset, you can use: Code: | int offset = 0x1234;
IntPtr address = IntPtr.Add(module.BaseAddress, offset); |
If you must add two IntPtr objects together: Code: | IntPtr address;
if (IntPtr.Size == sizeof(Int32)) {
address = new IntPtr(module.BaseAddress.ToInt32() + baseAddress.ToInt32());
} else {
address = new IntPtr(module.BaseAddress.ToInt64() + baseAddress.ToInt64());
} |
|
|
Back to top |
|
|
Kavvman Master Cheater Reputation: 2
Joined: 17 Apr 2004 Posts: 316
|
|
Back to top |
|
|
|