Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
s2bu

Question about server querries (udp)

Recommended Posts

Hello,

i would like to create some server monitoring tool (server querries via udp - but am a complete nub as far as the GS-protocol is concerned). So i read the "Fennec-ws-network-traffic" and other threads on that topic but i still have some questions/problems. Right now mostly with the "challenge part" maybe more later on.

1) is the protocol described in that thread still used in arma 2 or has there been another change?

2) looking at this example (picture due to forum restrictions in the next post):

I did more or less obviously something wrong with the challenge response (as the server doesnt reply to the main querry (blue)).

Did i understand the "building" of the challenge response correctly? Does it matter in what shape (dec/hex/ascii) the challenge part (red) is given back to the server?

---------- Post added at 12:52 ---------- Previous post was at 12:51 ----------

udp.png

Edited by s2bu
edited title since the issue has been solved

Share this post


Link to post
Share on other sites

I'm pretty sure the protocol should be the same still.

Check this for some Ruby example code. It doesn't support multi-packet responses, but it should be a starting point.

Share this post


Link to post
Share on other sites

ye, that's one of the other threads i checked already ;o)

I tried some more ways of sending the response to the challenge but no success so far.

Is 973257805 actually the challenge in that example and is x3A x02 xBC x4D the right answer segment? Or did i do something wrong on that part (as opposed to the part of actually sending the response back to the server)?

Or in other words: Am i sending back the right response in the wrong way or am i calculating the wrong response?

Edited by s2bu

Share this post


Link to post
Share on other sites
Is 973257805 actually the challenge in that example and is x3A x02 xBC x4D the right answer segment? Or did i do something wrong on that part (as opposed to the part of actually sending the response back to the server)?

Or in other words: Am i sending back the right response in the wrong way or am i calculating the wrong response?

Both of those are correct.

Change the last byte in your response to \x01 and it should work. I just tested that example code I posted and it still works (so there hasn't been a GS protocol change). The only difference I can see is that byte.

Share this post


Link to post
Share on other sites

Changing the last byte doesnt change anything.

Actually i think it's what sickboy points out in the fennec-thread:

"The problem in your implementation seems to be that you're returning the challenge response as numbers, while you should convert it to string (im using sprintf)."

Gonna try if i can get it to transmit it as string.

Share this post


Link to post
Share on other sites
Changing the last byte doesnt change anything.

Actually i think it's what sickboy points out in the fennec-thread:

"The problem in your implementation seems to be that you're returning the challenge response as numbers, while you should convert it to string (im using sprintf)."

Gonna try if i can get it to transmit it as string.

In your screenshot, there's a hex string listed as 'response' - that is exactly what you should be sending, except for that one byte difference. But if that isn't working, I'm not really sure.

Share this post


Link to post
Share on other sites

A little update:

What i did before: Store the hexnumbers in an array of byte and send that array (worked for initial querry, not for the follow up)

Sending that hex string ('xFD xFE ...' or variations of it - i.e. w/o spaces) as string doesnt work (but then again that isn't what your ruby code does if i understood it correctly).

Upon further experimenting around with sending strings to the server i found out that building a string from acii-chars representing the hex-values (i.e. x41 x42 x43 => 'ABC' - i think that is what your ruby code does) works for the initial querry (xFD xFE x09 ...) but again not for the follow up (xFD xFE x00 ...) for me.

Changing the last byte also doesnt change anything.

So i have 2 ways of sending stuff to the server that work only for the initial querry but not the follow up - that makes me wonder if maybe there is something wrong with the content of my response after all.

Edited by s2bu

Share this post


Link to post
Share on other sites

Got a new hypothethis: Maybe i am using the "wrong" codepage to encode the hex-values into characters. Can you maybe find out what codepage your ruby code uses encode the characters?

Share this post


Link to post
Share on other sites
Got a new hypothethis: Maybe i am using the "wrong" codepage to encode the hex-values into characters. Can you maybe find out what codepage your ruby code uses encode the characters?

You shouldn't be encoding the response at all (that is, it should just be a string of bytes).

Hexdump from a working request:

Random ID: 20 28 21 25

Sent:

00000000  fe fd 09 20 28 21 25                             |... (!%|

Received:

00000000  09 20 28 21 25 2d 32 30 34 35 37 39 31 33 39 32  |. (!%-2045791392|
00000010  00                                               |.|

Parsed challenge: -2045791392

Sent:

00000000  fe fd 00 20 28 21 25 86 0f b3 60 ff ff ff 01     |... (!%...`....|

Received:

server info here. Too large (and unnecessary) to post.

Share this post


Link to post
Share on other sites

solved my issue: it was something really stupid in the end. I was sending the response with a fresh instance of the UDP-Socket which then used a different source port which then caused the server to not send the reply to the response-packet.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×