Log in

View Full Version : SoftIce Backtrace Buffer Disassembler - A new tool


Kayaker
August 4th, 2001, 03:13
Hi All,

I wrote a new Win9x reversing tool, TraceDis, that I hope might prove useful. It's made to work in conjunction with SoftICE to allow convenient viewing and saving of Backtrace logs. It combines a raw dump from memory of the addresses contained in the Backtrace buffer with a disassembler.

The Backtrace feature of SoftIce, which allows you to log all instructions executed within a specified address range, is a very powerful option that I think isn't used to its full potential because of the difficulty of working with the disassembled trace. Only the *addresses* of the lines logged are stored in the Backtrace buffer, the disassembled output you see with the SHOW or TRACE commands is generated internally by SoftIce.

You can do multiple screendumps of the trace with IceDump, but this isn't a good option for large traces. What TraceDis does is parse the addresses contained in a dump of the Backtrace buffer and disassemble those addresses in the target program while the program is loaded in memory. The results are a readable disassembled output much as you would see in SoftIce.

It works with Self Modifying Code (SMC) as well as packed programs using high memory addresses during unpacking. You can also use it to help manually trace redirected API calls. All dependant on the quality of your Backtrace in the first place of course.

It has a feature which allows you break into SoftIce, either specifically at the Program Entry Point of the target program, or at any time you wish after it is loaded, to access the address space of the program. This is simply an obsolete, never-used API invoked at a couple of places in TraceDis that you can set a breakpoint on.

I think it will be a handy utility to take full advantage of SoftIce's tracing abilities, simply because you can now view and save the traces outside of SoftIce. There's a complete help file giving examples of its usage.

I owe a large vote of thanks to +Tsehp for the major contribution he made by kindly providing a C source dll which converted the opcode instructions to readable assembly instructions. Not only did this save an immense amount of time (I'd still be decoding opcode mnemonics), it ensured the accuracy of the results.

I hope you find it useful once you've figured out wtf it's all about and I'd appreciate any comments or bug reports to help improve it.

Cheers,
Kayaker

CoDe_InSiDe
August 4th, 2001, 16:50
Hi Kayaker,

I checked the Tool a little bit and i found a bug
I opened the Program and choosed Notepad.
Then Notepad and the Program runned.
Then in the TraceDis Program i clicked on "Open Buffer" and i selected the file from the Example zip "Trace.bin" and TraceDis crashed
Well actually it was "tracdis.dll" that crashed hehe
I don't know if i were supposed to open that file or something but it obviously doesn't handle it correctly
Well that's it for now

Cya...

CoDe_InSiDe

Clandestiny
August 4th, 2001, 17:54
Hiya Code_Inside,

If I'm understanding your problem the Trace.bin is the buffer address dump for Example.exe, not Notepad. As such TracDis can't parse the addresses to meaningful code. Hence the crash. If you want to try TraceDis out on Notepad you'll need to do a manual raw dump of Sice's backtrace buffer with Notepad loaded into memory. This dump is the file that you need to open, not Trace.bin. If you load Example.exe, however, you can open Trace.bin which provides a demo of the prog's functionality.

Cheers,
Clandestiny

Kayaker
August 4th, 2001, 21:15
Hi CoDe_InSidE,

Clandestiny is right, the trace.bin file is a raw dump of a backtrace that only goes with the example program. You need to make your own dumps for any other program. But I'm glad you brought it up because it showed a flaw in my code. A program should always exit gracefully if possible on an error and not crash!

I found the error and fixed it so if the user chooses the wrong file it won't crash. I see another potential area that could use some error handling as well, so I'll work on that. Thanks for the report

BTW, sorry for the cross post on the 2 forums, but I've always had problems attaching files in the main RCE forum, so I had to post it here instead. This after I realized my first post on the other forum contains a dead link to the file.

Kayaker

CoDe_InSiDe
August 5th, 2001, 07:35
Hi everyone,

Yeah, Trace.bin belongs to the example program quite logical
BUT it shouldn't crash, but you fixed that now, good ;D

Cya...

CoDe_InSiDe

Bengaly
August 11th, 2001, 04:48
Also note "BPRW NOTEPAD T" is not working
even if notepad is loded in Symbol Loader! ;D
if there is another suggestion plz let me know :/

Have Fun ;D