auto fill textbox from the all seeing eye player name window

toecutter
07-23-2006, 02:20 AM
hi
iam a game admin for 2 australian America's Army servers.
We have heaps of proplems with hackers.

I was wondering if it is possible to make a program using VB2005 or any other program to auto fill a textbox from the player name window in the all seeing eye then have a button the copy the name so it can be pasted to a guid search program?

i have made a basic program to go to a webb link but have no idea if something like this is possible.


cheers
toe

toecutter
07-23-2006, 04:15 AM
ok
ive worked out how to copy the textbox text to the clip board but making the textbox autofill from another program is looking almost impossible


Private Sub btnCopyName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopyName.Click
Clipboard.Clear()
Clipboard.SetText(txtName.Text)
End Sub

ShadowWolf
07-23-2006, 08:46 AM
Autofilling the textbox... sure it can be done but what is the source? listbox? directx/opengl game?

Anyways, if it's a normal windows control you could look into api calls. I have not been able to get much of them to work in VB8 but in VB6 you could for example use these:

Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32.dll" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long

Use FindWindow and FindWindowEx to find the textbox, listbox or anything where the text is that you want. They will return a Long number, which in VB8 should be an Integer (oh and, note that the lines above will not work in VB8 without tweaking). This Integer contains the hWnd of the box where your text is. After that do something like this:

Dim sTmp As String
Dim iTmp As Integer
iTmp = GetWindowTextLength(hWnd)
sTmp = Space(iTmp) 'Reserve the space required
GetWindowText(hWnd, sTmp, iTmp)
MsgBox(sTmp) 'Display the text we got from the hWnd


Edit: oh and, I hope this helps. :)

toecutter
07-24-2006, 04:35 AM
ive put it all together and it builds just fine but when i run the application i get this message:

PInvokeStackImbalance was detected
Message: A call to PInvoke function 'Cheat Buster!Cheat_Buster.frmCheatBuster::GetWindowTextLength' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

can anyone steer me in the right direction

cheers
toe

ShadowWolf
07-24-2006, 04:53 AM
That's what I meant with "I have't managed to get many apis to work myself" and "These won't work in VB8". Basically what you can try is changing all the variable types in those api calls like this:

VB6 Long (the ones used in those api calls) is 4 Bytes, 32 bit
VB8 Long is.... 8 Bytes? (This will give you the pInvoke error)

so you need to convert VB6 Long -> VB8 Int32 (or Integer). Example:

Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long

should obviously be:

Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Int32, ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal lpsz2 As String) As Int32

You might also need to change "Private Declare Function" to "Public Declare Function" and put those api calls into, for example a class like this:

Public Class ApiCalls
Public Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Int32, ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal lpsz2 As String) As Int32
End Class

And then call it like this:

ApiCalls.FindWindowEx(0,0,"","") 'Fill in the correct values here

I hope that works. :)

toecutter
08-04-2006, 05:43 AM
i found this info on the listview program iam trying to autofill the texbox with.
i trying to get the player information into the textbox.

The All Seeing Eye (ASE)

The protocol to the homonymous program is the most complex and also the rarely used one. The request is a simple s, but different from all other protocols. The query must be sent to the server port + 123, so don't send to the game server port. The response is a little bit more difficult, because it has no separators: The structure is „Byte String Byte String“, in which the byte represents the length of the next string, (the byte is self-including). The separator between the server and player information is an empty string, so it's the length of the byte itself - a simple 0x01. The player information looks similar, but starts with an extra byte by using the flags telling which information is included. I do not describe this protocol any further, the only games currently using this protocol are GTA and Farcry.

from here http://www.codeproject.com/csharp/gameserverinfo.asp

toecutter
09-27-2006, 01:37 AM
has anyone had a chance to look at this.
i have also posted here without any luck.
there is a good screen shot of the listview iam trying to get the data from
http://www.vbforums.com/showthread.php?t=418466
cheers
toe

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum