mirror of
https://github.com/djhackersdev/minime.git
synced 2026-09-11 03:55:15 -05:00
wip
This commit is contained in:
@@ -16,18 +16,48 @@ function readHeader(buf: Buffer) {
|
||||
readers.set(MSG.ACCOUNT_LOCK_REQ, buf => {
|
||||
return {
|
||||
type: "account_lock_req",
|
||||
aimeId: buf.readInt32LE(0x0004),
|
||||
aimeId: buf.readUInt32LE(0x0004),
|
||||
pcbId: buf.slice(0x0008, buf.indexOf("\0", 0x0008)).toString("ascii"),
|
||||
field_0018: buf.readInt16LE(0x0018),
|
||||
field_0018: buf.readUInt16LE(0x0018),
|
||||
};
|
||||
});
|
||||
|
||||
readers.set(MSG.CREATE_RECORD_REQ, buf => {
|
||||
return {
|
||||
type: "create_record_req",
|
||||
aimeId: buf.readInt32LE(0x0004),
|
||||
luid: buf.slice(0x0008, buf.indexOf("\0", 0x0008)).toString("ascii"),
|
||||
field_0018: buf.slice(0x0018, 0x0034),
|
||||
field_0034: buf.readUInt32LE(0x0034),
|
||||
field_0040: buf.slice(0x0040, 0x0084),
|
||||
field_0084: buf.readUInt16LE(0x0084),
|
||||
field_0086: buf.readUInt16LE(0x0086),
|
||||
field_0088: buf.readUInt16LE(0x0088),
|
||||
field_008A: buf.readUInt16LE(0x008a),
|
||||
field_008C: buf.readUInt16LE(0x008c),
|
||||
field_0090:
|
||||
BigInt(buf.readUInt32LE(0x0090)) |
|
||||
(BigInt(buf.readUInt32LE(0x0094)) << 32n),
|
||||
field_009C: buf.readUInt16LE(0x009c),
|
||||
field_00A0: buf.readUInt16LE(0x00a0),
|
||||
field_00A2: buf.readUInt16LE(0x00a2),
|
||||
field_00A4: buf.readUInt16LE(0x00a4),
|
||||
field_00A6: buf.readUInt16LE(0x00a6),
|
||||
field_00A8: buf.readUInt16LE(0x00a8),
|
||||
field_00AA: buf.readUInt16LE(0x00aa),
|
||||
field_00AC: buf.readUInt16LE(0x00ac),
|
||||
field_00AE: buf.readUInt16LE(0x00ae),
|
||||
field_00B0: buf.readUInt16LE(0x00b0),
|
||||
field_00B2: buf.readUInt8(0x00b2),
|
||||
};
|
||||
});
|
||||
|
||||
readers.set(MSG.CREATE_TEAM_REQ, buf => {
|
||||
return {
|
||||
type: "create_team_req",
|
||||
field_0004: buf.readInt32LE(0x0004),
|
||||
field_0008: buf.readInt32LE(0x0008),
|
||||
field_000C: buf.readInt8(0x000c),
|
||||
field_0004: buf.readUInt32LE(0x0004),
|
||||
field_0008: buf.readUInt32LE(0x0008),
|
||||
field_000C: buf.readUInt8(0x000c),
|
||||
};
|
||||
});
|
||||
|
||||
@@ -43,6 +73,13 @@ readers.set(MSG.GET_SERVER_LIST_REQ, () => {
|
||||
return { type: "get_server_list_req" };
|
||||
});
|
||||
|
||||
readers.set(MSG.UPDATE_RECORD_REQ, buf => {
|
||||
return {
|
||||
type: "update_record_req",
|
||||
payload: buf, // hack
|
||||
};
|
||||
});
|
||||
|
||||
export class Decoder extends Transform {
|
||||
state: Buffer;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export const MSG = {
|
||||
GENERIC_RES: 0x0001,
|
||||
CREATE_RECORD_REQ: 0x0066,
|
||||
CREATE_RECORD_RES: 0x0001, // doesn't follow the pattern!
|
||||
UPDATE_RECORD_REQ: 0x0068,
|
||||
CREATE_TEAM_REQ: 0x007b,
|
||||
CREATE_TEAM_RES: 0x007c,
|
||||
GET_CONFIG_REQ: 0x0004,
|
||||
@@ -21,5 +22,6 @@ REQ_LEN.set(MSG.CREATE_TEAM_REQ, 0x0010);
|
||||
REQ_LEN.set(MSG.GET_CONFIG_REQ, 0x0050);
|
||||
REQ_LEN.set(MSG.GET_CONFIG_DATA_2_REQ, 0x0010);
|
||||
REQ_LEN.set(MSG.ACCOUNT_LOCK_REQ, 0x0020);
|
||||
REQ_LEN.set(MSG.UPDATE_RECORD_REQ, 0x0940);
|
||||
REQ_LEN.set(MSG.UPDATE_STORY_CLEAR_REQ, 0x0020);
|
||||
REQ_LEN.set(MSG.GET_SERVER_LIST_REQ, 0x0020);
|
||||
|
||||
@@ -23,12 +23,19 @@ export class Encoder extends Transform {
|
||||
case "account_lock_res":
|
||||
buf = Buffer.alloc(0x0020);
|
||||
buf.writeUInt16LE(MSG.ACCOUNT_LOCK_RES, 0x0000);
|
||||
buf.writeInt8(obj.field_0018, 0x0018);
|
||||
buf.writeInt16LE(obj.field_001A, 0x001a);
|
||||
buf.writeUInt8(obj.field_0018, 0x0018);
|
||||
buf.writeUInt16LE(obj.field_001A, 0x001a);
|
||||
buf.writeUInt32LE(obj.field_001C.getTime() / 1000, 0x001c);
|
||||
|
||||
break;
|
||||
|
||||
case "generic_res":
|
||||
buf = Buffer.alloc(0x0020);
|
||||
buf.writeUInt16LE(MSG.GENERIC_RES, 0x0000);
|
||||
buf.writeUInt32LE(obj.field_0004, 0x0004);
|
||||
|
||||
break;
|
||||
|
||||
case "create_team_res":
|
||||
buf = Buffer.alloc(0x0ca0);
|
||||
buf.writeUInt16LE(MSG.CREATE_TEAM_RES, 0x0000);
|
||||
|
||||
@@ -15,12 +15,20 @@ export default async function idz(socket: Socket) {
|
||||
output.write({
|
||||
type: "account_lock_res",
|
||||
field_0018: 1,
|
||||
field_001A: -1,
|
||||
field_001A: 0xffff,
|
||||
field_001C: new Date(Date.now() + 3600000),
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
case "create_record_req":
|
||||
output.write({
|
||||
type: "generic_res",
|
||||
field_0004: 1,
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
case "create_team_req":
|
||||
output.write({
|
||||
type: "create_team_res",
|
||||
@@ -88,6 +96,14 @@ export default async function idz(socket: Socket) {
|
||||
status: 1,
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
case "update_record_req":
|
||||
output.write({
|
||||
type: "generic_res",
|
||||
field_0004: 1,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,32 @@ export interface AccountLockRequest {
|
||||
field_0018: number;
|
||||
}
|
||||
|
||||
export interface CreateRecordRequest {
|
||||
type: "create_record_req";
|
||||
aimeId: number;
|
||||
luid: string;
|
||||
field_0018: Buffer;
|
||||
field_0034: number;
|
||||
field_0040: Buffer;
|
||||
field_0084: number;
|
||||
field_0086: number;
|
||||
field_0088: number;
|
||||
field_008A: number;
|
||||
field_008C: number;
|
||||
field_0090: bigint;
|
||||
field_009C: number;
|
||||
field_00A0: number;
|
||||
field_00A2: number;
|
||||
field_00A4: number;
|
||||
field_00A6: number;
|
||||
field_00A8: number;
|
||||
field_00AA: number;
|
||||
field_00AC: number;
|
||||
field_00AE: number;
|
||||
field_00B0: number;
|
||||
field_00B2: number;
|
||||
}
|
||||
|
||||
export interface CreateTeamRequest {
|
||||
type: "create_team_req";
|
||||
field_0004: number;
|
||||
@@ -24,9 +50,16 @@ export interface GetServerListRequest {
|
||||
type: "get_server_list_req";
|
||||
}
|
||||
|
||||
export interface UpdateRecordRequest {
|
||||
type: "update_record_req";
|
||||
payload: Buffer;
|
||||
}
|
||||
|
||||
export type Request =
|
||||
| AccountLockRequest
|
||||
| CreateRecordRequest
|
||||
| CreateTeamRequest
|
||||
| GetConfigRequest
|
||||
| GetConfigRequest2
|
||||
| GetServerListRequest;
|
||||
| GetServerListRequest
|
||||
| UpdateRecordRequest;
|
||||
|
||||
@@ -5,6 +5,11 @@ export interface AccountLockResponse {
|
||||
field_001C: Date;
|
||||
}
|
||||
|
||||
export interface GenericResponse {
|
||||
type: "generic_res";
|
||||
field_0004: number;
|
||||
}
|
||||
|
||||
export interface CreateTeamResponse {
|
||||
type: "create_team_res";
|
||||
name: string;
|
||||
@@ -63,6 +68,7 @@ export interface GetServerListResponse {
|
||||
export type Response =
|
||||
| AccountLockResponse
|
||||
| CreateTeamResponse
|
||||
| GenericResponse
|
||||
| GetConfigResponse
|
||||
| GetConfigResponse2
|
||||
| GetServerListResponse;
|
||||
|
||||
Reference in New Issue
Block a user