Estou desenvolvendo um IP Changer em Visual Basic 6.0 para Tibia 8.1.
Nele tem 1 form com 1 textbox chamado "Text1" e um botão.
Quando você clica no botão ele trabalha os seguintes comandos:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long Private Sub Command1_Click() Dim hwnd As Long Dim pid As Long hwnd = FindWindow(vbNullString, "Tibia") GetWindowThreadProcessId hwnd, pid changeip (pid) End Sub
Agora eu coloquei um modulo com uma função chamada "changeip", nele esta assim:
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long Private Declare Function WriteString Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long Public Function changeip(ByVal IDofProcess As Long) As Boolean Const PROCESS_ALL_ACCESS = &H1F0FFF Dim ax1 As Long Dim ax2 As String Dim phandle As Long phandle = OpenProcess(PROCESS_ALL_ACCESS, False, IDofProcess) For ax1 = 1 To Len(Form1.Text1.Text) ax2 = ax2 & Asc(Mid$(Form1.Text1.Text, ax1, 1)) Next ax1 = 0 If Not Form1.Text1.Text = "" Then WriteString phandle, &H763BB8, ax2, 10, 0& End If CloseHandle phandle End Function
Esta vendo o ax2, se você colocar uma única letra no textbox, exemplo: "A" ele irá modificar a memória corretamente, mas se você colocar dois "A" ficando "AA" no textbox ele irá transformar os dois caracteres A para dois "65", ficando assim: "6565", o problema é que o programa acaba pensando que "6565" = "¥" e não "AA" na hora de escrever na memória do Tibia.
Alguem sabe algum comando que separe os 2 elementos "65"?
Exemplo: Substituindo o "|" nessa frase: "65|65"
Muito obrigado =D