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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock