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

Author Topic: BZK 6502 Disassembler  (Read 2841 times)

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 595
  • I am the baldest romhacker
    • View Profile
BZK 6502 Disassembler
« on: December 03, 2020, 01:29:15 pm »
Let's create a quick disassembly of your game!  :)

This disassembler is a CDL-based Lua script. Mostly targeted on romhackers who just want to have a better view at the game code with little effort. By editing the config file you can properly disassemble any game on any mapper.

Disassembler features:
- Separate code from data using a CDL file
- Display all 6 CDL flags, ROM File and NES Memory address
- Use several table files to display symbols
- Auto adding labels to RAM addresses
- Additional info about each CPU address

Notepad++ scripts features:
- Convert .byte to instructions
- Convert .byte to .word/.dbyt + labels
- Auto adding labels to Branches, Tables and JMP/JSR instructions
- Other manipulations with bytes

Final output files are compatible with ca65 assembler (after deleting "garbage" text using a single regex). Assembles files into a 1:1 copy of the original ROM.

Spoiler:


If you wanna try it, read the manual. Let me know if you have any questions.
« Last Edit: December 13, 2020, 06:44:12 pm by Cyneprepou4uk »

Vanya

  • Hero Member
  • *****
  • Posts: 1868
    • View Profile
Re: BZK 6502 Disassembler
« Reply #1 on: December 03, 2020, 07:28:12 pm »
Oh! That's pretty neat, and seems super useful, nice!

PolishedTurd

  • Full Member
  • ***
  • Posts: 194
    • View Profile
Re: BZK 6502 Disassembler
« Reply #2 on: December 06, 2020, 09:51:15 am »
This looks really cool! Can't wait to try it out on a couple games.

Thank you!

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 595
  • I am the baldest romhacker
    • View Profile
Re: BZK 6502 Disassembler
« Reply #3 on: December 06, 2020, 03:59:33 pm »
Good, you might unlock "the 1st tester" achievement  :cookie:

shadow501

  • Full Member
  • ***
  • Posts: 191
  • Pro Hex Editor
    • View Profile
Re: BZK 6502 Disassembler
« Reply #4 on: December 07, 2020, 01:37:07 am »
Let's create a quick disassembly of your game!  :)

This disassembler is a CDL-based Lua script (CDL is a file created by Code/Data Logger). It's an updated version of my own disassembler which I was using to create a CT2 disassembly, taken into account all my previous experience with 3 (successful) attempts to manually create a disassembly for other games from scratch without any scripts.

It produces assembly files with additional information like CDL flags, ROM File and NES Memory addresses. Also you can use several advanced table files to look for the text bytes. Then you polish your assembly files with my Notepad++ LuaScript plugin scripts.

Spoiler:


The disassembler is mostly targeted on romhackers who want to have a better view at the game code with little effort. At the same time output files can easily be made compatible with ca65 assembler, including some other features.

If you wanna try it, read the manual. Let me know if you have any questions.

Hope to see Captain Tsubasa 1 NES translation  :)

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 595
  • I am the baldest romhacker
    • View Profile
Re: BZK 6502 Disassembler
« Reply #5 on: December 07, 2020, 03:16:34 am »
I don't like CT1, but I'll be hoping so too, maybe it will help   :D

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 595
  • I am the baldest romhacker
    • View Profile
Re: BZK 6502 Disassembler
« Reply #6 on: December 31, 2020, 10:54:17 am »
Version 1.6.0 is available. Since last time I've fixed a couple of bugs and improved some scripts.

Trax

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 578
    • View Profile
    • Trax ROM Hacking
Re: BZK 6502 Disassembler
« Reply #7 on: January 04, 2021, 12:33:44 am »
How does the disassembler differentiate between code and other data?

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 595
  • I am the baldest romhacker
    • View Profile
Re: BZK 6502 Disassembler
« Reply #8 on: January 04, 2021, 01:02:41 am »
By looking at CDL file.

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 595
  • I am the baldest romhacker
    • View Profile
Re: BZK 6502 Disassembler
« Reply #9 on: January 30, 2021, 04:06:53 pm »
Version 1.6.1 is available with a small bugfix (not really important one).

I've recorded an example of disassembling Mappy game using this disassembler.
https://youtu.be/Abrv2Rpo80Y

Fox Cunning

  • Jr. Member
  • **
  • Posts: 71
  • Barrel-roller
    • View Profile
Re: BZK 6502 Disassembler
« Reply #10 on: February 10, 2021, 02:46:12 am »
That's one great little utility! I primarily use Mesen, which can also export CDL files. I'll let you know if it works with those too.

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 595
  • I am the baldest romhacker
    • View Profile
Re: BZK 6502 Disassembler
« Reply #11 on: February 10, 2021, 07:54:07 am »
 :thumbsup:

February 10, 2021, 12:09:08 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
I assume that both FCEUX and Mesen produce the same cdl format.
https://github.com/SourMesen/Mesen/issues/561

However I'm not sure about bit7. At some point FCEUX reserved this bit as "code being executed at $6000-$7FFF" flag. My disassembler marks this case as "D 4" in output files (didn't test it though).

But Mesen might be using bit7 for other purpose.
https://forums.nesdev.com/viewtopic.php?f=3&t=13844&start=855#p256461

If that post is correct, and my untested function works, then output files will have a little more useful info when using cdl from Mesen.
« Last Edit: February 10, 2021, 12:09:08 pm by Cyneprepou4uk »