Jump to content

Recommended Posts

Posted (edited)

Hi,

 

As you know, there is no separate "Admin" socket for GM. But iv you send packet 00 (Version) with negative values, it will dump some information:

 

import socket
import struct 

port = 7777         # client accepting port
host = '127.0.0.1'  # game server IP

clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientsocket.connect((host, port))

# Preparing request
my_bytes = bytearray()
# size
my_bytes.append(7)
my_bytes.append(0)

# packetId
my_bytes.append(0)

# -3
my_bytes.append(253)
my_bytes.append(255)
my_bytes.append(255)
my_bytes.append(255)


clientsocket.sendall(my_bytes)

# Response

unpacker = struct.Struct('h')
size = unpacker.unpack(clientsocket.recv(unpacker.size))[0] - 2
#print "got packet with payload's size: %s" % size

data = clientsocket.recv(size)
#print('Received', repr(data))

# format:                  cdddddS
unpacker = struct.Struct('<bIIIII')


# c        i              i              i          i            i
msgId, npcConnected, maxUsers, usersConnected, usersPlaying, privateStores = unpacker.unpack(data[0:unpacker.size])

str_unpacker = struct.Struct('%ss' % (size - unpacker.size))
stats = str_unpacker.unpack(data[unpacker.size:])[0].decode('utf-16')
                                                                            
print('msgId: %s, npcStatus (2 - Off, 1 - On): %s, maxUsers: %s, usersConnected: %s, usersPlaying: %s, privateStores: %s, stats (free memory, allocated objects, free pool slots, server Up time minutes): %s') % (msgId, npcConnected, maxUsers, usersConnected, usersPlaying, privateStores, stats)

 

And results:

 

Quote

msgId: 0, npcStatus (2 - Off, 1 - On): 2, maxUsers: 1, usersConnected: 0, usersPlaying: 0, privateStores: 0, stats (free memory, allocated objects, free pool slots, server Up time minutes): 2381589,24,2996,57

 

This doesn't work for C4, they changed format a bit. But if you have IDA, you can check yourself

Edited by MasterToma

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...