 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
grasmanek94 Master Cheater
Reputation: 0
Joined: 03 Jun 2008 Posts: 283 Location: The Netherlands
|
Posted: Tue Jun 11, 2013 4:59 pm Post subject: How does AOB scan work? |
|
|
yes I want to rip off that freaking useful thing and program it in my C++ plugin for a server so it can be compatible with ANY version (previous and future )
Can someone explain how AOB scan really works, how it can find the correct values?
Also, is AOB scan somewhat.. well, probbly not, but cross-compatible, like, I make a Windows Position Logger for players (save their positions), would it work on a linux compiled version too or would I need to figure out other steps?
If any detailed instructions can be given I will really appreciate it!
Thanks in advance, kind regards, Raf.
Maybe I could edit my custom made pointer class to support AOB?
code:
| Code: | //null as last parameter automaticly "Dereferences"
template<class T = DWORD, class S = DWORD> struct Pointer
{
private:
std::vector<S> params;
S variable;
bool MoreThanOne;
public:
//null as last parameter automaticly "Dereferences"
template<class... Args>
Pointer(Args... args)
{
std::array<S, sizeof...(args)> list = {args...};
for( auto i : list)
params.push_back(i);
if(params.size() > 1)
MoreThanOne = true;
else
MoreThanOne = false;
}
T ResolvePointer()
{
variable = params[0];
if(!MoreThanOne)
return (T)variable;
try
{
auto it = params.begin();
++it;
for(; it != params.end(); ++it)
{
if(*reinterpret_cast<S*>(variable) == NULL)
return static_cast<T>(NULL);
variable = *reinterpret_cast<S*>(variable) + *it;
}
}
catch(...)
{
return static_cast<T>(NULL);
}
return (T)variable;
}
T operator()()
{
return ResolvePointer();
}
}; |
Also I'm in posession of some old leaked source code from the software, old server version, maybe that will make it easier to identify the basic player structs?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Jun 11, 2013 8:18 pm Post subject: |
|
|
You would have to write the scanning code to be portable.
Which all depends on how it is written / implemented.
The most common AOB scanning code you can find on the net is the well known 'FindPattern' method:
| Code: | bool Compare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
for(;*szMask;++szMask,++pData,++bMask)
if(*szMask=='x' && *pData!=*bMask) return 0;
return (*szMask) == NULL;
}
DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
{
for(DWORD i=0; i<dwLen; i++)
if (Compare((BYTE*)(dwAddress+i),bMask,szMask)) return (DWORD)(dwAddress+i);
return 0;
} |
Which works strictly by reading data directly from memory of the current process.
You can use ReadProcessMemory to dump external process memory and scan externally as well if that is needed etc.
_________________
- Retired. |
|
| Back to top |
|
 |
|
|
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
|
|