doicm

assembly learning day 2

Feb 25th, 2025
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.98 KB | None | 0 0
  1. Using cheat engine to find Battlemania value:
  2.  
  3. Process for searching for calculation:
  4. 1.) Search for string 'onRandom' when in area. Find one in the second set (there are two sets) and browse memory address.
  5. 2.) Scroll down and view -> display format (byte decimal). There'll be some values in a row (+328 offset) that look like i8BattleSituationRandom values from the btstab tables. Right-click and add address to list (got to be in that relevant bt scene).
  6. 3.) Right-click address in main table and see what accesses value. This value will be accessed whenever you enter an area, whether or not you draw that btscene.
  7. 4.) Hope for the best in seeing what's there.
  8.  
  9. Testing with Battlemania on:
  10. Breakpoint on access set on i8BattleSituationRandom0 in Bresha 005 AF (bjaa_box01_10).
  11. Found somewhere in hex where it somewhat mentions privilege14 and bjaa_box01_10. (the number 54 sticks out)
  12. At some point, it overwrites "privilege14." I don't know if that means it's successful or not. Let's see...
  13. I did get the rare encounter with privilege14. I wonder why it overwrote it. Let's try it without Battlemania on. One more test with Battlemania on to see offsets.
  14. Starts at ffxiii2img.exe+1ff02f. Begins overwriting privilege14 very shortly. Checking without.
  15.  
  16. Testing with Battlemania off:
  17. Breakpoint set at same spot.
  18. Same thing actually happens, where it overwrites privilege14. Interesting. 54 is also still there.
  19.  
  20. Testing in same bjaa_box, last btsc. Hoping that they're sequential, looks like it's at ffxiii2img.exe+1ff3cc. May all end at +1FF413?
  21. With Battlemania off, it still starts at the same spot.
  22.  
  23. Registers are the same at that first breakpoint with battlemania on before and after.
  24. Registers are NOT the same at second breakpoint at the last encounter check with battlemania off before and after, but that could mean a number of things. EBX and EBP are the checks.
  25. EBX, 0x87A and 0x14258D50 - off
  26. EBP, 0x6C and 0x116 - on
  27.  
  28. Maybe I should check testing with battlemania on and off before the 4% encounters to see if there's a difference. (EBP is different than before somehow, but oh well)
  29. EBX, 0x9E3 and 0x14258D50 - off
  30. EBP, 0x5A and 0x5A - on
  31.  
  32. That should help confirm this, at least: I don't believe Battlemania affects the i8BattleSituationRandom amount of non-rare monsters.
  33.  
  34. Is EDX = 0x1 the check for Battlemania being on? I think it might be.
  35.  
  36. EBP = 0xBD
  37. EBP = 0x68
  38.  
  39. I tested EBP, and it looks like that's the value affected by Battlemania. I'm not sure how yet, but when Battlemania is active, it increases EBP by a lot on the rare encounter slots only. It has no change on the non-rare encounter slots whether or not Battlemania is active.
  40.  
  41. Might've found the formula. EAX is given a random value *somehow* (not sure yet how), and then it goes through a switch statement, essentially. If the value is greater than EAX, it picks that encounter set.
  42.  
  43. Checking ESP location in memory after everything is run.... Okay, the 4% encounter checks can vary from area to area, but for Bresha Ruins 005 AF bjaa_box01_10, the checks are 189, 278, and 367 with Battlemania on and 104, 108, and 112 with Battlemania off. It looks like every encounter increments the previous value. Let me get the values of the tables.
  44.  
  45. bjaa_box01_10's table is 15, 15, 10, 10, 10, 15, 15, 10, 4, 4, and 4 normally.
  46. bjaa_box01_10's table increments show 15_30_40_50_60_75_90_100_104_108_112 with BM off.
  47. bjaa_box01_10's table increments show 15_30_40_50_60_75_90_100_189_278_367 with BM on.
  48.  
  49. It increases from 4% to 89%! That's huge!
  50.  
  51. I need to test in other areas, but I feel confident in this number.
  52.  
  53. I tested on gdza_box02_01 (a raining area in Archylte Steppe), and I found something interesting: 5% encounters are also affected by this.
  54.  
  55. gdza_box02_01's table increments show 20_60_80_95_185_274 with BM on.
  56. Shows that the 5% changed to a 90%.
  57.  
  58. I think I found my answer. I wish I kept better journaling, but this is all a learning process. This is day 2 of re-learning assembly/learning cheat engine.
Add Comment
Please, Sign In to add comment