Sonic and Sega Retro Message Board: IDA Pro - Program Counter fix in 68000 disassembly - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

IDA Pro - Program Counter fix in 68000 disassembly use one of the other in this topic instead of drx's k

#1 User is offline kazblox 

Posted 01 May 2015 - 03:08 PM

  • Posts: 61
  • Joined: 20-August 14
  • Gender:Male
  • Location:localhost
  • Project:What projects?
For the Pro Experts out there:

Most of the Tech Members here who used IDA Disassembler in the past might have known that it has a very serious problem with (pc) instructions not displaying (pc). There is drx's patch from 2007, but it only fixes pea and lea specifically.
Here are 2 recent fixes made by Ti_ (of Elektropage) and Flamewing. Both fix all problem opcodes. You can choose one or the other, but in recommendation, use Flamewing's script incase you are using future versions of IDA.

FIX 1:

Quote

Download: http://www.mediafire...1w08p7/mc68.zip

IDA 5.X USERS ONLY! 6.X USERS USE FLAMEWING'S FIX!
Courtesy of Ti_ of making this fix and TheRoboticMinion (ArtmeierCompanies) for sending it to me after the site it was on collapsed off the web forever.

Installation Instructions-
1. Delete the mc68.w32 file from the Program Files (x86)\IDA\procs folder.
2. Drag mc68.w32 out of the zip file and put it in the folder I mentioned earlier.

PRESTO, that wasn't hard.


FIX 2:

Quote

Download: http://pastebin.com/FaSurKKx

Fix made and distributed by Flamewing. Cross-compatible, because, since it's a script, it works with all future versions of IDA.

Instructions-
1. Save it as "AddrFixup.idc" somewhere you will remember
2. When exporting the IDB to text, run the script (File -> IDC File...). The script is safe for running it multiple times in the same disassembly.



EDIT: Added flamewing's cross-compatible script

This post has been edited by kazblox: 01 May 2015 - 05:01 PM

#2 User is offline flamewing 

Posted 01 May 2015 - 04:10 PM

  • Emerald Hunter
  • Posts: 831
  • Joined: 11-October 10
  • Gender:Male
  • Location:Brasil
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
I have been meaning to release this; guess this is as good a place as any.

I have come up with a better solution than drx's fix: using an idc script. Save this file as "AddrFixup.idc" somewhere you will remember; then, at any point you want (preferably before exporting to text) run the script (File -> IDC File...). The script is safe for running it multiple times in the same disassembly.

My script handles all problem opcodes:
	jmp	(XXX).w
	jmp	(XXX).l
	jmp	XXX(pc)
	jsr	(XXX).w
	jsr	(XXX).l
	jsr	XXX(pc)
	lea	XXX(pc)
	pea	XXX(pc)

As can be seen, this includes opcodes not handled by drx's hack. But eh more important part is that the script works for all future versions of IDA as well, instead of being restricted to 5.x.

#3 User is offline kazblox 

Posted 01 May 2015 - 04:33 PM

  • Posts: 61
  • Joined: 20-August 14
  • Gender:Male
  • Location:localhost
  • Project:What projects?

View Postflamewing, on 01 May 2015 - 04:10 PM, said:

<br/>I have been meaning to release this; guess this is as good a place as any.<br/><br/>I have come up with a better solution than drx's fix: using an idc script. Save <a href='http://pastebin.com/FaSurKKx' class='bbc_url' title='External link' rel='nofollow external'>this file</a> as &quot;AddrFixup.idc&quot; somewhere you will remember; then, at any point you want (preferably before exporting to text) run the script (File -&gt; IDC File...). The script is safe for running it multiple times in the same disassembly.<br/><br/>My script handles all problem opcodes:<br/>
&nbsp;&nbsp;&nbsp; jmp&nbsp;&nbsp;&nbsp; (XXX).w<br/>
&nbsp;&nbsp;&nbsp; jmp&nbsp;&nbsp;&nbsp; (XXX).l<br/>
&nbsp;&nbsp;&nbsp; jmp&nbsp;&nbsp;&nbsp; XXX(pc)<br/>
&nbsp;&nbsp;&nbsp; jsr&nbsp;&nbsp;&nbsp; (XXX).w<br/>
&nbsp;&nbsp;&nbsp; jsr&nbsp;&nbsp;&nbsp; (XXX).l<br/>
&nbsp;&nbsp;&nbsp; jsr&nbsp;&nbsp;&nbsp; XXX(pc)<br/>
&nbsp;&nbsp;&nbsp; lea&nbsp;&nbsp;&nbsp; XXX(pc)<br/>
&nbsp;&nbsp;&nbsp; pea&nbsp;&nbsp;&nbsp; XXX(pc)
<br/>As can be seen, this includes opcodes not handled by drx's hack. But eh more important part is that the script works for all future versions of IDA as well, instead of being restricted to 5.x.<br/>
<br/><br/><br/>

The problem opcodes are all fixed in Ti_'s patch. drx's only fixes lea and pea.

But for those who are using future versions of IDA, use flamewing's script above.

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users