Patch Win32 Disk Imager to work with system has RamDisk

This problem was reported back in 2017: win32diskimager/tickets/47

A quick workaround was to assign drive A or B as the RamDisk, and don't let Win32DiskImager to access it:

004066CC | C1EB 02     | shr ebx,2                  |
004066CF | 85DB        | test ebx,ebx               |
004066D1 | 74 27       | je win32diskimager.4066FA  |
004066D3 | 90          | nop                        |
004066D4 | BE 43000000 | mov esi,43                 | 43:'C'

Or, use the patcher below to specify the drive you would like to ignore:


Read the thread again, the root cause was found and I quote:

The root of the issue is that when the program first loads, it tries to determine free space of the available drives, which apparently only works on physical drives, not ramdisks or network drives. The same mechanism is used when the user selects READ. The failure will generate a warning window, but there is nothing to attach this window to during start (hence the program crashes).

I open the program in x32dbg and using the source code to guide me, and I've found the check to show message box:

004047FD | 74 B9       | je  win32diskimager.4047B8 |

Update it to a unconditional jump to skip the dialog:

004047FD | EB B9       | jmp win32diskimager.4047B8 |

And done!


This article is also available in: 中文 (简体)

Jixun

Jixun

Just some random guy talking about some random stuff.