News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: How can a debugger help? Also relative(or some other) search question.  (Read 1887 times)

CDiablo

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
So Im working on some pc engine stuff. Im using OOtake which has a debugger. I don't really understand what it does or how to use it to help me. Is there any docs on using/reading a debugger?

Also I was wondering if there is any searching utility that can search for patterns. Say there are 2 lines of dialogue that are the same but I dont have a table, nor am i sure what order the letters are in(for this we assume the letters are not in order ie a=01 b=02). For example one line says wxyrfxnw and another says wxlzxow. I am looking for a way to search for where xy**x*y(x and y are just variables to say they match their counterparts). So then I can search for all instances of any 7 digit string where the 1st digit matches the 5th and the 2nd matches 7th.

The game I am working on has a page where there is a game start screen, first line says choose level, second line says password enter and the 3rd says password current all in Japanese. The word password, as it is written is 6 digits long so I am looking for all instances where there are consecutive 6 digits that match another 6 consecutive digits.

So is there a program/hex editor that can do this. Thanks all.

Jorpho

  • Hero Member
  • *****
  • Posts: 4193
  • The cat screams with the voice of a man.
    • View Profile
So Im working on some pc engine stuff. Im using OOtake which has a debugger. I don't really understand what it does or how to use it to help me. Is there any docs on using/reading a debugger?
Someone can correct me if I get this wrong, but a debugger allows you to view what the system's CPU is doing step-by-step.  Typically, one might configure a debugger to pause execution of the program when the CPU writes to a segment of memory corresponding to a particular location of the string.  One can then, in theory, use the debugger to step backwards through the previously-executed CPU instructions to determine, for instance, the location in the ROM the CPU obtained the value that it wrote to that segment of memory.

Of course, this all gets dreadfully complicated very quickly because assembly language is hard and the CPU might be doing a whole bunch of different things between when it reads that location in the ROM and when it writes that segment of memory.

Quote
Also I was wondering if there is any searching utility that can search for patterns. Say there are 2 lines of dialogue that are the same but I dont have a table, nor am i sure what order the letters are in(for this we assume the letters are not in order ie a=01 b=02). For example one line says wxyrfxnw and another says wxlzxow. I am looking for a way to search for where xy**x*y(x and y are just variables to say they match their counterparts). So then I can search for all instances of any 7 digit string where the 1st digit matches the 5th and the 2nd matches 7th.
That is indeed a "relative search", as suggested by your subject line.  Numerous utilities have that capability.

Quote
The game I am working on has a page where there is a game start screen, first line says choose level, second line says password enter and the 3rd says password current all in Japanese. The word password, as it is written is 6 digits long so I am looking for all instances where there are consecutive 6 digits that match another 6 consecutive digits.
It could well be that the word "password" is stored as a graphic rather than as six characters that are subsequently rendered as a font.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

CDiablo

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
That is indeed a "relative search", as suggested by your subject line.  Numerous utilities have that capability.

Maybe I am not making myself clear. If I am searching for 4 character string(japanese symbol a)(japanese symbol b)(japanese symbol a)(japanese symbol b). Now I cant(or don't know how to) relative search xyxy(or 1212, etc) because that would look for instances of: (hex)(hex+1)(hex)(hex+1). I want to search for instances where I get(hex a)(hex b)(hex a)(hex b) no matter how far apart the numbers are.

So for my password example(you may be correct that it could be a graphic) I am searching for all instances where 6 variables match another 6 variables in the same order. I know results would yield a ton of 000000000000 type strings and thats ok, I don't mind digging through that to see if I can find what I want to find.

Forgive me if I don't know how to search for this correctly, but I've been through quite a bit of the reading material and through a bunch of programs and haven't found this type of search.

Jorpho

  • Hero Member
  • *****
  • Posts: 4193
  • The cat screams with the voice of a man.
    • View Profile
Now I cant(or don't know how to) relative search xyxy(or 1212, etc) because that would look for instances of: (hex)(hex+1)(hex)(hex+1).
...No it wouldn't?  A relative search for xyxy will also match 1212 or 3939 or m!m! or any other four-byte string where the first and third bytes are the same and the second and fourth bytes are the same. 

Or at least, that's what I've always understood.  Certainly, there are games where the hexadecimal representation of A isn't necessarily one less than the hexadecimal representation of B, nor is there any reason it has to be.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

CDiablo

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
...No it wouldn't?  A relative search for xyxy will also match 1212 or 3939 or m!m! or any other four-byte string where the first and third bytes are the same and the second and fourth bytes are the same.

Sadly this is not the case if I relative search PASSWORD it will look for all instances of P(any hex digit)A(-11 of original number)S(+3 of original #)S(+3)W(+7)O(-1)R(+2)D(-7) not: (variables) ABCCDXYZ. Realtive search is awesome and has been very useful cause typically things in the English language are in order. You can do 1*1* which will result in 1212, 3939 or m!m! as in your example. Unfortunately you only get one wildcard use so you are limited to searching for strings involving 2 variables. I havent had any luck with this kind of search using spaces as well so if I had LEMML(assume these characters are numbered in order) using a search of 1 **1 has not worked for me.

Jorpho

  • Hero Member
  • *****
  • Posts: 4193
  • The cat screams with the voice of a man.
    • View Profile
Sadly this is not the case if I relative search PASSWORD it will look for all instances of P(any hex digit)A(-11 of original number)S(+3 of original #)S(+3)W(+7)O(-1)R(+2)D(-7) not: (variables) ABCCDXYZ.
...Huh, that is indeed what it says at http://www.romhacking.net/dictionary/?page=dictionary#term24 , but I could have sworn I had seen a reference that teaches differently. 

This shall drive me suitably nuts.  Maybe it was Hexposure?  Or maybe it was either Scan Relative or Value Scan Relative in Transhexlation.

EDIT: It's coming back to me now.  Look for the graphics corresponding to the Japanese font used for whatever "password" is, and replace them with English characters in alphabetical order.  Then do a relative search.
« Last Edit: June 29, 2015, 12:11:59 am by Jorpho »
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

CDiablo

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
I will give that a try once I find or make a program that can view PCE/T16 graphics properly. I cant find a setting to view most PCE games sprites correctly.