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