[Help] Pattern scanning

Posts 16–28 of 28 · Page 2 of 2
Quote Originally Posted by Jason View Post
You declared a as an Integer, which automatically evaluates the hex (&Hxxxxx) into an integer value. If you want it to be returned as Hex create it as string so it doesn't evaluate the hex.
I don't know what evaluate means, but if I understood the rest correctly then:
If I Dim a as Integer then it doesn't matter that AOBScan doesn't return the address with &H in front of it.
Quote Originally Posted by Paranormal View Post
WOW JASON -.-
Um....what?
I still can't get it to work....

I removed this line from AOBScan.

[highlight=VB.net]MsgBox(curAddr.ToString("X"))[/highlight]

When I do this in a button.
[highlight=VB.net] If GetProcessId("BlackOps") = False Then
Exit Sub
Else
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
MsgBox(a)
End If[/highlight]
The MsgBox says 10 instead of A. It is putting the address in decimals instead of hex.
[highlight=vb.net]
MsgBox(Hex(a))
[/highlight]
Now everything works except I can't use the found address for writememory or nop. I think it is because that the address doesn't have "&H".

I tried that below and nothing happened when the button was pressed.
[highlight=VB.net] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If GetProcessId("BlackOps") = False Then
Exit Sub
End If
End Sub
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
Dim b as Integer = Hex(a)

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX26.Click
If CheckBoxX24.Checked = False Then
CheckBoxX24.Checked = True
Nop(b, &H90)
Nop(b + 1, &H90)
Nop.......[/highlight]
Also nothing from this.
[highlight=VB.net] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If GetProcessId("BlackOps") = False Then
Exit Sub
End If
End Sub
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
Dim b As Integer = "&H" + (Hex(a))

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX26.Click
If CheckBoxX24.Checked = False Then
CheckBoxX24.Checked = True
Nop(b, &H90)
Nop(b + 1, &H90)
Nop.......[/highlight]
You're not understanding the concept of implicit casting.

Look at what you're doing:

[highlight=vb.net]
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
Dim b As Integer = "&H" + (Hex(a))
[/highlight]

You created a as an integer, that's fine. Then you declared 'b' as an INTEGER, which basically says "CAST &HHex(a) TO AN INTEGER" which completely undoes the use of calling the Hex method on an integer as you simply translate the resulting hex back into an integer. If you check, a should = b because you did nothing to it. You can't declare Hex as an integer, think about it...an integer is a whole number, hex is a hexadecimal number. Integers DON'T SUPPORT Hexadecimal characters ("A", "D"...etc) so it implicitly converts them to their integer values. You want to keep it as a string, do it like this

[highlight=vb.net]
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
Dim b As IString = "&H" & (Hex(a))
[/highlight]
Quote Originally Posted by Jason View Post
You're not understanding the concept of implicit casting.

Look at what you're doing:

[highlight=vb.net]
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
Dim b As Integer = "&H" + (Hex(a))
[/highlight]

You created a as an integer, that's fine. Then you declared 'b' as an INTEGER, which basically says "CAST &HHex(a) TO AN INTEGER" which completely undoes the use of calling the Hex method on an integer as you simply translate the resulting hex back into an integer. If you check, a should = b because you did nothing to it. You can't declare Hex as an integer, think about it...an integer is a whole number, hex is a hexadecimal number. Integers DON'T SUPPORT Hexadecimal characters ("A", "D"...etc) so it implicitly converts them to their integer values. You want to keep it as a string, do it like this

[highlight=vb.net]
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
Dim b As IString = "&H" & (Hex(a))
[/highlight]
[highlight=VB.net] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If GetProcessId("BlackOps") = False Then
Exit Sub
End If
End Sub
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
Dim b As String = "&H" + (Hex(a))

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX26.Click
If CheckBoxX24.Checked = False Then
CheckBoxX24.Checked = True
Nop(b, &H90)
Nop(b + 1, &H90)
Nop.......[/highlight]
Well nothing happen when the button is pressed even though that b is a string, but I know why.
If I do it like this then it will work:
[highlight=VB.net] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If GetProcessId("BlackOps") = False Then
Exit Sub
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX26.Click
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
Dim b As String = "&H" + (Hex(a))

If CheckBoxX24.Checked = False Then
CheckBoxX24.Checked = True
Nop(b, &H90)
Nop(b + 1, &H90)
Nop.......[/highlight]
I moved the AOBScan into the buttons sub, but that creates a new problem. I don't want the AOBScan to be done every time the button is pressed. I want the scan to be done on program startup + I can't access b from another sub.
Quote Originally Posted by pyton789 View Post
[highlight=VB.net] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If GetProcessId("BlackOps") = False Then
Exit Sub
End If
End Sub
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
Dim b As String = "&H" + (Hex(a))

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX26.Click
If CheckBoxX24.Checked = False Then
CheckBoxX24.Checked = True
Nop(b, &H90)
Nop(b + 1, &H90)
Nop.......[/highlight]
Well nothing happen when the button is pressed even though that b is a string, but I know why.
If I do it like this then it will work:
[highlight=VB.net] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If GetProcessId("BlackOps") = False Then
Exit Sub
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX26.Click
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
Dim b As String = "&H" + (Hex(a))

If CheckBoxX24.Checked = False Then
CheckBoxX24.Checked = True
Nop(b, &H90)
Nop(b + 1, &H90)
Nop.......[/highlight]
I moved the AOBScan into the buttons sub, but that creates a new problem. I don't want the AOBScan to be done every time the button is pressed. I want the scan to be done on program startup + I can't access b from another sub.
Well then put a timer that waits until the game is open and then stops to start the sub that contains teh byte scanning stuff. And haven't you eever heard of global variables? You can delcare variables outside the subs and it can be used globally on the current form. That is one of the basics of VB. Most people should know that.
Quote Originally Posted by master131 View Post
Well then put a timer that waits until the game is open and then stops to start the sub that contains teh byte scanning stuff. And haven't you eever heard of global variables? You can delcare variables outside the subs and it can be used globally on the current form. That is one of the basics of VB. Most people should know that.
b is zero if I declare it out side of a sub!
I found the process and stuff in form load and then I dim a + b outside of the subs.
[highlight=VB.net] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If GetProcessId("BlackOps") = False Then
Exit Sub
End If
End Sub
Dim a As Integer = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
Dim b As String = "&H" + (Hex(a))

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX26.Click

If CheckBoxX24.Checked = False Then
CheckBoxX24.Checked = True
Nop(b, &H90)
Nop(b + 1, &H90)
Nop.......[/highlight]

Do you wan't me to also dim it inside of a sub at the same time?
If that was what you meant then it didn't work at all.
Quote Originally Posted by user590177 View Post
well, try to put em as a string value....
Code:
New Byte() {&H98, "??", &H5, &H6A}
yes it will probably work
Nope, don't worked.. :/
you don't do that. Intialize a and b with no value and access it from the subs.

[highlight=vb.net] Dim a As Integer
Dim b As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If GetProcessId("BlackOps") = False Then
Exit Sub
End If
a = AOBSCAN("BlackOps", "BlackOps.exe", New Byte() {&HE8, &H13, &H9E, &H29, &H0, &H83, &HC4, &H1C}, New Byte() {&HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF, &HFF})
b = "&H" + (Hex(a))
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX26.Click
If CheckBoxX24.Checked = False Then
CheckBoxX24.Checked = True
Nop(b, &H90)
Nop(b + 1, &H90)
Nop....... [/highlight]
Thanks master131 I was really confused.
Posts 16–28 of 28 · Page 2 of 2
This thread is closed for replies.

Tags for this Thread

None

Need help?