Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

VS 2008 Why this doesnt work ? (memory scanning)

$
0
0
Hi !
Im making this program just to learn about memory etc, im trying to scan for a specified value in some process, and it works when i set the start point like 10 addressess before the address i want to find (078C17D2) but when i set the start range to like 400000 then it never finds the address, but its just consuming my CPU and even if i leave it for lots of minutes it still doesnt find it and im using a loop so it should find very fast.
Im looping in a backgroundworker, heres the code
Code:

Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
        Do Until num1 >= num2
            If Not ReadMemory(num1, 11) Is Nothing Then
                vale = BitConverter.ToString(ReadMemory(num1, 11), 0)
                If vale = "24-0A-2A-D2-A2-A0-A2-A0-24-0A-A1" Then
                    MsgBox("Found !!!! " & Hex(num1) & " " & vale)
                End If
                num1 += &H1
            End If
            num1 += &H1
        Loop
    End Sub

Num1 and num2 are declared under Public Class form1 both as integers, num1 in this case was
&H40000000

And num2 was &H7FFFFFFF

When i set num1 to &H78C17C8 then it easily finds the address, but when i set it to &H78C17C1 then it never finds it, and its not really a big difference.Is it some overflow or something ?

//Edit
I left the program with start range set to &H78C17C5 and after like 10 minutes theres still no result, im pretty sure it would find this address already even when i'd use a timer

//Edit 2
i put this code into a timer, and showed the current address in a label, and i found out that when i set the range to &H78C17C9 then it scans like ....C9 -> ....D1 -> ....D3
Why it goes like i'd just add 2 to it ?

//Edit 3
Oh i found out, i needed to put a "Continue Do" at end of the "if not ..." because it was just going outside the if and adding 1, and now it seems to work from any address like &H78C17C5, however i set the start range to &H3C60BE4 and im still waiting for the result (5 minutes..)

Viewing all articles
Browse latest Browse all 27349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>