Pointer Nostale

08/02/2017 02:33 frojerome#1
Hello,

I don't arrived to read a value from Pointer with the correct Pointer...
I've choose a static one who not change at every restart ! But the value Still 0...
Can someone help me ?

Code:
#RequireAdmin
#include <Pointer.au3>

Global $Handle = 0, $PId = 0
Global const $Process = "NosWizz.exe"

Global const $Basepointer	= 0x082C14C
Global const $Offsets[3]	= [0, "4C", "AC"]

While True
	if not IsArray($Handle) Then
		$PId = ProcessExists($Process)
		if $PId > 0 Then
			$Handle = _MemoryOpen($PId)
			if IsArray($Handle) Then MsgBox(64,"Info","Game was opened")
		Else
			MsgBox(48,"Error","Cannot find game!")
		EndIf
	EndIf

	if IsArray($Handle) Then
		Local $mem_Read = _MemoryPointerRead($Basepointer, $Handle, $Offsets, "DWORD")
		if IsArray($mem_Read) Then
			MsgBox (0,"",$mem_Read[1])
		Else
			MsgBox (48,"Error","Cannot read pointer!")
		EndIf
	EndIf
WEnd
[Only registered and activated users can see links. Click Here To Register...]
08/02/2017 09:52 WalrossGreat#2
Firstly, not sure about the _MemoryPointerRead but the Global const $Offsets should be rather in hex instead of strings(?)

Anyway the offsets are [0, "AC", "4C"] and not [0, "4C", "AC"]
08/02/2017 11:50 frojerome#3
I found an atlernative with NomadMemory.au3 by myself :)

Code:
#RequireAdmin
#include <NomadMemory.au3>

;####### Variables #######;
Global $Handle = 0, $PId = 0 ;Initialisation des variables
Global const $Process = "NosWizz.exe"




;####### Vérification de l'existance du jeu #######;
if not IsArray($Handle) Then
	$PId = ProcessExists($Process)
	if $PId > 0 Then
		if IsArray($Handle) Then MsgBox(64,"Info","Game was opened")
	Else
		MsgBox(48,"Error","Cannot find game!")
	EndIf
EndIf



While 1
	;///// Memory de la VIE \\\\\;
	$BasepointerVie	= 0x082C14C ;Pointer de la vie !
	$Handle = _MemoryOpen($PId)
	if IsArray($Handle) Then
		Local $mem_Read = _MemoryRead($BasepointerVie, $Handle, "DWORD") + 0xAC
			  $mem_Read = _MemoryRead($mem_Read, $Handle, "DWORD") + 0x4C
			  $Value = _MemoryRead($mem_Read, $Handle, 'DWORD')
			  ToolTip($Value&    [MENTION=3576271]CRLF[/MENTION], 0,0)
			  Sleep(1000)
	EndIf

	$BasepointerName	= 0x0699614 ;Pointer de la vie !
	$Handle = _MemoryOpen($PId)
	if IsArray($Handle) Then
		Local $mem_Read = _MemoryRead($BasepointerName, $Handle, "DWORD") + 0x02
			  $Value = _MemoryRead($mem_Read, $Handle, '??? (STRING) ??') ; ERREUR !
			  ToolTip($Value, 0,0)
			  Sleep(1000)
	EndIf
WEnd
But for the name of my char, i don't know what i need to use ?


Code:
		Local $mem_Read = _MemoryRead($BasepointerName, $Handle, "DWORD") + 0x02
		$Value = _MemoryRead($mem_Read, $Handle, '??? (STRING) ??') ; ERREUR !
08/02/2017 12:07 Asuramaru#4
char[StringLength+1]
08/02/2017 18:08 frojerome#5
Quote:
Originally Posted by Asuramaru View Post
char[StringLength+1]
Value still 0 :c

I already retest my Static Value with the pointer in Cheat Engine, and its work.. If I let the "DWORD", that write a decimal value ! (1127047538)

Can I convert them ? Thanks :)
08/03/2017 11:51 Asuramaru#6
Pretty sure you did a mistake with either the type or pointer when the return is 0 (failure).

You can probably just go for char[15] or similar and it will work just fine.
The exact StringLength of the Charactername can be found a few bytes before the string (hex format in memory view) if you want to read the right amount of bytes.

just converting that dword (4bytes) wont do much for you as it only contains the first 4 characters of the string.
However, _HexToString(Hex($value)) should do the job.

If you really want to do it this way for your full Charactername you would have to get the StringLength first and then procced to read out byte by byte until you reached the end.
08/03/2017 12:23 frojerome#7
Quote:
Originally Posted by Asuramaru View Post
Pretty sure you did a mistake with either the type or pointer when the return is 0 (failure).

You can probably just go for char[15] or similar and it will work just fine.
The exact StringLength of the Charactername can be found a few bytes before the string (hex format in memory view) if you want to read the right amount of bytes.

just converting that dword (4bytes) wont do much for you as it only contains the first 4 characters of the string.
However, _HexToString(Hex($value)) should do the job.

If you really want to do it this way for your full Charactername you would have to get the StringLength first and then procced to read out byte by byte until you reached the end.

char[15] Work well ! But why the begin of my name is cut ? That is complicated for TEXT memory :c