Ergebnis 1 bis 6 von 6
  1. #1
    Stanley Jobson Avatar von Bi0sh0k
    Registriert seit
    17.12.2007
    Beiträge
    773

    Standard VB6 Fehler beim kompilieren: Argumenttyp ByRef unverträglich?

    Bei der Variable Adresse taucht der Fehler beim kompilieren auf.
    Was könnte das sein?

    Form:
    Code:
    Dim Adresse As Long
    Dim AdresseOffset As Long
    Select Case (Combo1.Text)
    Case "ReadAByte":
    Call ReadAByte("Text.Text", "&H" + "Text1.Text", Adresse)
    
    Case "ReadAnInt":
    Call ReadAnInt("Text.Text", "&H" + "Text1.Text", Adresse)
    
    Case "ReadALong":
    Call ReadALong("Text.Text", "&H" + "Text1.Text", Adresse)
    
    Case "ReadAFloat":
    Call ReadAFloat("Text.Text", "&H" + "Text1.Text", Adresse)
    End Select
    Modul:
    Code:
    Public Const PROCESS_ALL_ACCESS = &H1F0FFF
    Dim f1holder As Integer
    Dim timer_pos As Long
    'API Declaration
    Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long
    Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
    Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
    Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
    Public Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer
    Public Declare Function ReadProcessMem Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
    Public Function WriteAByte(gamewindowtext As String, address As Long, value As Byte)
    Dim hWnd As Long
    Dim pid As Long
    Dim phandle As Long
    hWnd = FindWindow(vbNullString, gamewindowtext)
    If (hWnd = 0) Then
    MsgBox "Das Spiel Ist Aus!", vbCritical, "Error"
    End
    Exit Function
    End If
    GetWindowThreadProcessId hWnd, pid
    phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
    If (phandle = 0) Then
    MsgBox "Can't get ProcessId", vbCritical, "Error"
    Exit Function
    End If
    WriteProcessMemory phandle, address, value, 1, 0&
    CloseHandle hProcess
    End Function
    Public Function WriteAnInt(gamewindowtext As String, address As Long, value As Integer)
    Dim hWnd As Long
    Dim pid As Long
    Dim phandle As Long
    hWnd = FindWindow(vbNullString, gamewindowtext)
    If (hWnd = 0) Then
    MsgBox "Das Spiel Ist Aus!", vbCritical, "Error"
    End
    End If
    GetWindowThreadProcessId hWnd, pid
    phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
    If (phandle = 0) Then
    MsgBox "Can't get ProcessId", vbCritical, "Error"
    Exit Function
    End If
    WriteProcessMemory phandle, address, value, 2, 0&
    CloseHandle hProcess
    End Function
    Public Function WriteALong(gamewindowtext As String, address As Long, value As Long)
    Dim hWnd As Long
    Dim pid As Long
    Dim phandle As Long
    hWnd = FindWindow(vbNullString, gamewindowtext)
    If (hWnd = 0) Then
    MsgBox "Das Spiel Ist Aus!", vbCritical, "Error"
    End
    Exit Function
    End If
    GetWindowThreadProcessId hWnd, pid
    phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
    If (phandle = 0) Then
    MsgBox "Can't get ProcessId", vbCritical, "Error"
    Exit Function
    End If
    WriteProcessMemory phandle, address, value, 4, 0&
    CloseHandle hProcess
    End Function
    Public Function ReadAByte(gamewindowtext As String, address As Long, valbuffer As Byte)
    Dim hWnd As Long
    Dim pid As Long
    Dim phandle As Long
    hWnd = FindWindow(vbNullString, gamewindowtext)
    If (hWnd = 0) Then
    MsgBox "Das Spiel Ist Aus!", vbCritical, "Error"
    End
    Exit Function
    End If
    GetWindowThreadProcessId hWnd, pid
    phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
    If (phandle = 0) Then
    MsgBox "Can't get ProcessId", vbCritical, "Error"
    Exit Function
    End If
    ReadProcessMem phandle, address, valbuffer, 1, 0&
    CloseHandle hProcess
    End Function
    Public Function ReadAnInt(gamewindowtext As String, address As Long, valbuffer As Integer)
    Dim hWnd As Long
    Dim pid As Long
    Dim phandle As Long
    hWnd = FindWindow(vbNullString, gamewindowtext)
    If (hWnd = 0) Then
    MsgBox "Das Spiel Ist Aus!", vbCritical, "Error"
    End
    Exit Function
    End If
    GetWindowThreadProcessId hWnd, pid
    phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
    If (phandle = 0) Then
    MsgBox "Can't get ProcessId", vbCritical, "Error"
    Exit Function
    End If
    ReadProcessMem phandle, address, valbuffer, 2, 0&
    CloseHandle hProcess
    End Function
    Public Function ReadALong(gamewindowtext As String, address As Long, valbuffer As Long)
    Dim hWnd As Long
    Dim pid As Long
    Dim phandle As Long
    hWnd = FindWindow(vbNullString, gamewindowtext)
    If (hWnd = 0) Then
    MsgBox "Das Spiel Ist Aus!", vbCritical, "Error"
    End
    Exit Function
    End If
    GetWindowThreadProcessId hWnd, pid
    phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
    If (phandle = 0) Then
    MsgBox "Can't get ProcessId", vbCritical, "Error"
    Exit Function
    End If
    ReadProcessMem phandle, address, valbuffer, 4, 0&
    CloseHandle hProcess
    End Function
    Public Function ReadAFloat(gamewindowtext As String, address As Long, valbuffer As Single)
    Dim hWnd As Long
    Dim pid As Long
    Dim phandle As Long
    hWnd = FindWindow(vbNullString, gamewindowtext)
    If (hWnd = 0) Then
    MsgBox "Das Spiel Ist Aus!", vbCritical, "Error"
    End
    Exit Function
    End If
    GetWindowThreadProcessId hWnd, pid
    phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
    If (phandle = 0) Then
    MsgBox "Can't get ProcessId", vbCritical, "Error"
    Exit Function
    End If
    ReadProcessMem phandle, address, valbuffer, 4, 0&
    CloseHandle hProcess
    End Function
    Public Function WriteAFloat(gamewindowtext As String, address As Long, value As Single)
    Dim hWnd As Long
    Dim pid As Long
    Dim phandle As Long
    hWnd = FindWindow(vbNullString, gamewindowtext)
    If (hWnd = 0) Then
    MsgBox "Das Spiel Ist Aus!", vbCritical, "Error"
    End
    Exit Function
    End If
    GetWindowThreadProcessId hWnd, pid
    phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
    If (phandle = 0) Then
    MsgBox "Can't get ProcessId", vbCritical, "Error"
    Exit Function
    End If
    WriteProcessMemory phandle, address, value, 4, 0&
    CloseHandle hProcess
    End Function

    _______________________________

    GFX Showroom
    Klick mich!
    _______________________________



  2. #2
    Linus Torvalds Avatar von kInGoFcHaOs
    Registriert seit
    25.11.2006
    Beiträge
    1.107

    Standard

    Public Function ReadAnInt(gamewindowtext As String, address As Long, valbuffer As Integer)

    du übergibst ein long !

    versuch :
    Dim Adresse As Integer
    Geändert von kInGoFcHaOs (09.05.2009 um 17:54 Uhr)

  3. #3
    Stanley Jobson Avatar von Bi0sh0k
    Registriert seit
    17.12.2007
    Beiträge
    773

    Standard

    Jetzt kommt immer noch der Fehler.:/

    _______________________________

    GFX Showroom
    Klick mich!
    _______________________________



  4. #4
    Linus Torvalds Avatar von kInGoFcHaOs
    Registriert seit
    25.11.2006
    Beiträge
    1.107

    Standard

    man kann echt nicht erwarten das wer alleine auf was kommt...^^
    wie siehts mit den anderen aus?

    readabyte fordert ein byte und nicht ein int und schon garkein long
    weist du jetzt wo der fehler ist??


    wenn man nichtmal weis was ne methode ist... kann der src garnicht ganz von dir sein...


  5. #5
    Stanley Jobson Avatar von Bi0sh0k
    Registriert seit
    17.12.2007
    Beiträge
    773

    Standard

    Es kann anscheinend nur mit ReadALong gescannt werden, was ich auch in anderen Hacks gesehen habe womit gescannt wurde. Die verwenden alle ReadALong. Klar das Modul ist nicht von mir. Das ist aus der Game-Hacking Scene und wird da groß und breit verteilt. Der Rest des Programms ist allerdings von mir. Ich wollte mir das Gamehacking nur erleichtern so das ich nicht immer extra für jede Adresse den hack wieder umproggen muss, was dann doch schon ziemlich lästig sein kann.

    _______________________________

    GFX Showroom
    Klick mich!
    _______________________________



  6. #6
    Linus Torvalds Avatar von kInGoFcHaOs
    Registriert seit
    25.11.2006
    Beiträge
    1.107

    Standard

    oh mann du hast ne pm ... jedenfalls wenn ich mim kochen fertig bin ^^

Stichworte

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •