diff --git a/src/core/external/offset.json b/src/core/external/offset.json index 6154762a..c0c892ce 100644 --- a/src/core/external/offset.json +++ b/src/core/external/offset.json @@ -402,5 +402,17 @@ "3.2.18-35951-x64": { "send": "AFBBB00", "recv": "AFBF520" + }, + "9.9.20-36580-x64": { + "send":"30824B8", + "recv":"3085C5C" + }, + "3.2.18-36580-x64": { + "send": "B0853E0", + "recv": "B088E60" + }, + "3.2.18-36580-arm64": { + "send": "793DAC8", + "recv": "7941458" } } \ No newline at end of file diff --git a/src/core/packet/client/nativeClient.ts b/src/core/packet/client/nativeClient.ts index bb0ec2e2..6be15231 100644 --- a/src/core/packet/client/nativeClient.ts +++ b/src/core/packet/client/nativeClient.ts @@ -40,7 +40,8 @@ export class NativePacketClient extends IPacketClient { async init(_pid: number, recv: string, send: string): Promise { const platform = process.platform + '.' + process.arch; - const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/MoeHoo.' + platform + '.node'); + const isNewQQ = this.napcore.basicInfo.requireMinNTQQBuild("36580"); + const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/MoeHoo.' + platform + (isNewQQ ? '.new' : '') + '.node'); process.dlopen(this.MoeHooExport, moehoo_path, constants.dlopen.RTLD_LAZY); this.MoeHooExport.exports.InitHook?.(send, recv, (type: number, _uin: string, cmd: string, seq: number, hex_data: string) => { diff --git a/src/core/packet/context/napCoreContext.ts b/src/core/packet/context/napCoreContext.ts index 15209bff..ff7faa75 100644 --- a/src/core/packet/context/napCoreContext.ts +++ b/src/core/packet/context/napCoreContext.ts @@ -1,6 +1,7 @@ import { NapCatCore } from '@/core'; export interface NapCoreCompatBasicInfo { + readonly requireMinNTQQBuild: (buildVer: string) => boolean; readonly uin: number; readonly uid: string; readonly uin2uid: (uin: number) => Promise; @@ -21,6 +22,7 @@ export class NapCoreContext { get basicInfo() { return { + requireMinNTQQBuild: (buildVer: string) => this.core.context.basicInfoWrapper.requireMinNTQQBuild(buildVer), uin: +this.core.selfInfo.uin, uid: this.core.selfInfo.uid, uin2uid: (uin: number) => this.core.apis.UserApi.getUidByUinV2(String(uin)).then(res => res ?? ''), diff --git a/src/native/packet/MoeHoo.win32.x64.new.node b/src/native/packet/MoeHoo.win32.x64.new.node new file mode 100644 index 00000000..d70d3cae Binary files /dev/null and b/src/native/packet/MoeHoo.win32.x64.new.node differ