Thread: help :(

Results 1 to 5 of 5
  1. #1
    dime11's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    My Mood
    Angry

    help :(

    Where is my mistake in my code?

    Code added by PixieCorp:
    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 "The Game Is Not Working", 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 "The Game Is Not Working", 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 "The Game Is Not Working", 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 "The Game Is Not Working", 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 "The Game Is Not Working", 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 "The Game Is Not Working", 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 "The Game Is Not Working", 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 "The Game Is Not Working", 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
    Code:
    Private Sub Command1_Click()
    Timer1.Enabled = True
    End Sub
    
    Private Sub Command2_Click()
    Timer1.Enabled = False
    End Sub
    
    Private Sub Image1_Click()
    End
    End Sub
    
    Private Sub Image2_Click()
    Me.WindowState = 1
    End Sub
    
    Private Sub Timer1_Timer()
    If GetKeyPress(vbKeyControl) And GetKeyPress(vbKeySpace) Then
    Dim Pro As Long
    Dim Works As Long
    Dim Productions As Single
    Call ReadALong("SoldierFront", &H73466740, Pro)
    Pro = Works + &H180
    Productions = Text1.Text
    Call WriteAFloat("SoldierFront", Pro, Works)
    End If
    End Sub
    Last edited by Pixie; 11-13-2009 at 05:02 PM.

  2. #2
    stevethehacker's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    USA bitch
    Posts
    416
    Reputation
    14
    Thanks
    51
    My Mood
    Bored
    post code here or I can't help you.

  3. #3
    stevethehacker's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    USA bitch
    Posts
    416
    Reputation
    14
    Thanks
    51
    My Mood
    Bored
    there are a few and they are simple so you obviously copied and pasted that code because whoever made that code should be able to fix the mistakes and vb hacks don't work in warrock so this is a very old code that you copied and pasted

  4. The Following User Says Thank You to stevethehacker For This Useful Post:

    Pixie (11-13-2009)

  5. #4
    dime11's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    My Mood
    Angry
    ok thx ....

  6. #5

Similar Threads

  1. [Help Request] Combat arms Vid help
    By djw111 in forum Combat Arms Help
    Replies: 4
    Last Post: 12-24-2011, 05:06 PM
  2. [Help Request] AFK Bot [help]
    By fet in forum Combat Arms Help
    Replies: 7
    Last Post: 04-28-2011, 03:17 AM
  3. [Help Request] Injector Admin help
    By asdfgas in forum Combat Arms Help
    Replies: 4
    Last Post: 04-27-2011, 06:12 PM
  4. [Help Request] Ajuda / Help
    By - Battery' in forum Combat Arms BR Coding Help
    Replies: 3
    Last Post: 04-22-2011, 07:15 PM
  5. [Help Request] Help my!
    By Windowns7 in forum Combat Arms BR Coding Help
    Replies: 2
    Last Post: 04-18-2011, 01:41 PM