In General you have to look in the main.swf, use a SWF decompiler or better a ABC Decompiler. ( ActionScript Byte Code is Harder to read, but the the most SWF Decompiler's, will sometimes skip some code parts.)
I use an ABC Disassembler (The one from CyberShadow) and a ABC to AS3 Converter.
Go to 'net/bigpoint/darkorbit/com/module'
That are all Module's (Game Packet's) Darkorbit/BigPoint is using.
As an Example:
The first Packet the Client send to the Server: (VersionRequest)
PHP Code:
package net.bigpoint.darkorbit.com.module
{
import flash.utils.IDataInput;
import flash.utils.IDataOutput;
import net.bigpoint.com.module.IModule;
public class VersionRequest implements IModule
{
private static var _instance:VersionRequest;
public var version:String = "";
public function VersionRequest(param1:String = "")
{
super();
this.version = param1;
}
public static function get instance() : VersionRequest
{
return _instance || (_instance = new VersionRequest());
}
public function getLibcomModuleId() : int
{
return 666;
}
public function getLibcomModuleEstimatedLength() : int
{
return 2;
}
public function read(param1:IDataInput) : void
{
this.version = param1.readUTF();
}
public function write(param1:IDataOutput) : void
{
param1.writeShort(666);
param1.writeUTF(this.version);
}
}
}
In the read/write functions of this class you can see how BP/DO Serialize/Deserialize their Game Packets.