gSyncit破解手记
ssfighter的博客已经全面搬家至http://blog.ssfighter.cn/处,这里将会同步更新一段时间,请各位朋友及时修改收藏夹以及友情链接,给您造成的麻烦表示抱歉。
本文仅供学习研究使用,请勿用于非法用途
gSyncit是一款可以将Google Calendar和Outlook进行双向同步的软件,支持手动同步和定时自动同步,软件利用Google和Outlook提供的API做成,软件的主页是http://www.daveswebsite.com/software/gsync/,煎蛋上提供了一篇介绍gSyncit的文章,如果需要可以看看这里。
我是在水木社区的某内部版面上看到有人求这个软件的破解,就自己下载下来试了一下,没有太仔细看,花了10分钟搞定之,现在把破解的过程简单写写。
这个软件是用.Net写的,运行需要.Net Framework 2.0的支持,用Reflector打开,软件作者超级厚道,居然没用混淆化,呵呵。不多说了,判断是否注册在这里:
public static bool IsRegistered()
{
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\gSyncit");
string productKey = (string) key.GetValue("RegCode", "");
key.Close();
return IsRegistered(productKey);
}
这里可以看出来,注册码存储在HKCU\Software\gSyncit下的键值为RegCode里。继续往下跟,可以知道最终调用的gsyncext.dll里的一个叫GetOutlookItem的导出函数,通过这个函数来判断是否注册。因此,用IDA先分析一下gsyncext.dll,然后再用OD的LoadDLL来调试之。调试的方法就不说了,直接来到关键的地方:
1000144E |. 8D50 01 lea edx, [eax+1] ; 注册码
10001451 |> 8A08 /mov cl, [eax]
10001453 |. 83C0 01 |add eax, 1
10001456 |. 84C9 |test cl, cl
10001458 |.^ 75 F7 \jnz short 10001451
1000145A |. 2BC2 sub eax, edx
1000145C |. 8D9424 54020000 lea edx, [esp+254]
10001463 |. 52 push edx
10001464 |. 50 push eax
10001465 |. 56 push esi
10001466 |. 8D4C24 1C lea ecx, [esp+1C]
1000146A |. E8 F10C0000 call 10002160 ; 把注册码的前20位进行Base64编码
继续往下看,
10001471 |. 8D48 01 lea ecx, [eax+1] ; 关键字符串gSyncOutlookAddinv1
10001474 |> 8A10 /mov dl, [eax]
10001476 |. 83C0 01 |add eax, 1
10001479 |. 84D2 |test dl, dl
1000147B |.^ 75 F7 \jnz short 10001474
1000147D |. 2BC1 sub eax, ecx
1000147F |. 8D4C24 60 lea ecx, [esp+60]
10001483 |. 51 push ecx
10001484 |. 50 push eax
10001485 |. 57 push edi
10001486 |. 8D4C24 1C lea ecx, [esp+1C]
1000148A |. E8 D10C0000 call 10002160 ; 关键字符串进行Base64编码
再往下,来到这里:
100014AA |. 50 push eax
100014AB |. 8D4C24 70 lea ecx, [esp+70]
100014AF |. 51 push ecx
100014B0 |. 8D9424 68020000 lea edx, [esp+268]
100014B7 |. 52 push edx
100014B8 >|. 8D8424 60040000 lea eax, [esp+460]
100014BF |. 68 E8750210 push 100275E8 ; ASCII "%s/t%s/t%i"
100014C4 |. 50 push eax
100014C5 |. E8 A8170100 call <_sprintf>
这里将两组Base64编码进行组合,再往下来:
100014DA |. 51 push ecx
100014DB |. 8D4C24 28 lea ecx, [esp+28]
100014DF |. E8 DC180000 call 10002DC0 ; MD5_Init
100014E4 |. 8D4C24 24 lea ecx, [esp+24]
100014E8 |. E8 530F0000 call 10002440 ; 进行MD5编码
100014ED |. 8BD5 mov edx, ebp
100014EF |. 90 nop
100014F0 |> 8A08 /mov cl, [eax]
100014F2 |. 880A |mov [edx], cl
100014F4 |. 83C0 01 |add eax, 1
100014F7 |. 83C2 01 |add edx, 1
100014FA |. 84C9 |test cl, cl
100014FC |.^ 75 F2 \jnz short 100014F0
100014FE |. 55 push ebp
100014FF |. E8 34130100 call <__mbsupr> ; 转成大写字母
从上面的子程序中返回,来到比较的地方:
1000180D |. 52 push edx
1000180E |. E8 7D180100 call ; MD5前20位换成注册码的前20位
10001813 |. 8D4424 28 lea eax, [esp+28]
10001817 |. 56 push esi ; 假码
10001818 >|. 50 push eax ; 真码
10001819 |. E8 040F0100 call <__mbscmp> ; 真假码比较
总结一下,注册码应该是一个32字节长度的字符串,其前20位参与真码的演算,后面的进行验证,这样,就可以得到的一组可用的注册码,即“9D1057D70D4CE1925AF17999225E9DB7”,将其写入注册表的特定位置就可以了。这里需要注意的是,调用sprintf时,%i似乎只有0的一种状态,我没有仔细看,如果发现有问题请联系我。
本文仅供学习研究使用,请勿用于非法用途
gSyncit是一款可以将Google Calendar和Outlook进行双向同步的软件,支持手动同步和定时自动同步,软件利用Google和Outlook提供的API做成,软件的主页是http://www.daveswebsite.com/software/gsync/,煎蛋上提供了一篇介绍gSyncit的文章,如果需要可以看看这里。
我是在水木社区的某内部版面上看到有人求这个软件的破解,就自己下载下来试了一下,没有太仔细看,花了10分钟搞定之,现在把破解的过程简单写写。
这个软件是用.Net写的,运行需要.Net Framework 2.0的支持,用Reflector打开,软件作者超级厚道,居然没用混淆化,呵呵。不多说了,判断是否注册在这里:
public static bool IsRegistered()
{
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\gSyncit");
string productKey = (string) key.GetValue("RegCode", "");
key.Close();
return IsRegistered(productKey);
}
这里可以看出来,注册码存储在HKCU\Software\gSyncit下的键值为RegCode里。继续往下跟,可以知道最终调用的gsyncext.dll里的一个叫GetOutlookItem的导出函数,通过这个函数来判断是否注册。因此,用IDA先分析一下gsyncext.dll,然后再用OD的LoadDLL来调试之。调试的方法就不说了,直接来到关键的地方:
1000144E |. 8D50 01 lea edx, [eax+1] ; 注册码
10001451 |> 8A08 /mov cl, [eax]
10001453 |. 83C0 01 |add eax, 1
10001456 |. 84C9 |test cl, cl
10001458 |.^ 75 F7 \jnz short 10001451
1000145A |. 2BC2 sub eax, edx
1000145C |. 8D9424 54020000 lea edx, [esp+254]
10001463 |. 52 push edx
10001464 |. 50 push eax
10001465 |. 56 push esi
10001466 |. 8D4C24 1C lea ecx, [esp+1C]
1000146A |. E8 F10C0000 call 10002160 ; 把注册码的前20位进行Base64编码
继续往下看,
10001471 |. 8D48 01 lea ecx, [eax+1] ; 关键字符串gSyncOutlookAddinv1
10001474 |> 8A10 /mov dl, [eax]
10001476 |. 83C0 01 |add eax, 1
10001479 |. 84D2 |test dl, dl
1000147B |.^ 75 F7 \jnz short 10001474
1000147D |. 2BC1 sub eax, ecx
1000147F |. 8D4C24 60 lea ecx, [esp+60]
10001483 |. 51 push ecx
10001484 |. 50 push eax
10001485 |. 57 push edi
10001486 |. 8D4C24 1C lea ecx, [esp+1C]
1000148A |. E8 D10C0000 call 10002160 ; 关键字符串进行Base64编码
再往下,来到这里:
100014AA |. 50 push eax
100014AB |. 8D4C24 70 lea ecx, [esp+70]
100014AF |. 51 push ecx
100014B0 |. 8D9424 68020000 lea edx, [esp+268]
100014B7 |. 52 push edx
100014B8 >|. 8D8424 60040000 lea eax, [esp+460]
100014BF |. 68 E8750210 push 100275E8 ; ASCII "%s/t%s/t%i"
100014C4 |. 50 push eax
100014C5 |. E8 A8170100 call <_sprintf>
这里将两组Base64编码进行组合,再往下来:
100014DA |. 51 push ecx
100014DB |. 8D4C24 28 lea ecx, [esp+28]
100014DF |. E8 DC180000 call 10002DC0 ; MD5_Init
100014E4 |. 8D4C24 24 lea ecx, [esp+24]
100014E8 |. E8 530F0000 call 10002440 ; 进行MD5编码
100014ED |. 8BD5 mov edx, ebp
100014EF |. 90 nop
100014F0 |> 8A08 /mov cl, [eax]
100014F2 |. 880A |mov [edx], cl
100014F4 |. 83C0 01 |add eax, 1
100014F7 |. 83C2 01 |add edx, 1
100014FA |. 84C9 |test cl, cl
100014FC |.^ 75 F2 \jnz short 100014F0
100014FE |. 55 push ebp
100014FF |. E8 34130100 call <__mbsupr> ; 转成大写字母
从上面的子程序中返回,来到比较的地方:
1000180D |. 52 push edx
1000180E |. E8 7D180100 call
10001813 |. 8D4424 28 lea eax, [esp+28]
10001817 |. 56 push esi ; 假码
10001818 >|. 50 push eax ; 真码
10001819 |. E8 040F0100 call <__mbscmp> ; 真假码比较
总结一下,注册码应该是一个32字节长度的字符串,其前20位参与真码的演算,后面的进行验证,这样,就可以得到的一组可用的注册码,即“9D1057D70D4CE1925AF17999225E9DB7”,将其写入注册表的特定位置就可以了。这里需要注意的是,调用sprintf时,%i似乎只有0的一种状态,我没有仔细看,如果发现有问题请联系我。






2007-9-1 1:59:00