CrAzY_-7865 Posted June 14, 2018 Share Posted June 14, 2018 Hello everyone! Could someone help me understand how to convert this (int) Read_Global to char *? int Read_Global(int GlobalID) { int Pointer = *(int*)((TunablesPointer - 0x04) + (((GlobalID / 0x40000) & 0x3F) * 4)); if (Pointer != 0) return *(int*)(Pointer + ((GlobalID % 0x40000) * 4)); return 0; } //to char* Read_Global(... Link to comment Share on other sites More sharing options...
ItsiAdam Posted June 14, 2018 Share Posted June 14, 2018 (edited) This is a general c++ question, not a GTA specific question. A very simple and common one too. If you are trying to modify tunables for use in online, I would rethink it seeing as you've gotten stumped here. Use a template, recast the return value to your template type. Edited June 14, 2018 by ItsiAdam Link to comment Share on other sites More sharing options...
CamxxCore Posted June 15, 2018 Share Posted June 15, 2018 11 hours ago, CrAzY_-7865 said: Hello everyone! Could someone help me understand how to convert this (int) Read_Global to char *? Spoiler You can't use a 32bit value to represent a pointer on x64 architecture. You should use a pointer type such as uintptr_t: auto Pointer = *(uintptr_t*)((TunablesPointer - 0x04) + (((GlobalID / 0x40000) & 0x3F) * 4)); CrAzY_-7865 1 Link to comment Share on other sites More sharing options...
CrAzY_-7865 Posted June 15, 2018 Author Share Posted June 15, 2018 (edited) 8 hours ago, CamxxCore said: You can't use a 32bit value to represent a pointer on x64 architecture. You should use a pointer type such as uintptr_t: auto Pointer = *(uintptr_t*)((TunablesPointer - 0x04) + (((GlobalID / 0x40000) & 0x3F) * 4)); this is for PS3... is not good auto, because not compile. Edited June 15, 2018 by CrAzY_-7865 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now