出招分析_侍魂2

分析过程
  • 从网上下载侍魂2简化出招的rom

  • 对比原版rom找到6cb22这个地方有修改
    原始6cb22:0F 08 00 00 0F 02 00 11 0F 0A 00 11 30 10 00 11 00 00 00 00
    修改6cb22:00 00 00 00 F0 A0 00 11 00 00 00 00 30 00 00 11 00 00 00 00

  • 0006 CB22 0026 0001
    6cb22是地址;0026是出招id;0001是标志判断目前不清楚;

  • 0F08 0000 0F02 0011 0F0A 0011 3010 0011 0000 0000
    0F08是右;0F02是下;0F0A是右下;3010是轻拳;0000 0000是结束

  • 人物出招列表 上边6CAAA不对应该是6CA7A

  • 回到mame 模拟器 wp 6cb22,1,r 监视并断点到3184e

  • 打开ida 开始分析

  • 通过mame单步调试分析到31884 地方时候,发现这个地方只有出招的时候才会走。

  • 进入318CE之后注意a3 会跳转到下边的代码的


    上边这段是关键分析,得出一下信息
  • a6或者是a3结构体的偏移f4的地方会被写入技能id 26

实现过程
  • 观察每个结构体结构

想到就是每个对象的占大小0x120,并且每个对象结构体第一位是表示类型,通过观察发现player0 的对象结构体开头是0002;然后是5314 302D是唯一,可以通过一个for循环判断

while (true) {
                                for (int i = 0x102fc0; i < 0x105de0; i = i + 0x120) {
                                    final int player0 = NativeUtils.readMemary(i + 1);
                                    if (player0 == 2) {
                                        int player = NativeUtils.readMemary(i + 4);
                                        if (player == 0x30) {
                                            currentAddr = i;
                                            break;
                                        }
                                    }
                                }
                                Logger.e("addr:" + currentAddr);
                                int ret = NativeUtils.readMemary(0x100D0B);
                                Logger.e("id:" + ret);
                                if (currentId != ret) {
                                    currentId = ret;
                                    combineView.post(new Runnable() {
                                        @Override
                                        public void run() {
                                            combineView.addDatas(pluginEntryView.getList(currentId + 100));
                                        }
                                    });
                                }
                                try {
                                    Thread.sleep(4000);
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }
                            }

"0x10801B, 0x09"="天霸封神斩"
"0x10802A, 0x09"="奥义烈震斩"

分析2从mame的金手指分析得出
<cheat desc="Infinite Energy PL2">
    <script state="run">
      <action>maincpu.pb@((maincpu.pd@100A4A)+BB)=80</action>
    </script>
  </cheat>

  <cheat desc="Drain All Energy Now! PL2">
    <script state="on">
      <action>maincpu.pb@((maincpu.pd@100A4A)+BB)=00</action>
    </script>
  </cheat>

  <cheat desc="Always have Maximum Power PL2">
    <script state="run">
      <action>maincpu.pb@((maincpu.pd@100A4A)+F0)=20</action>
    </script>
  </cheat>

  <cheat desc="Always have Minimum Power PL2">
    <script state="run">
      <action>maincpu.pb@((maincpu.pd@100A4A)+F0)=00</action>
    </script>
  </cheat>
image.png

105960 是对象player0;
所以实现方式

int big = NativeUtils.readMemary(0x100a47)<<16;
                                int medium = NativeUtils.readMemary(0x100a48)<<8;
                                int low = NativeUtils.readMemary(0x100a49);
                                currentAddr = big+medium+low;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值