还记得上一篇《OllyDBG 入门系列(三)-函数参考》中的内容吗?在那篇文章中我们分析后发现一个 ESI 寄存器值不知是从什么地方产生的,要弄清这个问题必须要找到生成这个 ESI 值的计算部分。今天我们的任务就是使用 OllyDBG 的内存断点功能找到这个地方,搞清楚这个值是如何算出来的。这次分析的目标程序还是上一篇的那个 crackme,附件我就不再上传了,用上篇中的附件就可以了。下面我们开始: 还记得我们上篇中所说的关键代码的地方吗?温习一下:
把上面代码后的 OllyDBG 自动添加的注释与 MSDN 中的函数原型比较一下: BOOL GetVolumeInformation( LPCTSTR lpRootPathName, // address of root directory of the file system LPTSTR lpVolumeNameBuffer, // address of name of the volume DWORD nVolumeNameSize, // length of lpVolumeNameBuffer LPDWORD lpVolumeSerialNumber, // address of volume serial number LPDWORD lpMaximumComponentLength, // address of systems maximum filename length LPDWORD lpFileSystemFlags, // address of file system flags LPTSTR lpFileSystemNameBuffer, // address of name of file system DWORD nFileSystemNameSize // length of lpFileSystemNameBuffer );
Value Meaning 返回在EAX中的值 DRIVE_UNKNOWN The drive type cannot be determined. 0 DRIVE_NO_ROOT_DIR The root directory does not exist. 1 DRIVE_REMOVABLE The disk can be removed from the drive. 2 DRIVE_FIXED The disk cannot be removed from the drive. 3 DRIVE_REMOTE The drive is a remote (network) drive. 4 DRIVE_CDROM The drive is a CD-ROM drive. 5 DRIVE_RAMDISK The drive is a RAM disk. 6