
Originally Posted by
hejsan1
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.