文章标题】:破解某位图CM
【文章作者】:riusksk
【作者主页】:http://riusksk.blogbus.com
【软件下载】:../20220623/file.html[谁下载?]
【保护方式】: keyfile
【操作平台】:windows vista sp1
【使用工具】:OD,WinHex
【作者声明】: 只是感兴趣,没有其他目的。失误之处敬请诸位大侠赐教!
------------------------------------------------------------------------------------------------------------------
【破解过程】:
先打开CM,点击”Unlock Me”按钮后,提示“系统找不到指定的文件”,然后就自动关闭了。由此可知,这个CM是个keyfile CM,因此我们可以下断点bpx CreateFileA,运行后停在下面地址:
0040149F |. 6A 00 PUSH 0 ; /hTemplateFile = NULL
004014A1 |. 68 A0000008 PUSH 80000A0 ; |Attributes = ARCHIVE|NORMAL|SEQUENTIAL_SCAN
004014A6 |. 6A 03 PUSH 3 ; |Mode = OPEN_EXISTING
004014A8 |. 6A 00 PUSH 0 ; |pSecurity = NULL
004014AA |. 6A 00 PUSH 0 ; |ShareMode = 0
004014AC |. 68 00000080 PUSH 80000000 ; |Access = GENERIC_READ
004014B1 |. 68 6C604000 PUSH Imaginat.0040606C ; |FileName = "ohmygod.bmp"
004014B6 |. FFD7 CALL EDI ; CreateFileA
因此我们先新建一个文件名为“ohmygod.bmp”的文件,然后用系统自带的画图工具打开,直接点保存,这样就保存一张空白图片了,然后我们再根据分析出来的内容再去修改此文件。接下来我们先看一看BMP文件头和信息头的相关信息,我查了一下《Win32 Programmer’s Reference》,具体内容如下:
位图文件头:
typedef struct tagBITMAPFILEHEADER { // bmfh
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
} BITMAPFILEHEADER;
Members
bfType
Specifies the file type. It must be BM.
bfSize
Specifies the size, in bytes, of the bitmap file.
bfReserved1
Reserved; must be zero.
bfReserved2
Reserved; must be zero.
bfOffBits
Specifies the offset, in bytes, from the BITMAPFILEHEADER structure to the bitmap bits.
位图信息头:
typedef struct tagBITMAPINFOHEADER{ // bmih
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER;
Members
biSize
Specifies the number of bytes required by the structure.
biWidth
Specifies the width of the bitmap, in pixels.
biHeight
Specifies the height of the bitmap, in pixels. If biHeight is positive, the bitmap is a bottom-up DIB and its origin is the lower left corner. If biHeight is negative, the bitmap is a top-down DIB and its origin is the upper left corner.
biPlanes
Specifies the number of planes for the target device. This value must be set to 1.
biBitCount
Specifies the number of bits per pixel. This value must be 1, 4, 8, 16, 24, or 32.
biCompression
Specifies the type of compression for a compressed bottom-up bitmap (top-down DIBs cannot be compressed). It can be one of the following values:
Value Description
BI_RGB An uncompressed format.
BI_RLE8 A run-length encoded (RLE) format for bitmaps with 8 bits per pixel. The compression format is a two-byte format consisting of a count byte followed by a byte containing a color index. For more information, see the following Remarks section.
BI_RLE4 An RLE format for bitmaps with 4 bits per pixel. The compression format is a two-byte format consisting of a count byte followed by two word-length color indices. For more information, see the following Remarks section.
BI_BITFIELDS Specifies that the bitmap is not compressed and that the color table consists of three doubleword color masks that specify the red, green, and blue components, respectively, of each pixel. This is valid when used with 16- and 32-bits-per-pixel bitmaps.
biSizeImage
Specifies the size, in bytes, of the image. This may be set to 0 for BI_RGB bitmaps.
biXPelsPerMeter
Specifies the horizontal resolution, in pixels per meter, of the target device for the bitmap. An application can use this value to select a bitmap from a resource group that best matches the characteristics of the current device.
biYPelsPerMeter
Specifies the vertical resolution, in pixels per meter, of the target device for the bitmap.
biClrUsed
Specifies the number of color indices in the color table that are actually used by the bitmap. If this value is zero, the bitmap uses the ma