diff --git a/cerebellum_xyzero_keygenme/Readme.txt b/cerebellum_xyzero_keygenme/Readme.txt new file mode 100644 index 0000000..2a141af --- /dev/null +++ b/cerebellum_xyzero_keygenme/Readme.txt @@ -0,0 +1,27 @@ +=================================================== +Program : KeygenMe #2 - Cerebellum +Level : 2 +Author : xyzero +Date : 09.03.2004 +Type : Name/Serial +URL : http://www.crackmes.de + http://www.reversor.web1000.com +=================================================== + +This is a simple/easy C keygenme. +OPTIONAL: explain the algorithm (easy!) + +Rulez: + +(1) Make a keygen and write a tutorial. +(2) No patching. No keygen injection. "no surprise". +(3) Enjoy! + +=================================================== + + +Greetz to Canterwood, M@rio, OorjaHalT, EXPERTDuke, and YOU ;-) + + +xyzero +xyzero@hotmail.com \ No newline at end of file diff --git a/cerebellum_xyzero_keygenme/keygen/sp_keygen.deps.json b/cerebellum_xyzero_keygenme/keygen/sp_keygen.deps.json new file mode 100644 index 0000000..4ffd5aa --- /dev/null +++ b/cerebellum_xyzero_keygenme/keygen/sp_keygen.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "sp_keygen/1.0.0": { + "runtime": { + "sp_keygen.dll": {} + } + } + } + }, + "libraries": { + "sp_keygen/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/cerebellum_xyzero_keygenme/keygen/sp_keygen.dll b/cerebellum_xyzero_keygenme/keygen/sp_keygen.dll new file mode 100644 index 0000000..dec3b48 Binary files /dev/null and b/cerebellum_xyzero_keygenme/keygen/sp_keygen.dll differ diff --git a/cerebellum_xyzero_keygenme/keygen/sp_keygen.exe b/cerebellum_xyzero_keygenme/keygen/sp_keygen.exe new file mode 100644 index 0000000..d645fcd Binary files /dev/null and b/cerebellum_xyzero_keygenme/keygen/sp_keygen.exe differ diff --git a/cerebellum_xyzero_keygenme/keygen/sp_keygen.runtimeconfig.json b/cerebellum_xyzero_keygenme/keygen/sp_keygen.runtimeconfig.json new file mode 100644 index 0000000..d784515 --- /dev/null +++ b/cerebellum_xyzero_keygenme/keygen/sp_keygen.runtimeconfig.json @@ -0,0 +1,13 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + "configProperties": { + "System.Reflection.Metadata.MetadataUpdater.IsSupported": false, + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/cerebellum_xyzero_keygenme/keygenme2.cerebellum.xyzero.exe b/cerebellum_xyzero_keygenme/keygenme2.cerebellum.xyzero.exe new file mode 100644 index 0000000..4c978ab Binary files /dev/null and b/cerebellum_xyzero_keygenme/keygenme2.cerebellum.xyzero.exe differ diff --git a/cerebellum_xyzero_keygenme/solve.md b/cerebellum_xyzero_keygenme/solve.md new file mode 100644 index 0000000..0582898 --- /dev/null +++ b/cerebellum_xyzero_keygenme/solve.md @@ -0,0 +1,254 @@ +计算serial + +因为serial是根据name、当前计算机名和用户名计算,这里就不提供示例name,serial了 + +相关算法: + +```c# +public static void CalcSerial(string name, string computerName, string userName) +{ + int v8 = 0x1791117; + int v18 = name.Length; + int v4 = 0; + int vc = 0; + int esi; + int eax = 0x20; + string cuu = ReverseString(computerName + userName).ToUpper(); + if (v18 < 4) + return; + foreach (char c in name) + { + v4 += c + v8++; + } + esi = v18 * v4 + v8; + foreach (char c in cuu) + { + vc += (c ^ eax++) * v18; + } + // long serial; 这块是原先的比较逻辑 + // serial ^=vc; + // vc+=esi; + // if(vc == serial) + Console.WriteLine((vc + esi) ^ vc); +} +``` + +细节: + +```assembly +0040112E | 55 | push ebp | Check +0040112F | 8BEC | mov ebp,esp | +00401131 | 81EC 30010000 | sub esp,130 | +00401137 | 8A15 14314000 | mov dl,byte ptr ds:[403114] | +0040113D | 53 | push ebx | +0040113E | 56 | push esi | +0040113F | 57 | push edi | +00401140 | 33C0 | xor eax,eax | +00401142 | 8D7D D1 | lea edi,dword ptr ss:[ebp-2F] | +00401145 | 8855 D0 | mov byte ptr ss:[ebp-30],dl | +00401148 | 6A 07 | push 7 | +0040114A | AB | stosd | +0040114B | AB | stosd | +0040114C | AB | stosd | +0040114D | AB | stosd | +0040114E | AB | stosd | +0040114F | 66:AB | stosw | +00401151 | AA | stosb | +00401152 | 5B | pop ebx | +00401153 | 33C0 | xor eax,eax | +00401155 | 8BCB | mov ecx,ebx | +00401157 | 8D7D B1 | lea edi,dword ptr ss:[ebp-4F] | +0040115A | 8855 B0 | mov byte ptr ss:[ebp-50],dl | +0040115D | 6A 0F | push F | +0040115F | F3:AB | rep stosd | +00401161 | 66:AB | stosw | +00401163 | AA | stosb | +00401164 | 59 | pop ecx | +00401165 | 33C0 | xor eax,eax | +00401167 | 8DBD D1FEFFFF | lea edi,dword ptr ss:[ebp-12F] | +0040116D | 8895 D0FEFFFF | mov byte ptr ss:[ebp-130],dl | +00401173 | F3:AB | rep stosd | +00401175 | 66:AB | stosw | +00401177 | AA | stosb | +00401178 | 6A 0F | push F | +0040117A | 33C0 | xor eax,eax | +0040117C | 59 | pop ecx | +0040117D | 8DBD 11FFFFFF | lea edi,dword ptr ss:[ebp-EF] | +00401183 | 8895 10FFFFFF | mov byte ptr ss:[ebp-F0],dl | +00401189 | 8855 90 | mov byte ptr ss:[ebp-70],dl | +0040118C | F3:AB | rep stosd | +0040118E | 66:AB | stosw | +00401190 | AA | stosb | +00401191 | 8BCB | mov ecx,ebx | +00401193 | 33C0 | xor eax,eax | +00401195 | 8D7D 91 | lea edi,dword ptr ss:[ebp-6F] | +00401198 | 8895 50FFFFFF | mov byte ptr ss:[ebp-B0],dl | +0040119E | F3:AB | rep stosd | +004011A0 | 66:AB | stosw | +004011A2 | AA | stosb | +004011A3 | 8BCB | mov ecx,ebx | +004011A5 | 33C0 | xor eax,eax | +004011A7 | 8DBD 51FFFFFF | lea edi,dword ptr ss:[ebp-AF] | +004011AD | 8895 70FFFFFF | mov byte ptr ss:[ebp-90],dl | +004011B3 | F3:AB | rep stosd | +004011B5 | 66:AB | stosw | +004011B7 | AA | stosb | +004011B8 | 8BCB | mov ecx,ebx | +004011BA | 33C0 | xor eax,eax | +004011BC | 8DBD 71FFFFFF | lea edi,dword ptr ss:[ebp-8F] | +004011C2 | 8365 FC 00 | and dword ptr ss:[ebp-4],0 | +004011C6 | F3:AB | rep stosd | +004011C8 | 66:AB | stosw | +004011CA | 8365 F4 00 | and dword ptr ss:[ebp-C],0 | [ebp-0C]:__except_handler4 +004011CE | 6A 18 | push 18 | +004011D0 | AA | stosb | +004011D1 | 8D45 D0 | lea eax,dword ptr ss:[ebp-30] | +004011D4 | BF E8030000 | mov edi,3E8 | +004011D9 | 50 | push eax | +004011DA | 57 | push edi | +004011DB | FF75 08 | push dword ptr ss:[ebp+8] | +004011DE | BE FF000000 | mov esi,FF | +004011E3 | C745 F8 17117901 | mov dword ptr ss:[ebp-8],1791117 | val +004011EA | 8975 EC | mov dword ptr ss:[ebp-14],esi | +004011ED | 8975 F0 | mov dword ptr ss:[ebp-10],esi | +004011F0 | FF15 74204000 | call dword ptr ds:[] | +004011F6 | 8D45 D0 | lea eax,dword ptr ss:[ebp-30] | Name +004011F9 | 50 | push eax | +004011FA | E8 83010000 | call | +004011FF | 83F8 04 | cmp eax,4 | +00401202 | 59 | pop ecx | +00401203 | 8945 E8 | mov dword ptr ss:[ebp-18],eax | name.length +00401206 | 73 22 | jae keygenme2.cerebellum.xyzero.40122 | n.l >=4 +00401208 | 8B35 78204000 | mov esi,dword ptr ds:[ | +0040125D | 8B1D 7C204000 | mov ebx,dword ptr ds:[] | +00401263 | 8D85 50FFFFFF | lea eax,dword ptr ss:[ebp-B0] | +00401269 | 50 | push eax | eax:"CHENX221-VMDBG" (ex) +0040126A | BF 00314000 | mov edi,keygenme2.cerebellum.xyzero.4 | 403100:"%s" +0040126F | 8D85 D0FEFFFF | lea eax,dword ptr ss:[ebp-130] | pc name +00401275 | 57 | push edi | +00401276 | 50 | push eax | +00401277 | FFD3 | call ebx | +00401279 | 83C4 0C | add esp,C | +0040127C | 8D45 F0 | lea eax,dword ptr ss:[ebp-10] | +0040127F | 50 | push eax | +00401280 | 8D85 70FFFFFF | lea eax,dword ptr ss:[ebp-90] | username +00401286 | 50 | push eax | +00401287 | FF15 00204000 | call dword ptr ds:[] | +0040128D | 8D85 70FFFFFF | lea eax,dword ptr ss:[ebp-90] | +00401293 | 50 | push eax | eax:"x221" (ex) +00401294 | 8D85 10FFFFFF | lea eax,dword ptr ss:[ebp-F0] | ↑ +0040129A | 57 | push edi | +0040129B | 50 | push eax | +0040129C | FFD3 | call ebx | +0040129E | 83C4 0C | add esp,C | +004012A1 | 8D85 10FFFFFF | lea eax,dword ptr ss:[ebp-F0] | +004012A7 | 50 | push eax | +004012A8 | 8D85 D0FEFFFF | lea eax,dword ptr ss:[ebp-130] | +004012AE | 50 | push eax | +004012AF | FF15 10204000 | call dword ptr ds:[] | 拼接 pcname+username +004012B5 | 8D85 D0FEFFFF | lea eax,dword ptr ss:[ebp-130] | +004012BB | 50 | push eax | +004012BC | E8 C1000000 | call | +004012C1 | 8BF8 | mov edi,eax | +004012C3 | 33C0 | xor eax,eax | +004012C5 | 85FF | test edi,edi | +004012C7 | 59 | pop ecx | +004012C8 | 76 16 | jbe keygenme2.cerebellum.xyzero.4012E | +004012CA | 8D8C3D CFFEFFFF | lea ecx,dword ptr ss:[ebp+edi-131] | 翻转合并结果 +004012D1 | 8A11 | mov dl,byte ptr ds:[ecx] | +004012D3 | 889405 10FFFFFF | mov byte ptr ss:[ebp+eax-F0],dl | +004012DA | 40 | inc eax | +004012DB | 49 | dec ecx | +004012DC | 3BC7 | cmp eax,edi | +004012DE | 72 F1 | jb keygenme2.cerebellum.xyzero.4012D1 | +004012E0 | 8D85 10FFFFFF | lea eax,dword ptr ss:[ebp-F0] | +004012E6 | 50 | push eax | +004012E7 | FF15 80204000 | call dword ptr ds:[] | 转大写 +004012ED | 85FF | test edi,edi | +004012EF | 76 28 | jbe keygenme2.cerebellum.xyzero.40131 | +004012F1 | 6A 20 | push 20 | +004012F3 | 8D8D 10FFFFFF | lea ecx,dword ptr ss:[ebp-F0] | +004012F9 | 58 | pop eax | +004012FA | 2BC8 | sub ecx,eax | +004012FC | 894D FC | mov dword ptr ss:[ebp-4],ecx | +004012FF | EB 03 | jmp keygenme2.cerebellum.xyzero.40130 | +00401301 | 8B4D FC | mov ecx,dword ptr ss:[ebp-4] | +00401304 | 0FBE0C01 | movsx ecx,byte ptr ds:[ecx+eax] | 取出每位 +00401308 | 33C8 | xor ecx,eax | 每位 xor eax(初始0x20) +0040130A | 0FAF4D E8 | imul ecx,dword ptr ss:[ebp-18] | *=n.l +0040130E | 014D F4 | add dword ptr ss:[ebp-C],ecx | 存储结果 +00401311 | 40 | inc eax | +00401312 | 8D48 E0 | lea ecx,dword ptr ds:[eax-20] | +00401315 | 3BCF | cmp ecx,edi | +00401317 | 72 E8 | jb keygenme2.cerebellum.xyzero.401301 | +00401319 | 8D45 B0 | lea eax,dword ptr ss:[ebp-50] | +0040131C | 6A 24 | push 24 | +0040131E | BF E9030000 | mov edi,3E9 | +00401323 | 50 | push eax | +00401324 | 57 | push edi | +00401325 | FF75 08 | push dword ptr ss:[ebp+8] | +00401328 | FF15 74204000 | call dword ptr ds:[] | +0040132E | 8D45 B0 | lea eax,dword ptr ss:[ebp-50] | Serial +00401331 | 50 | push eax | +00401332 | FF15 48204000 | call dword ptr ds:[] | str2long +00401338 | 59 | pop ecx | +00401339 | 8BC8 | mov ecx,eax | long result +0040133B | 8B45 F4 | mov eax,dword ptr ss:[ebp-C] | 上一步的结果 +0040133E | 33C8 | xor ecx,eax | serial xor 上一步结果 +00401340 | 03C6 | add eax,esi | eax+=v1 +00401342 | 3BC1 | cmp eax,ecx | 最后的比较 +00401344 | 74 0E | je ] | +00401352 | EB 26 | jmp keygenme2.cerebellum.xyzero.40137 | +00401354 | 8D45 D0 | lea eax,dword ptr ss:[ebp-30] | +00401357 | 50 | push eax | +00401358 | 8D45 90 | lea eax,dword ptr ss:[ebp-70] | +0040135B | 68 F0304000 | push keygenme2.cerebellum.xyzero.4030 | 4030F0:"Good job %s!!!" +00401360 | 50 | push eax | +00401361 | FFD3 | call ebx | +00401363 | 83C4 0C | add esp,C | +00401366 | 8D45 90 | lea eax,dword ptr ss:[ebp-70] | +00401369 | 6A 00 | push 0 | +0040136B | 68 EC304000 | push keygenme2.cerebellum.xyzero.4030 | 4030EC:"OK!" +00401370 | 50 | push eax | +00401371 | FF75 08 | push dword ptr ss:[ebp+8] | +00401374 | FF15 84204000 | call dword ptr ds:[] | +0040137A | 6A 01 | push 1 | +0040137C | 58 | pop eax | +0040137D | 5F | pop edi | +0040137E | 5E | pop esi | +0040137F | 5B | pop ebx | +00401380 | C9 | leave | +00401381 | C3 | ret | +``` + diff --git a/cerebellum_xyzero_keygenme/source/keygen1.sln b/cerebellum_xyzero_keygenme/source/keygen1.sln new file mode 100644 index 0000000..3f0a221 --- /dev/null +++ b/cerebellum_xyzero_keygenme/source/keygen1.sln @@ -0,0 +1,163 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35303.130 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "keygen1", "keygen1\keygen1.csproj", "{D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "keygen2", "keygen2\keygen2.csproj", "{2446CB50-1882-4219-9DB0-E7F5517E6E20}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "keygen3", "keygen3\keygen3.csproj", "{BC47A6DE-7F9D-4D65-A996-69FB778C95F3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GiveMeSerial", "GiveMeSerial\GiveMeSerial.vcxproj", "{E3604156-7DF2-4B5F-AECA-64786B92F38C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DllInjector", "DllInjector\DllInjector.csproj", "{A5A24406-1296-457B-91A3-60E67511D807}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GetSerial", "GetSerial\GetSerial.vcxproj", "{85044A5C-C4A3-4C79-9AD5-6895F61F8515}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GuessSerial", "GuessSerial\GuessSerial.csproj", "{7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Validator", "Validator\Validator.csproj", "{6BE1ED72-6CA9-4442-B529-C867A9D6904C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FindKey", "FindKey\FindKey.csproj", "{D5E3C871-EA87-48E7-9287-E96B8410EB18}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sp_keygen", "sp_keygen\sp_keygen.csproj", "{D6614743-D01E-4899-A5E7-B4E45BD1B033}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Debug|x64.ActiveCfg = Debug|Any CPU + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Debug|x64.Build.0 = Debug|Any CPU + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Debug|x86.ActiveCfg = Debug|x86 + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Debug|x86.Build.0 = Debug|x86 + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Release|Any CPU.Build.0 = Release|Any CPU + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Release|x64.ActiveCfg = Release|x64 + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Release|x64.Build.0 = Release|x64 + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Release|x86.ActiveCfg = Release|x86 + {D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Release|x86.Build.0 = Release|x86 + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Debug|x64.ActiveCfg = Debug|x64 + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Debug|x64.Build.0 = Debug|x64 + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Debug|x86.ActiveCfg = Debug|x86 + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Debug|x86.Build.0 = Debug|x86 + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Release|Any CPU.Build.0 = Release|Any CPU + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Release|x64.ActiveCfg = Release|x64 + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Release|x64.Build.0 = Release|x64 + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Release|x86.ActiveCfg = Release|x86 + {2446CB50-1882-4219-9DB0-E7F5517E6E20}.Release|x86.Build.0 = Release|x86 + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Debug|x64.ActiveCfg = Debug|Any CPU + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Debug|x64.Build.0 = Debug|Any CPU + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Debug|x86.ActiveCfg = Debug|x86 + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Debug|x86.Build.0 = Debug|x86 + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Release|Any CPU.Build.0 = Release|Any CPU + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Release|x64.ActiveCfg = Release|x64 + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Release|x64.Build.0 = Release|x64 + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Release|x86.ActiveCfg = Release|x86 + {BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Release|x86.Build.0 = Release|x86 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Debug|Any CPU.ActiveCfg = Debug|x64 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Debug|Any CPU.Build.0 = Debug|x64 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Debug|x64.ActiveCfg = Debug|x64 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Debug|x64.Build.0 = Debug|x64 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Debug|x86.ActiveCfg = Debug|Win32 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Debug|x86.Build.0 = Debug|Win32 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Release|Any CPU.ActiveCfg = Release|x64 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Release|Any CPU.Build.0 = Release|x64 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Release|x64.ActiveCfg = Release|x64 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Release|x64.Build.0 = Release|x64 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Release|x86.ActiveCfg = Release|Win32 + {E3604156-7DF2-4B5F-AECA-64786B92F38C}.Release|x86.Build.0 = Release|Win32 + {A5A24406-1296-457B-91A3-60E67511D807}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5A24406-1296-457B-91A3-60E67511D807}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5A24406-1296-457B-91A3-60E67511D807}.Debug|x64.ActiveCfg = Debug|Any CPU + {A5A24406-1296-457B-91A3-60E67511D807}.Debug|x64.Build.0 = Debug|Any CPU + {A5A24406-1296-457B-91A3-60E67511D807}.Debug|x86.ActiveCfg = Debug|Any CPU + {A5A24406-1296-457B-91A3-60E67511D807}.Debug|x86.Build.0 = Debug|Any CPU + {A5A24406-1296-457B-91A3-60E67511D807}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5A24406-1296-457B-91A3-60E67511D807}.Release|Any CPU.Build.0 = Release|Any CPU + {A5A24406-1296-457B-91A3-60E67511D807}.Release|x64.ActiveCfg = Release|x64 + {A5A24406-1296-457B-91A3-60E67511D807}.Release|x64.Build.0 = Release|x64 + {A5A24406-1296-457B-91A3-60E67511D807}.Release|x86.ActiveCfg = Release|x86 + {A5A24406-1296-457B-91A3-60E67511D807}.Release|x86.Build.0 = Release|x86 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Debug|Any CPU.ActiveCfg = Debug|x64 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Debug|Any CPU.Build.0 = Debug|x64 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Debug|x64.ActiveCfg = Debug|x64 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Debug|x64.Build.0 = Debug|x64 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Debug|x86.ActiveCfg = Debug|Win32 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Debug|x86.Build.0 = Debug|Win32 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Release|Any CPU.ActiveCfg = Release|x64 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Release|Any CPU.Build.0 = Release|x64 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Release|x64.ActiveCfg = Release|x64 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Release|x64.Build.0 = Release|x64 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Release|x86.ActiveCfg = Release|Win32 + {85044A5C-C4A3-4C79-9AD5-6895F61F8515}.Release|x86.Build.0 = Release|Win32 + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Debug|x64.ActiveCfg = Debug|Any CPU + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Debug|x64.Build.0 = Debug|Any CPU + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Debug|x86.ActiveCfg = Debug|Any CPU + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Debug|x86.Build.0 = Debug|Any CPU + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Release|Any CPU.Build.0 = Release|Any CPU + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Release|x64.ActiveCfg = Release|x64 + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Release|x64.Build.0 = Release|x64 + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Release|x86.ActiveCfg = Release|x86 + {7B2D3886-A213-4F99-89F7-D0D7DDAA97D9}.Release|x86.Build.0 = Release|x86 + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Debug|x64.ActiveCfg = Debug|Any CPU + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Debug|x64.Build.0 = Debug|Any CPU + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Debug|x86.ActiveCfg = Debug|Any CPU + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Debug|x86.Build.0 = Debug|Any CPU + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Release|Any CPU.Build.0 = Release|Any CPU + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Release|x64.ActiveCfg = Release|x64 + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Release|x64.Build.0 = Release|x64 + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Release|x86.ActiveCfg = Release|x86 + {6BE1ED72-6CA9-4442-B529-C867A9D6904C}.Release|x86.Build.0 = Release|x86 + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Debug|x64.ActiveCfg = Debug|Any CPU + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Debug|x64.Build.0 = Debug|Any CPU + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Debug|x86.ActiveCfg = Debug|Any CPU + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Debug|x86.Build.0 = Debug|Any CPU + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Release|Any CPU.Build.0 = Release|Any CPU + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Release|x64.ActiveCfg = Release|x64 + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Release|x64.Build.0 = Release|x64 + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Release|x86.ActiveCfg = Release|x86 + {D5E3C871-EA87-48E7-9287-E96B8410EB18}.Release|x86.Build.0 = Release|x86 + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Debug|x64.ActiveCfg = Debug|Any CPU + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Debug|x64.Build.0 = Debug|Any CPU + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Debug|x86.ActiveCfg = Debug|Any CPU + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Debug|x86.Build.0 = Debug|Any CPU + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Release|Any CPU.Build.0 = Release|Any CPU + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Release|x64.ActiveCfg = Release|Any CPU + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Release|x64.Build.0 = Release|Any CPU + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Release|x86.ActiveCfg = Release|Any CPU + {D6614743-D01E-4899-A5E7-B4E45BD1B033}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {01ED3EE8-E89A-4A27-AF68-EF2490CB6BD7} + EndGlobalSection +EndGlobal diff --git a/cerebellum_xyzero_keygenme/source/sp_keygen/Program.cs b/cerebellum_xyzero_keygenme/source/sp_keygen/Program.cs new file mode 100644 index 0000000..fbedbde --- /dev/null +++ b/cerebellum_xyzero_keygenme/source/sp_keygen/Program.cs @@ -0,0 +1,69 @@ +using System.Runtime.InteropServices; +using System.Text; + +namespace sp_keygen +{ + internal class Program + { + // P/Invoke declaration for GetComputerNameA + [DllImport("kernel32.dll", CharSet = CharSet.Ansi, SetLastError = true)] + public static extern bool GetComputerNameA(StringBuilder lpBuffer, ref uint nSize); + + // P/Invoke declaration for GetUserNameA + [DllImport("advapi32.dll", CharSet = CharSet.Ansi, SetLastError = true)] + public static extern bool GetUserNameA(StringBuilder lpBuffer, ref uint nSize); + + static void Main() + { + Console.Write("Name: "); + string name = Console.ReadLine() ?? throw new Exception("Not a valid name"); + + StringBuilder computerName = new(256); + StringBuilder userName = new(256); + + uint size1 = (uint)computerName.Capacity; + uint size2 = (uint)userName.Capacity; + if (GetComputerNameA(computerName, ref size1) && GetUserNameA(userName, ref size2)) + CalcSerial(name, computerName.ToString(), userName.ToString()); + else + Console.WriteLine("Something Wrong"); + Console.ReadKey(); + } + + public static void CalcSerial(string name, string computerName, string userName) + { + int v8 = 0x1791117; + int v18 = name.Length; + int v4 = 0; + int vc = 0; + int esi; + int eax = 0x20; + string cuu = ReverseString(computerName + userName).ToUpper(); + if (v18 < 4) + return; + foreach (char c in name) + { + v4 += c + v8++; + } + esi = v18 * v4 + v8; + foreach (char c in cuu) + { + vc += (c ^ eax++) * v18; + } + // long serial; + // serial ^=vc; + // vc+=esi; + // if(vc == serial) + Console.WriteLine((vc + esi) ^ vc); + } + + public static string ReverseString(string input) + { + if (input == null) + throw new ArgumentNullException(nameof(input), "Input string cannot be null."); + return new string(input.Reverse().ToArray()); + } + + + } +} diff --git a/cerebellum_xyzero_keygenme/source/sp_keygen/Properties/Resources.Designer.cs b/cerebellum_xyzero_keygenme/source/sp_keygen/Properties/Resources.Designer.cs new file mode 100644 index 0000000..41461b5 --- /dev/null +++ b/cerebellum_xyzero_keygenme/source/sp_keygen/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace sp_keygen.Properties { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("sp_keygen.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/cerebellum_xyzero_keygenme/source/sp_keygen/Properties/Resources.resx b/cerebellum_xyzero_keygenme/source/sp_keygen/Properties/Resources.resx new file mode 100644 index 0000000..4fdb1b6 --- /dev/null +++ b/cerebellum_xyzero_keygenme/source/sp_keygen/Properties/Resources.resx @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/cerebellum_xyzero_keygenme/source/sp_keygen/Properties/launchSettings.json b/cerebellum_xyzero_keygenme/source/sp_keygen/Properties/launchSettings.json new file mode 100644 index 0000000..d32d884 --- /dev/null +++ b/cerebellum_xyzero_keygenme/source/sp_keygen/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "sp_keygen": { + "commandName": "Project", + "commandLineArgs": "chenx221\r\n123-456-789-X" + } + } +} \ No newline at end of file diff --git a/cerebellum_xyzero_keygenme/source/sp_keygen/sp_keygen.csproj b/cerebellum_xyzero_keygenme/source/sp_keygen/sp_keygen.csproj new file mode 100644 index 0000000..6ca6170 --- /dev/null +++ b/cerebellum_xyzero_keygenme/source/sp_keygen/sp_keygen.csproj @@ -0,0 +1,25 @@ + + + + Exe + net8.0 + enable + enable + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + +