Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


solved~~ :P
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Wed May 28, 2008 11:24 am    Post subject: solved~~ :P Reply with quote

edit ok found the problem, it was my mouse_base, shouldn't deref it

ok im having trouble reading the correct value off the ptr+offset

can anyone tell me if this is correct?

Code:

mouse_base = *((int *) (*((unsigned long *) 0x892bf4) + 0x978));
mouse_x=*((int *) (*((unsigned long *) mouse_base) + 0x8c));
mouse_y=*((int *) (*((unsigned long *) mouse_base) + 0x90));


so basically i wanna see what value for the ingame mouse x and y coordinates are,

which is [[0x892bf4+0x978] +0x8c] for X and [0x892bf4+0x978] +0x90 ] for y.

but the value of the 3 var displayed are extremely large and offchart, nothing like xy coordinate value.

maybe something was wrong?

thank you for your help

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils


Last edited by Bizarro on Wed May 28, 2008 10:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
Drops
Advanced Cheater
Reputation: 0

Joined: 22 Feb 2008
Posts: 62

PostPosted: Wed May 28, 2008 11:36 am    Post subject: Reply with quote

Maybe try to load the pointer using inline asm instead?
Back to top
View user's profile Send private message
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Wed May 28, 2008 12:27 pm    Post subject: Reply with quote

Drops wrote:
Maybe try to load the pointer using inline asm instead?

tried, was getting the same off chart values.
just wondering if the code above is correct.

if so, it must be the wrong offsets 8c and 90
cuz the [0x892bf4+0x978] is updated for sure

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Wed May 28, 2008 12:52 pm    Post subject: Reply with quote

Based on the two things you wrote above, they don't match each other.

You said the base pointer would be (in C++):
Code:
mouse_base = *((int *) (*((unsigned long *) 0x892bf4) + 0x978));


And in ASM it was:
Code:
[0x892bf4+0x978]


Which don't match each other. The C++ version would read the value of 0x892BF4, then add 0x978 to that and read again. Think you are going a bit overboard on the directions.

From what I see with the ASM code you want to add
0x892bf4+0x978 then read that value, then add the offset and read again.

What I would speculate it as:
Code:
int mouse_x = *(int*)( (*(unsigned long*)(0x892BF4+0x978)) + 0x8c );
int mouse_x = *(int*)( (*(unsigned long*)(0x892BF4+0x978)) + 0x90 );


Can't guarantee that would be it since I dunno the code of the game and such. Good luck.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Wed May 28, 2008 1:15 pm    Post subject: Reply with quote

hmm

i always thought 978 was the offset for the mouse coord base ptr.
im not sure my self how it is working.

but in CE where u add pointers, i add 0x892bf4 as the address of pointer, 978 as offset , then add the 2nd pointer of the results with 8c as its 2nd offset.

so bascially the first one is mouse base pointer([0x892bf4+0x978]). with offset 8c and 90 being the x and y pointer.

so [[0x892bf4+0x978] +0x8c] for mouse X and [0x892bf4+0x978] +0x90 ] for y
maybe i was wrong with this terminology.

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Wed May 28, 2008 1:55 pm    Post subject: Reply with quote

I have posted dynamic info in maple section. Here it is with source. It is dynamic pointers and shows how to read them.

And why use mouse pointers when you can use a point and call a function. No mouse pointers needed, ever.



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Wed May 28, 2008 2:20 pm    Post subject: Reply with quote

1) The pointer is for the map not for the screen thats why use the pointer instead of "use a point and call a function" :)
2) Not at home anymore :s
When i get home i send you my function for pointer & Multi-Pointers reading :)

_________________
Gone
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Wed May 28, 2008 2:45 pm    Post subject: Reply with quote

Code:
__inline ULONG_PTR ReadPointer(ULONG_PTR* ulBase, INT nOffset){
   if ( !IsBadReadPtr((VOID*)ulBase, sizeof(ULONG_PTR)) )
        if ( !IsBadReadPtr((VOID*)((*(ULONG_PTR*)ulBase)+nOffset), sizeof(ULONG_PTR)) )
            return *(ULONG_PTR*)((*(ULONG_PTR*)ulBase)+nOffset);
    return 0;
}


Probably better than yours Zorita.

You can also use this before you write to a value to make sure the value isn't void

Also make sure you use IsBadReadPtr on the base and base+offset or you will crash if the memory is not there. In maple this occurs on map changes, etc.

_________________
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Wed May 28, 2008 3:12 pm    Post subject: Reply with quote

blankrider wrote:
Code:
__inline ULONG_PTR ReadPointer(ULONG_PTR* ulBase, INT nOffset){
   if ( !IsBadReadPtr((VOID*)ulBase, sizeof(ULONG_PTR)) )
        if ( !IsBadReadPtr((VOID*)((*(ULONG_PTR*)ulBase)+nOffset), sizeof(ULONG_PTR)) )
            return *(ULONG_PTR*)((*(ULONG_PTR*)ulBase)+nOffset);
    return 0;
}


Probably better than yours Zorita.

You can also use this before you write to a value to make sure the value isn't void

Also make sure you use IsBadReadPtr on the base and base+offset or you will crash if the memory is not there. In maple this occurs on map changes, etc.

LOL how can you say its better then mine if you never saw any of my code?

_________________
Gone
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Wed May 28, 2008 3:56 pm    Post subject: Reply with quote

I know all the other parts of your code were inferior from the disassembly

Just taking an educated guess

_________________
Back to top
View user's profile Send private message
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Wed May 28, 2008 6:56 pm    Post subject: Reply with quote

blankrider wrote:
I have posted dynamic info in maple section. Here it is with source. It is dynamic pointers and shows how to read them.

And why use mouse pointers when you can use a point and call a function. No mouse pointers needed, ever.


err i already saw your source few days ago. but i think u are mistaking the mouse x and y in your dynamic info with the ones im talking about?

they are totally different in coord as the one im using only shows the in game map coord with the mouse not outside the game. thats why im using the ptrs

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Wed May 28, 2008 6:58 pm    Post subject: Reply with quote

You asked how to read a pointer which i gave generic examples and functions for
_________________
Back to top
View user's profile Send private message
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Wed May 28, 2008 7:02 pm    Post subject: Reply with quote

blankrider wrote:
You asked how to read a pointer which i gave generic examples and functions for


if you look at the code i showed in the first post, i know how to read the ptrs. but its just showing off charts value. i just wanna to make sure if my method for this double offsets are correct. if so, i must be using incorrect offset value.

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
reload01
Advanced Cheater
Reputation: 0

Joined: 22 Oct 2006
Posts: 96

PostPosted: Thu May 29, 2008 4:48 am    Post subject: Re: solved~~ :P Reply with quote

Bizarro wrote:
edit ok found the problem, it was my mouse_base, shouldn't deref it

ok im having trouble reading the correct value off the ptr+offset

can anyone tell me if this is correct?

Code:

mouse_base = *((int *) (*((unsigned long *) 0x892bf4) + 0x978));
mouse_x=*((int *) (*((unsigned long *) mouse_base) + 0x8c));
mouse_y=*((int *) (*((unsigned long *) mouse_base) + 0x90));


so basically i wanna see what value for the ingame mouse x and y coordinates are,

which is [[0x892bf4+0x978] +0x8c] for X and [0x892bf4+0x978] +0x90 ] for y.

but the value of the 3 var displayed are extremely large and offchart, nothing like xy coordinate value.

maybe something was wrong?

thank you for your help


if you still havent got it to work have you tryed dword? instead of int
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Thu May 29, 2008 5:14 am    Post subject: Reply with quote

what was the solution?

Code:
char MouseBytes[17]  = "\xA1\xF4\x2B\x89\x00\x53\x56\x8B\xF1\x8d\x88\x78\x09\x00\x00\x89";
dwMouseBase          = *(DWORD*)dwFindPattern(dwAddress, dwLen, (BYTE*)MouseBytes, "xx????xxxxx????x", 1) + 0x978;


            dwMouseX = ReadPointer((ULONG_PTR*)dwMouseBase, 0x8C);
            dwMouseY = ReadPointer((ULONG_PTR*)dwMouseBase, 0x90);
            SetDlgItemText(thisHwnd, IDC_MOUSEX, itoa(dwMouseX, buf, 10) );
            SetDlgItemText(thisHwnd, IDC_MOUSEY, itoa(dwMouseY, buf, 10) );



That's my code. I've tried everything!

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites