View Single Post
  #23    
Old June 18th, 2012 (08:51 AM). Edited June 18th, 2012 by Nerketur.
Nerketur's Avatar
Nerketur Nerketur is offline
PokéScripter
 
Join Date: Nov 2010
Location: Cyberspace
Gender: Male
Nature: Quirky
Posts: 102
Quote originally posted by Kindrindra:
If this seems like a noobie question- well, it kinda is. ._.


Um. I've been trying to figure out the hex in the m_attack.bin file and monster.bin file... but I'm a little lost. I noticed that both Sky and Time/Darkness have a pretty regular pattern of two zeros, then two numbers, then back (Though the pattern does seem to break down later), but... That's about it. I'm guessing that the numbers are things like the move's power and accuracy and suchforth, and the zeros are flags, but I can't find where one move ends and the next begins. ._.
As for the pattern, it looks like offsets to a different spot in the ROM. The offset being an integer. So each attack has an offset. For example:
Code:
00 00 00 00 51 02 00 00 C0 12 00 00
To me, that pattern tells us a few things.
  • The offsets take up 4 bytes each
  • Given how numbers are stored, and that it's 4 bytes, the numbers are in "reverse" order.
  • There SHOULD be the same number of offsetts as "attacks"
So, given that... we know 00000000 (0) is the beginning of the file. So... it's certainly not the base. How about the second offset?


51 02 00 00 -> 00000251 = 0x251 = 512 + 50 + 30 + 1 = 593.



So where does that lead us? Ack! It leads to the middle of another offset! Now, what do we know? There's a pattern of offsetts, but what comes after them? Are they ALL offsets? Lets take a closer look at all the "integers"
Code:
00 00 00 00
51 02 00 00
C0 12 00 00
F1 2F 00 00
C0 42 00 00
FA 31 00 00
C0 74 00 00
06 3E 00 00
D0 B2 00 00
E2 3D 00 00
C0 F0 00 00
42 37 00 00
10 28 01 00
C2 3A 00 00
E0 62 01 00
AC 4A 00 00
90 AD 01 00
48 2B 00 00
E0 D8 01 00
A3 3A 00 00
Hmm... Now it doesn't look like everything is an offset, does it? What if I do this?
Code:
00 00 00 00  51 02 00 00
C0 12 00 00  F1 2F 00 00
C0 42 00 00  FA 31 00 00
C0 74 00 00  06 3E 00 00
D0 B2 00 00  E2 3D 00 00
C0 F0 00 00  42 37 00 00
10 28 01 00  C2 3A 00 00
E0 62 01 00  AC 4A 00 00
90 AD 01 00  48 2B 00 00
E0 D8 01 00  A3 3A 00 00
We don't know much... but there IS a pattern! The first number seems to be an offset , and the second...could be those flags. Changing the number of columns, and spacing allows us to see that the second "integer" always has two bytes, and then two 0 bytes. This is ALWAYS true. What this could mean is the moves are always 6 bytes, then separated by two null bytes.


I honestly don't know if it helps at all, but that was my thought process from the beginning to now. Learning how to interpret Hex data, is like looking through a random stack of papers, finding patterns, then seeing if these patterns make sense. For example, what I'd do next is simple. If they really are offsets, then I'd test it out more. For example, at the end of this offset table, there are FF bytes, then the beginning of some data. Maybe the first part of this data is offset 0? So is the next part at offset 0x12C0? Trial and eror from there. Eventually, I'd try to figure out exactly how big the first attack is from other clues, and see if it matches anything I know. I hope this helps in your venture =D


And actually, I may research further, and eventually create an attack modifier (This is all from m_attack.bin) It is certainly interesting!


Note: All of this is speculation on my part. I could certainly be wrong. And if I am, I would love for someone to be able to correct me! =D

Edit: As it seems, I'm only partly wrong!
The format is as follows:
0x0000 integer(4): offset (of table/base) (always 0?)
0x0004 integer(4): number of entries in table.
0x0008 (numEntries*8): entries
(numEntries*8) integer(4): padding (0)

Entries: base entryLocation:
0x0000 integer(4): offset to attack data
0x0004 Integer(4): Attack data length

Attack Data is still unknown, however. Hope this is helpful =P
__________________
Want my help in PokéScripting? PM me =)
I use XSE v1.1.1 (HackMew = awesome) and Advance Map 1.92.
Thanks to Diego and HackMew for their tutorials, helping me learn how to script!

Hacks I support 100% (MUST SEE!):


Very well made hacks:

My work:
Figuring out scripting in PMD
Entire script map of LeafGreen
PMDSE (Pokémon Mystery Dungeon Script Editor)
Reply With Quote