function api_scheduleOnMainThread_delay(callback, args, delay) { setTimeout(function () { callback.apply(null, args); }, delay);}var CUser_OnItemUnlockWaitTimeout = new NativeFunction(ptr(0x8646912), "int", ["pointer"], { abi: "sysv" });/** * 设置装备解锁时间 */function set_equipment_unlock_time(second) { //std::_Rb_tree_iterator<std::pair<uchar const,stItemLockInfo>>::operator->(void) 085432CC Interceptor.attach(ptr(0x85432CC), { onEnter: function (args) {
}, onLeave: function (retval) { var time = retval.add(4).readU32() - 259200 + second; console.log("set_equipment_unlock_time: " + time + "s"); retval.add(4).writeU32(time); } });
//item_lock::CItemLock::DoItemUnlock(CUser *,int,int) 0854231A Interceptor.attach(ptr(0x854231A), { onEnter: function (args) { this.user = args[1]; }, onLeave: function (retval) { second > 0 ? api_scheduleOnMainThread_delay(CUser_OnItemUnlockWaitTimeout, [this.user], 1E3 * second) : CUser_OnItemUnlockWaitTimeout(this.user); } });}