PDA

View Full Version : Pointers



sailerboy
11-10-2007, 02:50 PM
What is the function to read a pointer?

Dxt-Cobra
11-10-2007, 05:03 PM
depends in vb6 or C++, and you can make a ReadPointerLong or ReadPointerFloat by modifying your WritePointerLong copy and paste the Write function and change Write to Read.

sailerboy
11-10-2007, 05:09 PM
In C++, i use your function, its
void WritePointerFloatad(long addy, short offset, float value)
{
long maddy;
long saddy;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);
}
i want to read it to a value and store it to a result defined like this
long sj;
which one is correct

void ReadPointerFloatad(long addy, short offset, float value)
{
long maddy;
long saddy;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, 8, NULL);
}
or
void ReadPointerFloatad(long addy, short offset, float value)
{
long maddy;
long saddy;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);
}

Dxt-Cobra
11-10-2007, 05:13 PM
this will read a long value,to a text box or w/e



void ReadPointerLong(long addy, short offset, Long value)
{
long maddy;
long saddy;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);
}



this reads a float value


void ReadPointerFloatad(long addy, short offset, float value)
{
long maddy;
long saddy;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);
}

sailerboy
11-10-2007, 05:15 PM
The syntax would be
ReadPointerLong(0x121212, 0x12, sj)
right?

Dxt-Cobra
11-10-2007, 05:34 PM
if you are trying to read to a editbox,you have to make a variable to the editbox,

so rename the editbox like IDC_SJvalue,then rt click on the editbox goto class wizard,hit the second tab,make a variable to the editbox,name it m_sj,

in the second box leave as a value,then 3rd box pick float,hit ok.


then in your button do


m_sj=ReadPointerFloat(0xaddie,0x178);
UpdateData(0);



now you need to fix the read function to get this to work


[code]
void ReadPointerFloat(long addy, short offset)
{
long maddy;
long saddy;
float value=NULL;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);
return value;
}

Credits goes to *************** for showing me how to do this myself.

sailerboy
11-10-2007, 05:42 PM
the user would put how high they want it and then It does that, or does this store this to a varible
i get these errors

C:Program FilesMicrosoft Visual StudioMyProjectsMyTrainerMyTrainerDlg.cpp(261) : error C2562: 'ReadPointerFloate' : 'void' function returning a value
C:Program FilesMicrosoft Visual StudioMyProjectsMyTrainerMyTrainerDlg.cpp(252) : see declaration of 'ReadPointerFloate'
C:Program FilesMicrosoft Visual StudioMyProjectsMyTrainerMyTrainerDlg.cpp(485) : error C2440: '=' : cannot convert from 'void' to 'float'
this is my button code

void CMyTrainerDlg::OnSuperJump()
{
m_sj = ReadPointerFloate(0x129EF90,0x178);
UpdateData(0);

}