20261015

看frida文档才知道

1
The callbacks provided have a significant impact on performance. If you only need to inspect arguments but do not care about the return value, or the other way around, make sure you omit the callback that you don't need; i.e. avoid putting your logic in onEnter and leaving onLeave in there as an empty callback.

所以之前写的这种抽象算是浪费了很多性能:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  return Interceptor.attach(method.virtualAddress, {
    onEnter(args) {
      if (!quiet && (mod === undefined || mod.enabled)) {
        log(logEnter);
      }
      if (onEnter) {
        // InvocationContext 可能直接是 CpuContext 或持有 .context 字段,两者兜底
        const self = this as any;
        const ctx: CpuContext = self.context ?? self;
        const guardedEnter = mod ? guarded(mod, onEnter) : onEnter;
        guardedEnter(cls, method, args, ctx, self as InvocationContext);
      }
    },
    onLeave(retval) {
      if (onLeave) {
        const self = this as any;
        const ctx: CpuContext = self.context ?? self;
        const guardedLeave = mod ? guarded(mod, onLeave) : onLeave;
        guardedLeave(cls, method, retval, self as InvocationContext, ctx);
      }
      if (!quiet && (mod === undefined || mod.enabled)) {
        log(logReturn(retval));
      }
    },
  });

rdr2的赌徒挑战做的很烂,例如我现在在赌徒挑战8,它要求我在要牌3次以以上时获胜,但它又不考虑我过去的所有对局,这就会导致让我很容易想到特意来刷这种条件的胜场,即每局无脑要牌,20点了也继续要牌,只因为没达到要求;因为正常玩很难达成,我也不会特意在这个时间点因为瘾大来大力出奇迹。

而且荷官的ai也有问题,他不看场上局势停牌,他停牌只看自己牌的;典型例子就是我爆牌了,还有一个赌徒20点停牌,荷官会在17点直接停牌,明明正常人没理由会在这里停牌;感觉已经不是ai写的好坏的问题了,这种表现带来的出戏更让我不舒服。

Licensed under CC BY-NC-SA 4.0
使用 Hugo 构建
主题 Stack 由 Jimmy 设计