View Single Post
Old 14.06.2007, 14:03   #6
humordwarf
Архивный участник
 
Join Date: Feb 2006
Posts: 453
Default

SO_VALID_USER - simple thing that checks given pointer and checks if its really poits to valid User class
0x00602C04 - offset of User virtual functions, same for all users
its good when u not sure and wanna reinsure %)

SafeObjects.h
Code:
#pragma once

class CCreature;

inline bool SO_VALID_USER(CCreature *pUser)
{
	DWORD *p = (DWORD *)pUser;
	if (p==NULL) return false;
	DWORD a = (DWORD)p;
	if (a<0x1000000) return false;
	a = *p;
	if (a!=0x00602C04) return false;
	return true;
}
humordwarf is offline