View Single Post
jim_yang
Veteran Member
Join Date: Aug 2006
Old 07-31-2011 , 08:41   Re: some questions ( CString, CVector, Ham )
Reply With Quote #9

if you know how a struct store in memory, you will know the asm part above
Code:
0	string_t	classname;
1	string_t	globalname;

2	vec3_t		origin;
5	vec3_t		oldorigin;
8	vec3_t		velocity;
11	vec3_t		basevelocity;
14	vec3_t      	clbasevelocity;

17	vec3_t		movedir;

20	vec3_t		angles;
23	vec3_t		avelocity;
26	vec3_t		punchangle;
29	vec3_t		v_angle;

32	vec3_t		endpos;
35	vec3_t		startpos;
38	float		impacttime;
39	float		starttime;

40	int		fixangle;
41	float		idealpitch;
42	float		pitch_speed;
43	float		ideal_yaw;
44	float		yaw_speed;

45	int		modelindex;
46	string_t	model;

47	int		viewmodel;
48	int		weaponmodel;
	
49	vec3_t		absmin;
52	vec3_t		absmax;
55	vec3_t		mins;
58	vec3_t		maxs;
61	vec3_t		size;

64	float		ltime;
65	float		nextthink;

66	int		movetype;
67	int		solid;

68	int		skin;
69	int		body;
70	int 		effects;
	
71	float		gravity;
72	float		friction;
	
73	int		light_level;

74	int		sequence;
75	int		gaitsequence;
76	float		frame;
77	float		animtime;
78	float		framerate;
79	byte		controller[4];
80	byte		blending[2];

81	float		scale;

82	int		rendermode;
83	float		renderamt;
84	vec3_t		rendercolor;
87	int		renderfx;

88	float		health;
89	float		frags;
90	int		weapons;
91	float		takedamage;

92	int		deadflag;
93	vec3_t		view_ofs;

96	int		button;
97	int		impulse;

98	edict_t		*chain;
99	edict_t		*dmg_inflictor;
100	edict_t		*enemy;
101	edict_t		*aiment;
102	edict_t		*owner;
103	edict_t		*groundentity;

104	int		spawnflags;
105	int		flags;
	
106	int		colormap;
107	int		team;

108	float		max_health;
109	float		teleport_time;
110	float		armortype;
111	float		armorvalue;
112	int		waterlevel;
113	int		watertype;
	
114	string_t	target;
115	string_t	targetname;
116	string_t	netname;
117	string_t	message;

118	float		dmg_take;
119	float		dmg_save;
120	float		dmg;
121	float		dmgtime;
	
122	string_t	noise;
123	string_t	noise1;
124	string_t	noise2;
125	string_t	noise3;
	
126	float		speed;
127	float		air_finished;
128	float		pain_finished;
129	float		radsuit_finished;
	
130	edict_t		*pContainingEntity;

131	int		playerclass;
132	float		maxspeed;

133	float		fov;
134	int		weaponanim;

135	int		pushmsec;

136	int		bInDuck;
137	int		flTimeStepSound;
138	int		flSwimTime;
139	int		flDuckTime;
140	int		iStepLeft;
141	float		flFallVelocity;

142	int		gamestate;

143	int		oldbuttons;

144	int		groupinfo;

	// For mods
145	int		iuser1;
146	int		iuser2;
147	int		iuser3;
148	int		iuser4;
149	float		fuser1;
150	float		fuser2;
151	float		fuser3;
152	float		fuser4;
153	vec3_t		vuser1;
156	vec3_t		vuser2;
159	vec3_t		vuser3;
162	vec3_t		vuser4;
165	edict_t		*euser1;
166	edict_t		*euser2;
167	edict_t		*euser3;
168	edict_t		*euser4;
the pev struct in windows, its offset is 1 from "this" pointer, and pev->pContainingEntity is 130 in the pev struct, each take 4 byte means 130 * 4 = 520,
so this->pev->pContainingEntity, you will get the entity itself from its class object.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline