Solved AobScan Error

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Glitch

Newbie
Nov 7, 2013
3
104
0
Hello, I wanted to see if they could help me with an aobscan, What this code is supposed to do is scan the signature and replace it... But running the code gives an error "PinvokeStackImbalance".

Look:


This is the code I used:

C++:
Module Module1
    Public Declare Function OpenProcess Lib "KERNEL32" _
    (ByVal DesiredAccess As Int32, _
     ByVal InheritHandle As Boolean, _
     ByVal ProcessId As Int32) _
    As Int32

    Private Declare Function ReadProcessMemory Lib "KERNEL32" _
    (ByVal Handle As Int32, _
     ByVal address As Int32, _
     ByRef Value As Int32, _
     Optional ByVal Size As Int32 = 4, _
     Optional ByVal lpNumberOfBytesWritten As Int64 = 0) _
    As Long

    Public PROCESS_VM_OPERATION As Int32 = 8
    Public PROCESS_VM_READ As Int32 = 16
    Public PROCESS_VM_WRITE As Int32 = 32

    Private process_id As Int32 = 0
    Public pHandle As Integer = 0

    Public Function GetProcessId(ByVal game_name As String) As Boolean
        Dim Processes() As Process = Process.GetProcesses
        Dim process_name As String
        Dim i As Byte
        For i = LBound(Processes) To UBound(Processes)
            process_name = Processes(i).ProcessName
            If process_name = game_name Then
                process_id = Processes(i).Id
                pHandle = OpenProcess(PROCESS_VM_OPERATION + PROCESS_VM_WRITE + PROCESS_VM_READ, False, process_id)
                Return True
            End If
        Next
        If process_id = 0 Then
            Return False
        End If
        Return False
    End Function

    Public Function ReadByte(ByVal address As Int32) As Integer
        Dim value As Integer
        ReadProcessMemory(pHandle, address, value, 1, 0)
        Return value
    End Function

    Public Function AOBSCAN(ByVal GameName As String, ByVal ModuleName As String, ByVal Signature As Byte(), ByVal Mask As Byte()) As Integer
        Dim BaseAddress, EndAddress As Int32
        For Each PM As ProcessModule In Process.GetProcessesByName(GameName)(0).Modules
            If ModuleName = PM.ModuleName Then
                BaseAddress = PM.BaseAddress
                EndAddress = BaseAddress + PM.ModuleMemorySize
            End If
        Next
        Dim curAddr As Int32 = BaseAddress
        Do
            For i As Integer = 0 To Signature.Length - 1
                If ReadByte(curAddr + i) = Signature(i) Or Mask(i) = &H0 Then
                    If i = Signature.Length - 1 Then
                        MsgBox(curAddr.ToString("X"))
                        Return curAddr
                    End If
                    Continue For
                End If
                Exit For
            Next
            curAddr += 1
        Loop While curAddr < EndAddress
        Return 0
    End Function
End Module
Use:

C++:
Dim sigAddresses As Integer = AOBSCAN("ac_client", "ac_client.exe", New Byte() {&HFF, &H25, &HBC, &H30, &HF, &H1, &H75, &H2}, New Byte() {&HFF, &H0, &HFF, &H0, &HFF, &H0, &H0, &H0})
        '&HFF, &H25, &HBC, &H30, &HF, &H1, &H75, &H2 <- Search
        '&HFF, &H0, &HFF, &H0, &HFF, &H0, &H0, &H0} <- Change
I hope you can help me, Thanks!
 

KISKE

Game Developer
Meme Tier VIP
Fleep Tier Donator
Jul 27, 2016
163
2,758
16
Try changing your ReadProcessMemory signature for one of this: pinvoke.net: ReadProcessMemory (kernel32)
Try with everyone.

Also, you have a MDA message, it's not a compiling error, if you want to disable the message you can do it by:
Debug > Windows > Exception Settings > Managed Debugging Assistants > Uncheck PInvokeStackImbalance.

Complete vb.net memory class Source Code - Nether's VB Memory Class
 
Last edited by a moderator:

Glitch

Newbie
Nov 7, 2013
3
104
0
Try changing your ReadProcessMemory signature for one of this: https://www.pinvoke.net/default.aspx/kernel32/ReadProcessMemory.html
Try with everyone.

Also, you have a MDA message, it's not a compiling error, if you want to disable the message you can do it by:
Debug > Windows > Exception Settings > Managed Debugging Assistants > Uncheck PInvokeStackImbalance.
I could not solve it, do not you know of some function that does something similar like scan and change value?

- Perdón por mi inglés.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods League of Legends Accounts