Forrest Heller

MASM

UPDATE: May 4th, 2009

I posted a link to the MASM Forum to see if there are better ways of doing this and if those ways can help more people than mine. MASM Forum users suggested different methods (all untested by me but probably by them):

Motivation

I wanted to go from being x86 assembly literate to decent. So, I installed MASM...because it's nice--but not nice enough to install on my network drive. So, I modified MASM to install on network drives.

In Pictures

The MASM assembler setup does not display my Z: drive I really needed MASM on a network drive, so I went to get OllyDbg.  I was excited by a new version. This picture is explained below.  It describes how I used OllyDbg and MSDN documentation to trick MASM into displaying my drives. Victory

In words

Let me say that OllyDbg, by Oleh Yuschuk, is my favorite debugger and I always turn to it first when I need to "debug" executables or "inspect" DLLs.

I opened up OllyDbg and debugged the MASM install.exe file. I started looking for Win32 API calls to get the list of drives and found them very quickly.I spied a suspicous comparison of the return value of GetDriveTypeA to the 3. Looking at the GetDriveTypeA documentation from the MSDN I found that a return value of 3 is typically associated with a hard disk while value 4 is specifically associated with a network drive. Clearly, this is the point where MASM filters out all non-fixed storage media.

Basically, I wanted the jump to be taken either all the time or when my network storage drive caused GetDriveType to return 4. In a display of my x86 inabilities, I did not think first to just to erase the JNE, but to change the 3 to a 4. It worked. If you are doing this yourself, just fill the jne with NOPs. Both approaches are described in the story.

I would give everybody the modified install.exe binary but I think it's illegal and if you really want MASM to install on a network drive you just have to change one instruction. I may provide a "trainer" later on to do this automatically.