GET SERVER PORT C++

Status
Not open for further replies.

underWHAT

Active member
Joined
Mar 26, 2015
Messages
30
Reaction score
0
Hi guys. I need to get server port on C++.
I get samp struct:
DWORD* SAMP_INFO = *(DWORD**)(SAMP_MODULE + OFFSET_SAMP_INFO);
And try to get port:
DWORD* sPORT = *(DWORD**)SAMP_INFO+0x3C9;
But it isn't correctly. Somebody know how to get it?
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
Just checked, your offsets are probably wrong...


here is a working alternative:


char * szPORT_in_string_format = *(char*)(SAMP_MODULE+0x21232E);
unsigned integer szPORT = atoi(szPORT_in_string_format);
 

underWHAT

Active member
Joined
Mar 26, 2015
Messages
30
Reaction score
0
Guys, i found some subject..
When i use that:
DWORD* sPORT = (DWORD*)(SAMP_INFO + 1);
For example SAMP_INFO = 4;
And if i use
DWORD* sPORT = (DWORD*)(SAMP_INFO + 1);
I get sPORT = 8;
But if i using
DWORD* sPORT = (DWORD*)(2+ 1);
I get sPORT=3;
So, what's wrong?
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
Learn to code dude, you're fucking retarded...

[member=111]springfield[/member] close this shit... /wrongsection anyways
 
Status
Not open for further replies.
Top