This commit is contained in:
Lenheart 2026-03-15 01:24:56 +08:00
parent d0822165e6
commit 17792f354f
4 changed files with 209 additions and 1 deletions

View File

@ -92,8 +92,173 @@ function L_drawMainCustomUI_All() {
// print(sq_GetObjectId(obj))
// print(Clock());
// Rindro_Image_GlobalMap["interface/newstyle/windows/popup/popup.img"].DrawExPng(138, 205, 0, 0, sq_RGBA(255, 255, 255, 250), 13.0, 13.0);
local attackInfo = sq_GetCustomAttackInfo(obj, 0);
sq_SetAttackInfoHitDelayRateDamager(attackInfo, 4.2);
// sq_SetCurrentAttackBonusRate(attackInfo, 4812);
// sq_SetCurrentAttacknUpForce(attackInfo, 41918);
// sq_GetAttackInfoHitDelayRateDamager(attackInfo);
local AtkC = L_sq_P2I(attackInfo["__ot"][28259608]);
// sq_SetChangeStatusIntoAttackInfoWithEtc(attackInfo, 0, 10, 50, 150, 140, 49, 0);
// print(attackInfo["__ot"][28259608])
// for (local i = 0; i< 8000; i++) {
// local Ret = DATK(AtkC, i).readFloat();
// if (Ret == 50.0)
// {
// print("找到了! " + format("当前遍历: 0x%02x\n", i));
// }
// }
// for (local i = 0; i< 18000; i++) {
// local Ret = NativePointer(AtkC + i).readFloat();
// if (Ret == 41590.0)
// {
// print("找到了! " + format("当前遍历: 0x%02x\n", i));
// }
// }
//[human damage rate]
// print(DATK(AtkC, 0x294).readFloat());
//[fort damage rate]
// print(DATK(AtkC, 0x2A0).readFloat());
//[monster damage rate]
// print(DATK(AtkC, 0x2AC).readFloat());
//[critical hit]
// print(DATK(AtkC, 0x68).readFloat());
//[damage]
// print(DATK(AtkC, 0x0).readFloat());
//[damage bonus]
// print(DATK(AtkC, 0x24).readInt());
//[absolute damage]
// print(DATK(AtkC, 0x18).readInt());
//[damage reaction]
// print(NativePointer(AtkC + 0x4C).readInt());
//[knuck back]
// print(DATK(AtkC, 0x8C).readInt());
//ACTIVESTATUS_SLOW
// print(DATK(AtkC, 0x1c8).readFloat());
// print(DATK(AtkC, 0x1ec).readInt());
// print(DATK(AtkC, 0x234).readInt());
// print(NativePointer(AtkC + 0x1BC).readInt());
// print(NativePointer(AtkC + 4 * (3 * 0 + 444)).readInt());
// print(DATK(AtkC, 0x234 + 0x4 + 0x4 + 0x4).readInt());
// print(DATK(AtkC, 0x19C).readInt());
// print(DATK(AtkC, 0x1A4).readInt());
// local WriteIntData = Memory.alloc(4);
// WriteIntData.writeFloat(756.4);
// MemoryTool.EncodeMemoryData(AtkC + 0x294, WriteIntData.readInt());
// local Ret = MemoryTool.DecodeMemoryDataF(AtkC + 0x10c);
// print(Ret)
// // secondTable 是一个指针,需要先读取它的值
// local secondTablePtr = 0x1AF8D78 + 4 * tableIndex + 36;
// local secondTable = NativePointer(secondTablePtr).readInt();
// local verifyValueAddr = secondTable + 4 * entryIndex + 0x2114;
// local verifyValue = NativePointer(verifyValueAddr).readInt();
// print("verifyValue: " + verifyValue);
// local verifyValue = GetObjectVerifyValue(*this_ptr);
// print(attackInfo["__ot"][28259608]);
// local Ret = L_Sq_CallFunc(0x5AE1E0, "float", FFI_MS_CDECL, ["int"], AtkC);
// local result = Memory.alloc(4);
// L_Sq_CallFunc(0x1195EB0, "void", FFI_FASTCALL, ["int", "int", "int", "pointer"], AtkC + 0X104, 0, AtkC + 0x10c, result.C_Object);
// print(result.C_Object);
// L_Sq_CallFunc(0x1195E40, "int", FFI_FASTCALL, ["int", "int", "int", "pointer"], AtkC + 0x30, 0, AtkC + 0x38, result.C_Object);
// print(result.readShort());
// print(result.C_Object);
// print(result.readInt());
// local result = Memory.alloc(4);
// L_Sq_CallFunc(0x1195EB0, "void", FFI_FASTCALL, ["int", "int", "int", "pointer", "int"], AtkC + 0x330, 0, AtkC + 0x338, result.C_Object, 0);
// print(result.readInt());
// print(L_sq_Test(AtkC));
// local keyTable = NativePointer(tableBase + 4 * tableIdx + 36).readInt();
// print("keyLow: " + keyLow + " xorMask: " + xorMask + " decryptedValue: " + decryptedValue);
// print(NativePointer(decryptedValue).readFloat());
// local decryptedLow = decryptedValue & 0xFFFF;
// local decryptedHigh = (decryptedValue >> 16) & 0xFFFF;
// local checksum = keyLow ^ (decryptedLow + decryptedHigh);
// local resultPtr = Memory.alloc(4);
// L_Sq_CallFunc(0x1195EB0, "void", FFI_STDCALL, ["int", "pointer"], Data, resultPtr.C_Object);
// print(resultPtr.readFloat());
}
function DATK(AtkC, Offset) {
// 读取 ObjectId
local ObjectIdPtr = NativePointer(AtkC + Offset);
local ObjectId = ObjectIdPtr.readInt();
// 读取 base1 (全局表)
local base1Ptr = NativePointer(0x1AF8D78);
local base1 = base1Ptr.readInt();
// 计算并读取二级表
local offset_high = 4 * ((ObjectId >> 16) & 0xFFFF);
local addr1 = base1 + offset_high + 0x24;
local base2Ptr = NativePointer(addr1);
local base2 = base2Ptr.readInt();
// 计算并读取 verifyValue
local offset_low = 4 * (ObjectId & 0xFFFF);
local addr2 = base2 + offset_low + 0x2114;
local verifyValuePtr = NativePointer(addr2);
local verifyValue = verifyValuePtr.readInt();
// 读取输入值
local inputAddr = AtkC + Offset + 0x8;
local inputPtr = NativePointer(inputAddr);
local inputValue = inputPtr.readInt();
// 解密
local lowWord = verifyValue & 0xFFFF;
local expanded = (lowWord << 16) | lowWord;
local decrypted = inputValue ^ expanded;
local Res = Memory.alloc(4);
Res.writeInt(decrypted);
return Res;
}
// for (local i = 0; i < 42; i++) {

View File

@ -1174,7 +1174,6 @@
},
"宽屏UI": {
"Private": true,
"Enabled": false,
"Script": [
"Project/HudUi/HudUi.nut"
],

View File

@ -53,6 +53,34 @@ function sq_SetObjectAbilityFloatWithDecrypt(obj, ObjectAddressOffset, Value) {
//[human damage rate]
// print(DATK(AtkC, 0x294).readFloat());
//[fort damage rate]
// print(DATK(AtkC, 0x2A0).readFloat());
//[monster damage rate]
// print(DATK(AtkC, 0x2AC).readFloat());
//[critical hit]
// print(DATK(AtkC, 0x68).readFloat());
//[damage]
// print(DATK(AtkC, 0x0).readFloat());
//[damage bonus]
// print(DATK(AtkC, 0x24).readInt());
//[absolute damage]
// print(DATK(AtkC, 0x18).readInt());
//[damage reaction]
// print(NativePointer(AtkC + 0x4C).readInt());
//[knuck back]
// print(DATK(AtkC, 0x8C).readInt());
function sq_GetCurrentAttackInfoDamage(attackInfo) {
local AtkC = L_sq_P2I(attackInfo["__ot"][28259608]);
local Res = MemoryTool.DecodeMemoryData(AtkC + 0x0);
@ -69,3 +97,16 @@ function sq_SetCurrentAttackInfoDamage(attackInfo, damage) {
B.seek(0);
MemoryTool.EncodeMemoryData(AtkC + 0x0, B.readn('i'));
}
function sq_GetCurrentAttackInfoAbsoluteDamage(attackInfo)
{
local AtkC = L_sq_P2I(attackInfo["__ot"][28259608]);
local Res = MemoryTool.DecodeMemoryData(AtkC + 0x18);
return Res;
}
function sq_SetCurrentAttackInfoAbsoluteDamage(attackInfo, damage)
{
local AtkC = L_sq_P2I(attackInfo["__ot"][28259608]);
MemoryTool.EncodeMemoryData(AtkC + 0x18, damage);
}

View File

@ -256,5 +256,8 @@
},
"Project/CustomPlugins": {
"description": "定制插件"
},
"Project/OutfitSystem": {
"description": "换装系统"
}
}