From 7a46f1108970e5ac680044d91467b450497505aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Sat, 12 Oct 2024 23:09:33 +0800 Subject: [PATCH] feat: oidb_0x9067_202 --- src/core/apis/packet.ts | 28 +++++++ src/core/proto/oidb/Oidb.0x9067_202.ts | 8 ++ src/core/proto/oidb/Oidb.ed3_1.ts | 1 + src/core/proto/oidb/Oidb.fe1_2.ts | 1 + src/core/proto/oidb/common/Ntv2.RichMedia.ts | 84 ++++++++++++++++++++ 5 files changed, 122 insertions(+) create mode 100644 src/core/proto/oidb/Oidb.0x9067_202.ts create mode 100644 src/core/proto/oidb/common/Ntv2.RichMedia.ts diff --git a/src/core/apis/packet.ts b/src/core/apis/packet.ts index 6666b871..e326aa87 100644 --- a/src/core/apis/packet.ts +++ b/src/core/apis/packet.ts @@ -3,6 +3,9 @@ import { RequestUtil } from '@/common/request'; import offset from '@/core/external/offset.json'; import * as crypto from 'crypto'; import { PacketClient } from '../helper/packet'; +import { NapProtoMsg } from '../proto/NapProto'; +import { OidbSvcTrpcTcp0X9067_202 } from '../proto/oidb/Oidb.0x9067_202'; +import { OidbSvcTrpcTcpBase } from '../proto/oidb/OidbBase'; interface OffsetType { [key: string]: { @@ -65,4 +68,29 @@ export class NTQQPacketApi { }).then((res) => resolve(res)).catch((e) => reject(e)); }); } + async sendRkeyPacket() { + let oidb_0x9067_202 = new NapProtoMsg(OidbSvcTrpcTcp0X9067_202).encode({ + reqHead: { + common: { + requestId: 1, + command: 2 + }, + scene: { + requestType: 2, + businessType: 1, + sceneType: 0 + }, + clent: { + agentType: 2 + } + }, + downloadRKeyReq: Buffer.from('080a08140802', 'hex'), + }); + let oidb_packet = new NapProtoMsg(OidbSvcTrpcTcpBase).encode({ + command: 0x9067, + subCommand: 202, + body: oidb_0x9067_202 + }); + return oidb_0x9067_202; + } } \ No newline at end of file diff --git a/src/core/proto/oidb/Oidb.0x9067_202.ts b/src/core/proto/oidb/Oidb.0x9067_202.ts new file mode 100644 index 00000000..0b9d7718 --- /dev/null +++ b/src/core/proto/oidb/Oidb.0x9067_202.ts @@ -0,0 +1,8 @@ +import { ScalarType } from "@protobuf-ts/runtime"; +import { ProtoField } from "../NapProto"; +import { MultiMediaReqHead } from "./common/Ntv2.RichMedia"; + +export const OidbSvcTrpcTcp0X9067_202 = { + ReqHead: ProtoField(1, () => MultiMediaReqHead), + DownloadRKeyReq: ProtoField(4, ScalarType.BYTES), +} \ No newline at end of file diff --git a/src/core/proto/oidb/Oidb.ed3_1.ts b/src/core/proto/oidb/Oidb.ed3_1.ts index 441b7335..355ea6af 100644 --- a/src/core/proto/oidb/Oidb.ed3_1.ts +++ b/src/core/proto/oidb/Oidb.ed3_1.ts @@ -1,6 +1,7 @@ import { ScalarType } from "@protobuf-ts/runtime"; import { ProtoField } from "../NapProto"; +// Send Poke export const OidbSvcTrpcTcp0XED3_1 = { uin: ProtoField(1, ScalarType.UINT32), groupUin: ProtoField(2, ScalarType.UINT32, false, true), diff --git a/src/core/proto/oidb/Oidb.fe1_2.ts b/src/core/proto/oidb/Oidb.fe1_2.ts index 414c66a6..0b2586e1 100644 --- a/src/core/proto/oidb/Oidb.fe1_2.ts +++ b/src/core/proto/oidb/Oidb.fe1_2.ts @@ -1,6 +1,7 @@ import { ScalarType } from "@protobuf-ts/runtime"; import { ProtoField } from "../NapProto"; + export const OidbSvcTrpcTcp0XEE1_2 = { uin: ProtoField(1, ScalarType.UINT32), key: ProtoField(3, ScalarType.BYTES, false, true), diff --git a/src/core/proto/oidb/common/Ntv2.RichMedia.ts b/src/core/proto/oidb/common/Ntv2.RichMedia.ts new file mode 100644 index 00000000..cea03121 --- /dev/null +++ b/src/core/proto/oidb/common/Ntv2.RichMedia.ts @@ -0,0 +1,84 @@ +import { ScalarType } from "@protobuf-ts/runtime"; +import { ProtoField } from "../../NapProto"; + + +export const NTV2RichMediaReq = { + ReqHead: ProtoField(1, ScalarType.BYTES), + DownloadRKeyReq: ProtoField(4, ScalarType.BYTES), +} +export const MultiMediaReqHead = { + Common: ProtoField(1, () => CommonHead), + Scene: ProtoField(2, () => SceneInfo), + Clent: ProtoField(3, () => ClientMeta), +} +export const CommonHead = { + RequestId: ProtoField(1, ScalarType.UINT32), + Command: ProtoField(2, ScalarType.UINT32), +} +export const SceneInfo = { + RequestType: ProtoField(101, ScalarType.UINT32), + BusinessType: ProtoField(102, ScalarType.UINT32), + SceneType: ProtoField(200, ScalarType.UINT32), +} +export const C2CUserInfo = { + AccountType: ProtoField(1, ScalarType.UINT32), + TargetUid: ProtoField(2, ScalarType.STRING), +} +export const GroupInfo = { + GroupUin: ProtoField(1, ScalarType.UINT32), +} +export const ClientMeta = { + AgentType: ProtoField(1, ScalarType.UINT32), +} +export const DownloadReq = { + Node: ProtoField(1, ScalarType.BYTES), + Download: ProtoField(2, ScalarType.BYTES), +} +export const FileInfo = { + FileSize: ProtoField(1, ScalarType.UINT32), + FileHash: ProtoField(2, ScalarType.STRING), + FileSha1: ProtoField(3, ScalarType.STRING), + FileName: ProtoField(4, ScalarType.STRING), + Type: ProtoField(5, ScalarType.BYTES), + Width: ProtoField(6, ScalarType.UINT32), + Height: ProtoField(7, ScalarType.UINT32), + Time: ProtoField(8, ScalarType.UINT32), + Original: ProtoField(9, ScalarType.UINT32), +} +export const IndexNode = { + Info: ProtoField(1, ScalarType.BYTES), + FileUuid: ProtoField(2, ScalarType.STRING), + StoreId: ProtoField(3, ScalarType.UINT32), + UploadTime: ProtoField(4, ScalarType.UINT32), + Ttl: ProtoField(5, ScalarType.UINT32), + subType: ProtoField(6, ScalarType.UINT32), +} +export const FileType = { + Type: ProtoField(1, ScalarType.UINT32), + PicFormat: ProtoField(2, ScalarType.UINT32), + VideoFormat: ProtoField(3, ScalarType.UINT32), + VoiceFormat: ProtoField(4, ScalarType.UINT32), +} +export const DownloadExt = { + Pic: ProtoField(1, ScalarType.BYTES), + Video: ProtoField(2, ScalarType.BYTES), + Ptt: ProtoField(3, ScalarType.BYTES), +} +export const VideoDownloadExt = { + BusiType: ProtoField(1, ScalarType.UINT32), + SceneType: ProtoField(2, ScalarType.UINT32), + SubBusiType: ProtoField(3, ScalarType.UINT32), +} +export const PicDownloadExt = {} +export const PttDownloadExt = {} +export const PicUrlExtInfo = { + OriginalParameter: ProtoField(1, ScalarType.STRING), + BigParameter: ProtoField(2, ScalarType.STRING), + ThumbParameter: ProtoField(3, ScalarType.STRING), +} +export const VideoExtInfo = { + VideoCodecFormat: ProtoField(1, ScalarType.UINT32), +} +export const MsgInfo = { + +} \ No newline at end of file