Hello all. I just came across a small idea. I don't know if it is possible anyhow and I don't know how much effort one needs to achieve the result. I am right now sitting in my room and my brother and two friends are in the room next to mine. They are playing Half-Life over LAN the whole time. I just thought that it would be very interesting to create a small program that can send chat messages to the current game they play and talk to them. Of course I could just enter the game by starting it on my PC as well (and fire them down) to chat (normally just some small questions I have and I don't want to go into his room (can you imagine how hot it is in a normal room when 4 or more PCs are running for some hours already?) So I ask myself whether maybe anyone played with this or can give me some information that would help me going on to this. I know I have to know the Server address and the used port and I have to know the format Half-Life uses. Hope to hear from anyone. Stefan
I don't know much about the subject but here is what i do know. There are some programs that are often used for 'hacking' (cheating) online games; they monitor the packets that are sent from and to your computer. Perhaps you could get one of these and see how Half-Life logs you into a game and sends messages. Your program would have to log you into the game though unless you have admin on the server and can use RCON. These packet examining programs can be gotten from http://www.gamehackers.com/ (That might not be the right link but it is something like that, game hacker.com, thegamehackers.com etc.. i just don't want to look it up). I don't know anything else about the subject, so don't bother asking me; i just saw those programs once while browsing the site. ...Matt, the perpetually confused!
Check if the IPX protocol is installed on your LAN. This protocol is often used by HALF LIFE players. When the guys want to play, one of them acts as a server and the others connect to his computer. So, get some documentation about the IPX, then try to connect to the IPX server on your LAN and send some commands. OK!!!?
this is a subject which i have wondered about before. however i have never thought of trying to do it whilst the game is not running. when the game is running is it possible write to a memory address or something which means that a message is sent to the game (from the local computer)? i have never thought of modifying packets to achieve this though. can you modify packets using ASM? any info appreciate (by me and stefan :) thanks skud. PS - stefan, surely your not playing halflife death match? its an appalling game. counter-strike is a quality MOD for halflife. i hope you mean counter-strike and not death match. hehe. also, open ICQ :P
Yes i know how it can be done. Since they play over LAN i guess they run the server themselves and thus have rcon access? All you need to do is obtain rcon access to the server, then you can send them messages using "rcon say blablablbal" I've implemented remote rcon for HL servers in a dll of mine, the protocol is simple (i sniffed it) and i'll post it here:
cmdhere should be replaced by the command you want to send, like: "say hello, how's it going?" (without the quotes ofcourse) the number above is just an example by me (376476423) but in reality it is a unique identifier to avoid ip spoofing, you only have to obtain it once per session but you can do the whole "challenge rcon" procedure before each command if you so wish. I've written something i call General Protocol Parser which is able to parse (or help to parse) most binary and text protocols (and other things too, like urls and paths). It works great and uses filters like this:
Values inside <> are hex codes, everything else is printable ASCII SEND:
challenge rcon<0A 00> RECV: challenge rcon 376476423<0A 00> SEND: rcon 376476423 "passwordhere" cmdhere<0A 00> Sometimes the server sends a reply, depends on the command, and it might looks like this: RECV: Bad rcon_password.<0A 00 00>
And it GREATLY speeds up development since you do not have to write specific parsers for each single packet. The above is the filter that i use to extract the unique identifier with in my .dll. Im going to release it but i need to write some documentation for it. I dunno the size of the parser but i think it's around 2kb. I can give another example of a filter i use to parse another HL packet:
rcon1_filter dd PF_FIND, SIZE_BYTE, EQUALS, ' ', FORWARD dd PF_MOVE, DATA_ARRAY, FORWARD, 1 dd PF_FIND, SIZE_BYTE, EQUALS, ' ', FORWARD dd PF_MOVE, DATA_ARRAY, FORWARD, 1 dd PF_SET_MARKER dd PF_FIND, SIZE_BYTE, EQUALS, 10, FORWARD dd PF_PUT, DATA_ARRAY, SIZE_BYTE, 0 dd PF_END
This filter extracts info from the "info" packet you can request from the server, it contains number of players playing, max players, HL mod being played, name of the server, map beeing played. There are 2 variations of this packet but with the help of my PF_IF parser instruction that was easy to take into account. I think im gonna write the documentation now :)
info_filter dd PF_MOVE, DATA_ARRAY, FORWARD, 5 dd PF_IF, CURRENT, SIZE_BYTE, NOT_EQUALS, 0, offset info_case1 dd PF_PUT, POINTER_ARRAY, SIZE_DWORD, offset err_nohost dd PF_MOVE, DATA_ARRAY, FORWARD, 1 dd PF_LOOP_START, 3 dd PF_JUMP, info_case2 info_case1 dd PF_LOOP_START, 4 info_case2 dd PF_SET_MARKER dd PF_FIND, SIZE_BYTE, EQUALS, 0, FORWARD dd PF_MOVE, DATA_ARRAY, FORWARD, 1 dd PF_LOOP, NULL, NULL, NULL, NULL dd PF_GET, SIZE_BYTE dd PF_GET, SIZE_BYTE dd PF_END
I've also sniffed the WON protocol so i can implement a lightweight GameSpy program (gamespy sucks because it's a huge bloated and slow piece of shit software #"%¤" :mad::mad::mad: that uses close to 30MB of RAM = makes the game run slow even on a 128MB machine :mad::mad: ) It's also a simple protocol and if someone wants it (or wanna help make the GS "clone") just contact me. I suck at making GUI's so development is slow for me. All i need is a resizable window with a list box, status bar, menu and a nice toolbar. Maybe someway to filter servers out of the listbox too. And to keep favourite server sorted at the top of the list box. Maybe someone could point me to some nice tutorials on resizable windows? Izcelions tut's doesn't cut it for me, they don't go into any depth :/ I know how to do advanced static dialog windows using a resource editor but it's the resizable windows im stuck at.
Whoooops, I didn't expect any answers to this posting anymore so I had put this aside (not completely but on the outer edges of my working desk). I am very surprised to see such an amazing answer by you zynaps and to see, that there are other people who think about similar things. @Zynaps However I am still confused. The information you gave are very helpful but I don't really know how to connect to a server. It is very obvious that there has to be a filter for playing this dialog between Server and "Client". Don't get me wrong! I am not asking for a tutorial telling me how to create such a proggy. I just would like some beginning point. I am looking forward to your documentation and the release of the DLL. @skud No, I have to tell you that they are not playing CS. I had downloaded CS over ISDN (you can imagine how long it took) and I had downloaded an update for HL. However it was not the newest one so CS refused to work :( Now I have the newest version of HL but CS is gone after the crash. We play normal Half-Life with BOTS (Jumpbot, very great enemy) and we play MODS like Scientist Hunt, TFC, Judgement Sorry for not having ICQ running in the last time. I just forgot to let it run in the AUTORUN. I have authorized you and immediately requested the same. Hope you get the messages. @zynaps 2 Maybe you can explain to me by mail what exactly you want to do to your lightweigth program. I am not advanced in Win32asm at all but my problem (well not problem, just lazyness) is the other way round. Creating the layout is not that problematic but to implement the single functions I have to kick myself the whole time. I don't know if I am already able to do what you need but I am ready to try to help. So long Stefan
All you have to do to get it to work is to open an UDP socket and send
. No filter needed as RCON is a separate protocol and not part of the actual game protocol. So there is no need trying to attempt to login as an actual client. Logging in as a client is close to impossible due to a number of factors: 1. The protocol handling game data is encrypted to make it harder to write cheating proxies. Also it's checksummed. 2. To connect to a server you might have to be WON authenticated. Also an encrypted protocol. (You can see the woncrypt.dll's in the halflife folder, dunno the exact names) 3. The server will ask you to verify file integrity of a number of files. 4. There are hundreds of packets exchanged during the login phase to synchronize the client with the server. So stick to the simple RCON protocol, the downside is ofcourse that whilst you can sent text to your brother, he cannot reply other than shouting out loud :) But you can do other fun things with them like changing their gravity and stuff. Then after a while they would be so pissed off that they will come into your room. Then you can chat with them in manual mode ;) But anyway what i want to do is a program that lists all HL servers, just like the server lister that is built into HL. I've not yet decided all the features, but they wont be so many.
challenge rcon<0A 00>