Announcement

Collapse
No announcement yet.

Branch Finder

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Branch Finder

    Branch Finder v2.3

    This program allows you to extract all branches from a supported log file type, and display them for easy viewing on the left. It also finds any redundant branch to addresses, and lists them on the right. The overall goal of this project was to make code types that are sometimes based on sequenced branch control easier to identify (Hit Anywhere, Collect Anywhere, Walk Through Anything, Invincibility, etc...) Also, the new addition of the Branch Log Analyzer and Branch Log Compare should also make life easier for those looking for hidden debug/secret options within games due to its ability to classify branches by execution throughout a given log file, along with comparing two log files for execution path differences.

    Preview:







    Features:
    • Multiple Log File Types (Use the existing presets and even add your own on the fly!)
    • Ability to edit the supported types XML to keep the application current to your desired setup (Requires Regex Knowledge).
    • Auto Detect Log File Types
    • Branch Extraction (with counts)
    • Redundant Branch To Address Extraction (with counts)
    • Displays statistics on branch activity throughout the file (optional) (Executed, True, False).
    • Analyzed Data (Detects Branch Always, Never, and Sometimes based execution within the log file into organized lists)
    • Log Compare (Allows you to compare the currently loaded log file to another log file to easily spot the differences between the two of the same execution count. Also lists exclusive branches per log file.)
    • Common Address Multi-Selection
    • Search (with Multi-Selection)
    • Copy Options (Line Address, or "Branch To" Address)
    • Selection Counts (Lets you know if there is more outside the viewing area.)
    • Drag and Drop Support
    • Save Options


    Requires:

    .Net Framework 4.0


    What is regex you may ask?

    "A regular expression is a specific pattern that provides concise and flexible means to "match" (specify and recognize) strings of text, such as particular characters, words, or patterns of characters."

    Wikipedia (Full Explanation)

    Well that's fine, but what is required of the regex pattern I make?

    You need to define a regex pattern that will group the Address, Type, and BranchTo Address into groups. Examples have been provided in the LogTypes.xml for some of the more popular systems.

    Why doesn't my pattern match any branch lines in my log file?

    - Make sure your pattern is referencing upper case characters as the program automatically converts the whole file to uppercase upon load.
    - Make sure your pattern returns results in one of the listed test sites below.
    - Post your regex pattern in a reply to this thread if you can't get it figured out.

    Example Pattern:

    Code:
    [COLOR="#0000FF"]Log Branches: [/COLOR]                                                                              
    12346  BLE  $1234A     
    1235B  BGT  $12360   
    124AB  BLT  $124B4                    
    
    [COLOR="#0000FF"]Pattern: [/COLOR]
    ^[COLOR="#FF0000"]([A-F0-9]{5})[/COLOR]\s{2}[COLOR="#FF0000"](B..)[/COLOR]\s{2}\$[COLOR="#FF0000"]([A-F0-9]{5})[/COLOR] 
    
    [COLOR="#0000FF"]Group Matches:[/COLOR]
    [B]1:[/B] 12346    [B]2:[/B] BLE    [B]3:[/B] 1234A
    [B]1:[/B] 1235B    [B]2:[/B] BGT    [B]3:[/B] 12360
    [B]1:[/B] 124AB    [B]2:[/B] BLT    [B]3:[/B] 124B4
    Analyze Distance
    This property is used to determine how many lines down to look to see if the branch completed. This can vary per asm type, and can be defined similar to the following example:

    Code:
    <Log Type="MAME: SH-#/RISC" [COLOR="#0000FF"]AnalyzeDistance="2"[/COLOR]>
        <Pattern>^[COLOR="#FF0000"]([0-9A-F]{8})[/COLOR]\:\s[COLOR="#FF0000"](B..)[/COLOR]{1,5}.*\$[COLOR="#FF0000"]([0-9A-F]{8})[/COLOR]</Pattern>
    </Log>
    If the value is not defined, then the default value of 1 will be used by the application.

    Having problems creating your own regex? Look below for help:

    Regex Introduction (Decent basic introduction to Regular Expressions)
    Rubular.com (Best place I know of to test your regex patterns, and also has a nice reference at the bottom.)
    RegExr (Yet another testing area, but has a lot more community examples to work with.)
    Google (Search here if you need more information or tutorials.)

    I'm stuck. HELP!

    Attach your log file to this thread, and I will do my best to make an appropriate regex pattern for it.
    Attached Files
    Last edited by Abystus; 02-14-2013, 02:06:43 AM.
    Not taking any requests at this time.

    Bored? Watch some of my hacks here.

  • #2
    Updated to version 1.1. Added "Auto Detect Log File Types", and normalized text display to increase search accuracy as some log files were in mixed case.
    Last edited by Abystus; 06-08-2012, 02:10:24 AM.
    Not taking any requests at this time.

    Bored? Watch some of my hacks here.

    Comment


    • #3
      Sounds like a good idea. If you could add support for Gens Tracer (68000), that would be great.
      Attached Files
      Last edited by Tony H; 06-07-2012, 09:53:27 PM.
      The Code Hut: http://codehut.gshi.org/

      Comment


      • #4
        Originally posted by Tony Hedstrom View Post
        Sounds like a good idea. If you could add support for Gens Tracer (68000), that would be great.
        Released version 1.2. Added support for Gens Tracer log files. I only had the one provided, so if you could test with other logs from that emulator it would be appreciated.
        Last edited by Abystus; 06-07-2012, 10:33:34 PM.
        Not taking any requests at this time.

        Bored? Watch some of my hacks here.

        Comment


        • #5
          Thanks for the quick update.

          When I click on your attachment (BranchFinder.zip) to download it, I get this: Invalid Attachment specified. If you followed a valid link, please notify the administrator
          The Code Hut: http://codehut.gshi.org/

          Comment


          • #6
            Originally posted by Tony Hedstrom View Post
            Thanks for the quick update.

            When I click on your attachment (BranchFinder.zip) to download it, I get this: Invalid Attachment specified. If you followed a valid link, please notify the administrator
            Hmm working fine for me. Can you give it another shot?
            Not taking any requests at this time.

            Bored? Watch some of my hacks here.

            Comment


            • #7
              Works now. Thanks again. Will let you know how it works.
              The Code Hut: http://codehut.gshi.org/

              Comment


              • #8
                I've been manually doing something similar in looking for PS3 game codes. Search for branches that only branch if <= or >= that only jump maybe 5 lines at the most, and make sure 1 line within the 7 lines after the branch is a store operation. It's a great way of finding limits if only I could make AutoHotKey do it for me. There's also hunting for branches that are never taken, which who knows what those ever do. I only ever remember seeing 2 codes for Dynasty Warriors 6 I ported that were branches never taken without referrers, and those were extreme effects.
                July 7, 2019

                https://www.4shared.com/s/fLf6qQ66Zee
                https://www.sendspace.com/file/jvsdbd

                Comment


                • #9
                  Abystus, I tried version 1.2 on a couple more large Gens Tracer log files and it worked fine. Thanks.
                  The Code Hut: http://codehut.gshi.org/

                  Comment


                  • #10
                    Originally posted by Tony Hedstrom View Post
                    Abystus, I tried version 1.2 on a couple more large Gens Tracer log files and it worked fine. Thanks.
                    I'm glad it worked for you. Thanks again for testing it.
                    Not taking any requests at this time.

                    Bored? Watch some of my hacks here.

                    Comment


                    • #11
                      This might sound dumb, but does this read a text file that was outputted from something and list all of the branches from it?
                      July 7, 2019

                      https://www.4shared.com/s/fLf6qQ66Zee
                      https://www.sendspace.com/file/jvsdbd

                      Comment


                      • #12
                        Originally posted by bungholio View Post
                        This might sound dumb, but does this read a text file that was outputted from something and list all of the branches from it?
                        Basically it opens a trace log file (emulators generate these when tracing to a breakpoint), and finds all the branches (these are unique for speed) in the file. It then lists addresses with similar "branch to" addresses on the right side (these are unique for speed). It is by no means a replacement for actually looking at the log (the app doesn't follow the log word for word due process time of these large files), but it will give the user an idea of where to start looking for hacks that involve multiple branches to the same address (either branch over or branch under).
                        Last edited by Abystus; 06-10-2012, 02:45:58 PM.
                        Not taking any requests at this time.

                        Bored? Watch some of my hacks here.

                        Comment


                        • #13
                          Updated to version 1.3. Added support for MAME (V30 Variants) and MESS (GBA ARM7) log types.
                          Not taking any requests at this time.

                          Bored? Watch some of my hacks here.

                          Comment


                          • #14
                            Updated to version 1.4. Added support for MESS (GB/GBC/GG/SMS Z80) along with listing the log file currently open within the window title.
                            Not taking any requests at this time.

                            Bored? Watch some of my hacks here.

                            Comment


                            • #15
                              Updated to version 1.5. Added support for MESS (6XXX Variants) including NES, Turbo Graphics 16, etc... Added a new color scheme, along with adding branch counts above each column after processing a file.
                              Not taking any requests at this time.

                              Bored? Watch some of my hacks here.

                              Comment

                              Working...
                              X