人物車のハンドルの取り方

Last-modified: 2023-12-16 (土) 01:25:04

CLEO+を使える場合

0EA7: get_any_char_no_save_recursive 1@ progress_to 2@ char_to 3@ // 人
0EA8: get_any_car_no_save_recursive 1@ progress_to 2@ car_to 3@ // 車
0EA9: get_any_object_no_save_recursive 1@ progress_to 2@ object_to 3@ // 物

1@が初期値、2@が進行度、3@がハンドルです。
全て探索したい場合は初期値は0にしましょう。

以下のようにwhileの条件として使います。

1@ = 0
while 0EA7: get_any_char_no_save_recursive 1@ progress_to 2@ char_to 3@
    ...
end

古い方法 (CLEO+を使えない場合)

使用する変数は26@27@28@、26@がハンドル。
■人

  :get_actor
  0A8D: 27@ = read_memory 0xB74490 size 4 virtual_protect 0
  000A: 27@ += 0x4
  0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
  for 28@ = 0 to 35584 step 0x100
      0A8D: 26@ = read_memory 27@ size 1 virtual_protect 0
      000A: 27@ += 0x1
      if and
      0029:   26@ >= 0x00
      001B:   0x80 > 26@
      then
          005A: 26@ += 28@ // (int)
          if
          056D: (check) actor 26@ defined
          then
          end
      end
  end
  return

■物

  :get_obj
  0A8D: 27@ = read_memory 0xB7449C size 4 virtual_protect 0
  000A: 27@ += 0x4
  0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
  for 28@ = 0 to 89344 step 0x100
      0A8D: 26@ = read_memory 27@ size 1 virtual_protect 0
      000A: 27@ += 0x1
      if and
      0029:   26@ >= 0x00
      001B:   0x80 > 26@
      then
          005A: 26@ += 28@ // (int)
          if
          03CA: (check) object 26@ exists
          then
          end
      end
  end
  return

■車

  :get_car
  0A8D: 27@ = read_memory 0xB74494 size 4 virtual_protect 0
  000A: 27@ += 0x4
  0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
  for 28@ = 0 to 27904 step 0x100
      0A8D: 26@ = read_memory 27@ size 1 virtual_protect 0
      000A: 27@ += 0x1
      if and
      0029:   26@ >= 0x00
      001B:   0x80 > 26@
      then
          005A: 26@ += 28@ // (int)
          if
          056E: (check) car 26@ defined
          then
          end
      end
  end
  return