Ir para conteúdo

Featured Replies

  • Respostas 8
  • Visualizações 778
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor


Public Class Client

#Region "Public As"

    Public MainForm As ClientChooser

    Public MenuF As frmMenu

    Public WithEvents Process As Process

    Public Handle As IntPtr

    Public AdressOffset As Integer

    Public Input As InputHelper

#End Region

#Region "Player Adress 9.44"

    Dim PlayerExp As Integer = &H3ABF98 ' 9.44

    Dim PlayerId As Integer = &H978EA4 ' 9.44 Player name on clientchooser

    Dim Healthadr As Integer = &H541000 ' 9.44

    Dim Manaadr As Integer = &H3ABFE0 ' 9.44

    Dim HealthMaxadr As Integer = &H578E9C ' 9.44

    Dim ManaMaxadr As Integer = &H3ABF90 ' 9.44

#End Region

#Region "Battlelist Adress"

    Dim gotoX As Integer = &H978EA0 ' 9.44

    Dim gotoY As Integer = &H978E98 ' 9.44

    Dim gotoZ As Integer = &H941004 ' 9.44

    Dim BattleListStart As Integer = &H941008 ' 9.44

#End Region

#Region "Client Adress"

    Dim ClientStatus As Integer = &H7B5D4C ' 9.44

    Dim clickId As Integer = &H93E400 ' 9.44

#End Region

#Region "Hotkeys Adress 9.44"

    Dim HotkeyObjectStart As UInteger = &H7B5C64 ' 9.44

    Dim HotkeyObjectStep As UInteger = &H1 ' 9.44

    Dim HotkeySendAutostart As UInteger = &H7B5C14 ' 9.44

    Dim HotkeyUseTypeStart As UInteger = &H7B5B78 ' 9.44

    Dim HotkeyTextStart As UInteger = &H7B3748 ' 9.44

    Dim HotkeyMax = 36 ' 9.44

#End Region

#Region "Others Declarations"

    Public Event ConnectionStatusChanged()

    Public running As Boolean = True

    Private lastStatus As Byte

    Public HealForm As frmHealer

#End Region

    Sub New(ByVal _process As Process, ByVal mainform As ClientChooser)

	    Process = _process

	    Process.EnableRaisingEvents = True

	    Handle = Util.WinApi.OpenProcess(Util.WinApi.PROCESS_ALL_ACCESS, 0, CUInt(_process.Id))

	    AdressOffset = Process.MainModule.BaseAddress.ToInt32 - &H400000

	    Input = New InputHelper(Me)

	    Me.MainForm = mainform

	    Me.menuf = menuf

	    lastStatus = ReadByte(ClientStatus)

	    If lastStatus = 8 Then

		    mainform.CharListBox.Items.Add(Me)

	    End If

	    mainform.ClientList.Add(Process.Id)

	    Dim t As New Threading.Thread(AddressOf CheckStatus)

	    t.Start()

    End Sub

    Private Sub CheckStatus()

	    While running

		    If lastStatus = 8 Then

			    Dim currentStatus As Byte = ReadByte(ClientStatus)

			    If currentStatus <> lastStatus Then

				    lastStatus = currentStatus

				    RaiseEvent ConnectionStatusChanged()

				    Threading.Thread.Sleep(300)

			    End If

		    ElseIf lastStatus = 0 Then

			    Dim currentStatus As Byte = ReadByte(ClientStatus)

			    If currentStatus <> lastStatus Then

				    lastStatus = currentStatus

				    RaiseEvent ConnectionStatusChanged()

				    Threading.Thread.Sleep(300)

			    End If

		    End If

	    End While

    End Sub

    Public Enum HotkeyUsetype

	    Onself = 2

	    OnTarget = 1

	    WithCrosshair = 0

    End Enum

    Public Structure Hotkey

	    Dim Message As String

	    Dim UseType As HotkeyUsetype

	    Dim ItemId As Integer

	    Dim SendAuto As Byte

    End Structure

    Public Sub Sendhotkey(ByVal hotkey As Hotkey)

	    'save oldhotkey data

	    Dim hotkeyObject As Integer = ReadInt(HotkeyObjectStart)

	    Dim hotkeySendAuto As Integer = ReadInt(HotkeySendAutostart)

	    Dim hotkeyUseType As Integer = ReadInt(HotkeyUseTypeStart)

	    Dim hotkeyText As String = ReadString(HotkeyTextStart)

	    WriteInt(HotkeyObjectStart, hotkey.ItemId)

	    WriteByte(HotkeySendAutostart, hotkey.SendAuto)

	    WriteInt(HotkeyUseTypeStart, hotkey.UseType)

	    WriteString(HotkeyTextStart, hotkey.Message)

	    'execute the hotkey

	    Input.SendKey(Keys.F1)

	    'now restore the hotkey

	    WriteInt(HotkeyObjectStart, hotkeyObject)

	    WriteInt(hotkeySendAuto, hotkeySendAuto)

	    WriteInt(HotkeyUseTypeStart, hotkeyUseType)

	    WriteString(HotkeyTextStart, hotkeyText)

    End Sub

    Public Function GetPlayerAdr() As Integer

	    Dim steps As Integer = &HB0

	    Dim Max As Integer = 1300

	    Dim ends As Integer = BattleListStart + (steps * Max)

	    For i As Integer = BattleListStart To ends Step steps

		    If ReadInt(i) = ReadInt(PlayerId) Then

			    Return i

		    End If

	    Next

	    Return 0

    End Function

    Public ReadOnly Property getName() As String

	    Get

		    Return ReadString(GetPlayerAdr() + 4)

	    End Get

    End Property

    Public Function LastClickId() As Integer

	    Return ReadByte(clickId)

    End Function

    Public Function IsOnline() As Boolean

	    If ReadByte(ClientStatus) = 8 Then

		    Return True

	    End If

	    Return False

    End Function

    Public Sub FullLightOn()

	    WriteInt(GetPlayerAdr() + 124, 27)

	    WriteInt(GetPlayerAdr() + 128, 215)

    End Sub

    Public Sub FullLightOff()

	    WriteInt(GetPlayerAdr() + 0, 0)

	    WriteInt(GetPlayerAdr() + 0, 0)

    End Sub

    Public Overloads Overrides Function ToString() As String

	    If ReadByte(ClientStatus) = 8 Then

		    Return ReadString(GetPlayerAdr() + 4)

	    Else

		    Return "NotLoggedIn"

	    End If

    End Function

    Public ReadOnly Property Mana As Integer

	    Get

		    Return ReadInt(Manaadr)

	    End Get

    End Property

    Public ReadOnly Property Hp As Integer

	    Get

		    Return ReadInt(Healthadr)

	    End Get

    End Property

    Public ReadOnly Property ManaMax As Integer

	    Get

		    Return ReadInt(ManaMaxadr)

	    End Get

    End Property

    Public ReadOnly Property HpMax As Integer

	    Get

		    Return ReadInt(HealthMaxadr)

	    End Get

    End Property

#Region "Memory"

    Public Function ReadString(ByVal adr As UInteger) As String

	    Return Util.Memory.ReadString(Handle, AdressOffset + adr)

    End Function

    Public Function ReadInt(ByVal adr As UInteger) As Integer

	    Return Util.Memory.ReadInt32(Handle, AdressOffset + adr)

    End Function

    Public Function ReadByte(ByVal adr As UInteger) As Byte

	    Return Util.Memory.ReadByte(Handle, AdressOffset + adr)

    End Function

    Public Sub WriteInt(ByVal adr As UInteger, ByVal value As Integer)

	    Util.Memory.WriteInt32(Handle, AdressOffset + adr, value)

    End Sub

    Public Sub WriteByte(ByVal adr As UInteger, ByVal value As Byte)

	    Util.Memory.WriteByte(Handle, AdressOffset + adr, value)

    End Sub

    Public Sub WriteString(ByVal adr As UInteger, ByVal value As String)

	    Util.Memory.WriteString(Handle, AdressOffset + adr, value)

    End Sub

#End Region

    Private Sub Process_Exited(ByVal sender As Object, ByVal e As System.EventArgs) Handles Process.Exited

	    running = False

	    ClientChooser.CharListBox.Items.Remove(Me)

	    ClientChooser.ClientList.Remove(Process.Id)

    End Sub

    Private Sub Client_ConnectionStatusChanged() Handles Me.ConnectionStatusChanged

	    If lastStatus = 0 Then

		    ClientChooser.CharListBox.Items.Remove(Me)

	    Else

		    While ReadByte(ClientStatus) <> 8

			    Threading.Thread.Sleep(100)

		    End While

		    ClientChooser.CharListBox.Items.Add(Me)

	    End If

    End Sub

End Class

no do C# retirei umas funçoes eu axo , como hotkeys e sendhotkeys :/

tk-melhor.png

KIIZH.png

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo