Log in

View Full Version : W32DASM Max path length


redblkjck
February 18th, 2002, 16:50
I was just wonrdering if anyone else has/had this problem.
I had several files that W32Dasm would not even try to decompile. Which was no big deal since there are other programs to use. But it did bother me why W32Dasm would not work. There was nothing wrong the exe. What I found out was that W32Dasm has a 80 chr$ max length value for the file you want to decompile. Since I am on Win2k box and the default path for some of my apps is 54 chr$ just to the dir. C:\Documents and Settings\Administrator\My Documents\ Not much room left for another folder and exe name before going over 80 chr$.

Jack

JimmyClif
February 18th, 2002, 17:24
Well, you could reverse wdasm and enlarge the Buffer for the MaxPath....

Here's a little hint to get you started:

When you open a File it's been done with an:
GetOpenFileName API which needs the OPENFILENAME Structure.
Inside this structure there's the ofn.lpstrFile whichs needs a pointer to the Buffer which will hold the exact location of the exe which will get disassembled.

All you have to do is find this little bugger and make it point to a Buffer of your choice having at least 256 or 512 bytes space.

Make sure that you get every location of the ofn.lpstrFile reference and change it accordingly to your new Buffer and that would do it


And - I almost forgot : There's also the ofn.nMaxFile which needs a number of the Max Chars for the FilePath, so if you find out that the Buffer is big enough to hold more all you need to change is the ofn.nMaxFile to a higher number.

If you decide to make ofn.lpstrFile point to a new Buffer don't forget to change the ofn.nMaxFile to a higher number too.


This is actually the most interesting part of reversing...

Have fun,
JimmyClif