This pathetic ReadAByte problem >.<

Posts 1–9 of 9 · Page 1 of 1
This pathetic ReadAByte problem >.<
Hi, I'm trying to get value as a byte from address with:

Code:
Dim u As Byte

Call ReadAByte("MyProgram", &H100534E, u)
My function:

Code:
Public Function ReadAByte(TheGame As String, TheAddress As Long, ThisIsTheValue As Byte)
Dim SomeValueIsStoredHere As Long
Dim SomeValueIsStoredHereToo As Long
Dim SomeValue As Long
SomeValueIsStoredHere = FindWindow(vbNullString, TheGame)
GetWindowThreadProcessId SomeValueIsStoredHere, SomeValueIsStoredHereToo
SomeValue = OpenProcess(PROCESS_ALL_ACCESS, False, SomeValueIsStoredHereToo)
If (SomeValue = 0) Then
    Exit Function
End If
ReadProcessMem SomeValue, TheAddress, thevalue, 1, 0&
CloseHandle hProcess
End Function
I get always value "0" with ReadAByte (ReadALong works thought, but I need byte for this) so there is error somewhere but I can't locate it? Or is there any calculation that I can change 4 byte value to a normal byte?
Quote Originally Posted by juppeli View Post
Hi, I'm trying to get value as a byte from address with:

Code:
Dim u As Byte

Call ReadAByte("MyProgram", &H100534E, u)
My function:

Code:
Public Function ReadAByte(TheGame As String, TheAddress As Long, ThisIsTheValue As Byte)
Dim SomeValueIsStoredHere As Long
Dim SomeValueIsStoredHereToo As Long
Dim SomeValue As Long
SomeValueIsStoredHere = FindWindow(vbNullString, TheGame)
GetWindowThreadProcessId SomeValueIsStoredHere, SomeValueIsStoredHereToo
SomeValue = OpenProcess(PROCESS_ALL_ACCESS, False, SomeValueIsStoredHereToo)
If (SomeValue = 0) Then
    Exit Function
End If
ReadProcessMem SomeValue, TheAddress, thevalue, 1, 0&
CloseHandle hProcess
End Function
I get always value "0" with ReadAByte (ReadALong works thought, but I need byte for this) so there is error somewhere but I can't locate it? Or is there any calculation that I can change 4 byte value to a normal byte?

I remember this..... Copy paste?

And you get 0 if it can´t find the value or it´s 0!
Quote Originally Posted by Zoom View Post
I remember this..... Copy paste?

And you get 0 if it can´t find the value or it´s 0!
How you mean copy paste? The module? Yeah, it might be, I'm not sure. I found an old WriteALong somewhere in my old projects and quickly modified it to byte.

I'm trying to achieve this:

and no matter what value cheat engine gives my program always states it's 0 (so theres error somewhere in the module or something that I didn't understand right when I built it).
Quote Originally Posted by juppeli View Post
How you mean copy paste? The module? Yeah, it might be, I'm not sure. I found an old WriteALong somewhere in my old projects and quickly modified it to byte.

I'm trying to achieve this:

and no matter what value cheat engine gives my program always states it's 0 (so theres error somewhere in the module or something that I didn't understand right when I built it).
I dont think u can get it work for CE because it´s have diffrent values......
Quote Originally Posted by Zoom View Post
I dont think u can get it work for CE because it´s have diffrent values......
Wow that was a fast reply

I'm not sure what you mean, but I'm only trying to get my program show the same value as the cheat engine shows (with the byte). This should work even with simple calculation from 4 byte (=the same thing that CE does to the value when changing the "Type"?) but I don't know the algorithm and can't find it with google.
Quote Originally Posted by juppeli View Post
Wow that was a fast reply

I'm not sure what you mean, but I'm only trying to get my program show the same value as the cheat engine shows (with the byte). This should work even with simple calculation from 4 byte (=the same thing that CE does to the value when changing the "Type"?) but I don't know the algorithm and can't find it with google.
Hmmm, i don´t think CE is coded in VB it´s C++......
Quote Originally Posted by Zoom View Post
Hmmm, i don´t think CE is coded in VB it´s C++......
1) Cheat engine is coded in Delphi.

2) It doesn't matter what it's coded in: all the programming languages use eventually the same way to get the value so the value should be always the same.

If I change the first function I posted into this
Code:
Public Function ReadAByte(TheGame As String, TheAddress As Long, ThisIsTheValue As Long)
Dim SomeValueIsStoredHere As Long
Dim SomeValueIsStoredHereToo As Long
Dim SomeValue As Long
SomeValueIsStoredHere = FindWindow(vbNullString, TheGame)
GetWindowThreadProcessId SomeValueIsStoredHere, SomeValueIsStoredHereToo
SomeValue = OpenProcess(PROCESS_ALL_ACCESS, False, SomeValueIsStoredHereToo)
If (SomeValue = 0) Then
    Exit Function
End If
ReadProcessMem SomeValue, TheAddress, thevalue, 4, 0&
CloseHandle hProcess
End Function
I still get 0 (even thought this should be the long, yet again my original Long function gives me a real value). Spooky?

E: Problem solved

Code:
Public Function ReadAByte(TheGame As String, TheAddress As Long, ThisIsTheValue As Byte)
Dim SomeValueIsStoredHere As Long
Dim SomeValueIsStoredHereToo As Long
Dim SomeValue As Long
SomeValueIsStoredHere = FindWindow(vbNullString, TheGame)
GetWindowThreadProcessId SomeValueIsStoredHere, SomeValueIsStoredHereToo
SomeValue = OpenProcess(PROCESS_ALL_ACCESS, False, SomeValueIsStoredHereToo)
If (SomeValue = 0) Then
    Exit Function
End If
ReadProcessMem SomeValue, TheAddress, thevalue, 1, 0&
CloseHandle hProcess
End Function
I guess you should do everything with copy paste >.<

You can lock this milestone of my programming career now.
Quote Originally Posted by juppeli View Post
1) Cheat engine is coded in Delphi.

2) It doesn't matter what it's coded in: all the programming languages use eventually the same way to get the value so the value should be always the same.

If I change the first function I posted into this
Code:
Public Function ReadAByte(TheGame As String, TheAddress As Long, ThisIsTheValue As Long)
Dim SomeValueIsStoredHere As Long
Dim SomeValueIsStoredHereToo As Long
Dim SomeValue As Long
SomeValueIsStoredHere = FindWindow(vbNullString, TheGame)
GetWindowThreadProcessId SomeValueIsStoredHere, SomeValueIsStoredHereToo
SomeValue = OpenProcess(PROCESS_ALL_ACCESS, False, SomeValueIsStoredHereToo)
If (SomeValue = 0) Then
    Exit Function
End If
ReadProcessMem SomeValue, TheAddress, thevalue, 4, 0&
CloseHandle hProcess
End Function
I still get 0 (even thought this should be the long, yet again my original Long function gives me a real value). Spooky?

E: Problem solved

Code:
Public Function ReadAByte(TheGame As String, TheAddress As Long, ThisIsTheValue As Byte)
Dim SomeValueIsStoredHere As Long
Dim SomeValueIsStoredHereToo As Long
Dim SomeValue As Long
SomeValueIsStoredHere = FindWindow(vbNullString, TheGame)
GetWindowThreadProcessId SomeValueIsStoredHere, SomeValueIsStoredHereToo
SomeValue = OpenProcess(PROCESS_ALL_ACCESS, False, SomeValueIsStoredHereToo)
If (SomeValue = 0) Then
    Exit Function
End If
ReadProcessMem SomeValue, TheAddress, thevalue, 1, 0&
CloseHandle hProcess
End Function
I guess you should do everything with copy paste >.<

You can lock this milestone of my programming career now.
So you have figure it out? Get values from CE?
Can you get the Long value?

If you can, just convert the long to byte.
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us