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 


0x0 offset

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
NullBy7e
Cheater
Reputation: 0

Joined: 23 Jul 2014
Posts: 47

PostPosted: Fri Jan 23, 2015 10:13 pm    Post subject: 0x0 offset Reply with quote

Why does an offset of 0x0 add *10* to a value in CE?
I'm trying to write to an pointer with C++ but when I add 0x0 it does not increment the value of the address by 10 like it does in CE.

CE

70 => [hollow_visual]
0 => ......
"DARKSOULS.EXE"+0xEDF9E8

C++ (doesn't work)

Code:

int *pPlayer = (int*)((int*)(dwBase + 0xEDF9E8)) + 0x0;
int *pHollowVisual = pPlayer + 0x70;


I've been at it for hours, it's driving me mad!
Back to top
View user's profile Send private message
Krampus
Cheater
Reputation: 0

Joined: 22 Nov 2014
Posts: 41

PostPosted: Sat Jan 24, 2015 12:08 am    Post subject: Re: 0x0 offset Reply with quote

NullBy7e wrote:
Why does an offset of 0x0 add *10* to a value in CE?
I'm trying to write to an pointer with C++ but when I add 0x0 it does not increment the value of the address by 10 like it does in CE.

CE

70 => [hollow_visual]
0 => ......
"DARKSOULS.EXE"+0xEDF9E8

C++ (doesn't work)

Code:

int *pPlayer = (int*)((int*)(dwBase + 0xEDF9E8)) + 0x0;
int *pHollowVisual = pPlayer + 0x70;


I've been at it for hours, it's driving me mad!


You can do it like this, but it's iffy and subject to crashes.

Code:
DWORD Address;
int * pHollowVisual;

Address = dwBase + 0xEDF9E8;
Address = *(DWORD*)Address + 0x0;
Address = *(DWORD*)Address + 0x70;
pHollowVisual = (int*)Address;


It should work, though I'm not too sure since I'm rather new to this method of reading and writing.

_________________
There is no spoon.
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Sat Jan 24, 2015 7:59 am    Post subject: Reply with quote

0x0 is equal to 0

CE doesn't add 10 to the value but it simply fetches the value pointed at the offset 0.

In c++ all you have to do is get the value that is present at the address. There is no need for offset 0.

I haven't touched c++ for months now and don't have access to a compiler so this may not work but you should get the idea

int *pPlayer = (int*)((int*)(dwBase + 0xEDF9E8)) ;
int *pHollowVisual = pPlayer + 0x70;
int *pfetch = pPlayer; // This is equal to typing pPlayer + 0x0. Add this either above or below the pHollowVisual

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
NullBy7e
Cheater
Reputation: 0

Joined: 23 Jul 2014
Posts: 47

PostPosted: Sat Jan 24, 2015 9:24 am    Post subject: Reply with quote

Code:

int *pPlayer = (int*)((int*)(dwBase + 0xEDF9E8)) + 0x0;
int *pHollowState = pPlayer + 0x74;
int *pHollowVisual = pPlayer + 0x70;


In CE the offsets are: 0x0 -> 0xC -> 0x0 -> 0x70.

Why do I need to add 0x0 to it, if its 0 anyway?
It won't do anything?

Edit:

I checked the values my program gets with CE and they differ alot:

CE: http://i.gyazo.com/5ae62e63152a2789007f2b79da42f630.png

Code:

//85610240 = 51A 4F 00
int *pPlayer = (int*)((int*)(dwBase + 0xEDF9E8)) + 0x0;

int pH = *pPlayer + 0x74; //85610356 = 51A 4F 74
int pV = *pPlayer + 0x70; //85610352 = 51A 4F 70 -
CE: 51A 4F 00 + 0 = [b]542 1D 30[/b] + 0x70 = 542 1D A0
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Sat Jan 24, 2015 10:42 am    Post subject: Reply with quote

The 0 tells CE that you do NOT have an offset and to ignore it/fetch the value that is at the address.

You must be accessing wrong address/offsets if your values differ. I don't see you adding the C offset in your code so make sure you are accessing the same pointer path as CE.

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
NullBy7e
Cheater
Reputation: 0

Joined: 23 Jul 2014
Posts: 47

PostPosted: Sat Jan 24, 2015 10:53 am    Post subject: Reply with quote

STN wrote:
The 0 tells CE that you do NOT have an offset and to ignore it/fetch the value that is at the address.

You must be accessing wrong address/offsets if your values differ. I don't see you adding the C offset in your code so make sure you are accessing the same pointer path as CE.


Do I have to add 0xC? All it does is jump back to the previous address
This is what I do:

1. add static addres to dwbase
2. reference it, dereference it for the value
3. add 0x0
4. reference it, dereference it for the value

5. add 0xC to the value of pPlayer
6. reference it, dereference it for the value
7. add 0x0
8. reference it, dereference it for the value

Code:

int *pPlayer = (int*)(int*)(((int*)((int*)(dwBase + 0xEDF9E8))) + 0x0);
pPlayer = (int*)(int*)(((int*)((int*)(pPlayer + 0xC))) + 0x0);

int *pHollowState = pPlayer + 0x74;
int *pHollowVisual = pPlayer + 0x70;


And to for example set the value of pHollowVisual:

Code:

*pHollowVisual = 1;


I'm so confused, lost, tired, I don't get it.
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Sat Jan 24, 2015 12:42 pm    Post subject: Reply with quote

Heres a little pointer function I made a few years back when I wanted to try C++. Might be what you need.
Code:
DWORD mPointer(DWORD Base, INT* Offsets)
{
   DWORD Addy = *(DWORD*)(Base);
    for(INT i = 0; i < sizeof(Offsets); i++)
      Addy = i != (sizeof(Offsets) - 1) ? *(int*)(Addy + Offsets[i]) : Addy += Offsets[i];
   return Addy;
}
void WriteInteger(DWORD Address, int Value)
{
  *(int *)Address = Value;
}


Code:
DWORD pHollowVisual = mPointer((DWORD)(dwBase + 0xEDF9E8),(INT*)"\x0\xC\x0\x70");
DWORD pHollowState = mPointer((DWORD)(dwBase + 0xEDF9E8),(INT*)"\x0\xC\x0\x74");

or
Code:
DWORD pHollowVisual = mPointer((DWORD)(GetModuleHandle(NULL) + 0xEDF9E8),(INT*)"\x0\xC\x0\x70");
DWORD pHollowState = mPointer((DWORD)(GetModuleHandle(NULL) + 0xEDF9E8),(INT*)"\x0\xC\x0\x74");


That should return the pointer address, then you can write the value.
Worked fine for me when I needed it.
Code:
WriteInteger(pHollowVisual,0);

_________________
Back to top
View user's profile Send private message
NullBy7e
Cheater
Reputation: 0

Joined: 23 Jul 2014
Posts: 47

PostPosted: Sat Jan 24, 2015 2:00 pm    Post subject: Reply with quote

Pingo wrote:
Heres a little pointer function I made a few years back when I wanted to try C++. Might be what you need.
Code:
DWORD mPointer(DWORD Base, INT* Offsets)
{
   DWORD Addy = *(DWORD*)(Base);
    for(INT i = 0; i < sizeof(Offsets); i++)
      Addy = i != (sizeof(Offsets) - 1) ? *(int*)(Addy + Offsets[i]) : Addy += Offsets[i];
   return Addy;
}
void WriteInteger(DWORD Address, int Value)
{
  *(int *)Address = Value;
}


Code:
DWORD pHollowVisual = mPointer((DWORD)(dwBase + 0xEDF9E8),(INT*)"\x0\xC\x0\x70");
DWORD pHollowState = mPointer((DWORD)(dwBase + 0xEDF9E8),(INT*)"\x0\xC\x0\x74");

or
Code:
DWORD pHollowVisual = mPointer((DWORD)(GetModuleHandle(NULL) + 0xEDF9E8),(INT*)"\x0\xC\x0\x70");
DWORD pHollowState = mPointer((DWORD)(GetModuleHandle(NULL) + 0xEDF9E8),(INT*)"\x0\xC\x0\x74");


That should return the pointer address, then you can write the value.
Worked fine for me when I needed it.
Code:
WriteInteger(pHollowVisual,0);


Much appreciated! But I would really love to know why my code is not working, it's making me curious, I must be missing something.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
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