solved new crackme
This commit is contained in:
parent
1d06e419c4
commit
f6f6fd0444
BIN
bengaly_crkme/CRACKME1.EXE
Normal file
BIN
bengaly_crkme/CRACKME1.EXE
Normal file
Binary file not shown.
BIN
bengaly_crkme/CRACKME1_FIX.EXE
Normal file
BIN
bengaly_crkme/CRACKME1_FIX.EXE
Normal file
Binary file not shown.
23
bengaly_crkme/keygen/keygen1.deps.json
Normal file
23
bengaly_crkme/keygen/keygen1.deps.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"runtimeTarget": {
|
||||||
|
"name": ".NETCoreApp,Version=v8.0",
|
||||||
|
"signature": ""
|
||||||
|
},
|
||||||
|
"compilationOptions": {},
|
||||||
|
"targets": {
|
||||||
|
".NETCoreApp,Version=v8.0": {
|
||||||
|
"keygen1/1.0.0": {
|
||||||
|
"runtime": {
|
||||||
|
"keygen1.dll": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libraries": {
|
||||||
|
"keygen1/1.0.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
bengaly_crkme/keygen/keygen1.dll
Normal file
BIN
bengaly_crkme/keygen/keygen1.dll
Normal file
Binary file not shown.
BIN
bengaly_crkme/keygen/keygen1.exe
Normal file
BIN
bengaly_crkme/keygen/keygen1.exe
Normal file
Binary file not shown.
19
bengaly_crkme/keygen/keygen1.runtimeconfig.json
Normal file
19
bengaly_crkme/keygen/keygen1.runtimeconfig.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"tfm": "net8.0",
|
||||||
|
"frameworks": [
|
||||||
|
{
|
||||||
|
"name": "Microsoft.NETCore.App",
|
||||||
|
"version": "8.0.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Microsoft.WindowsDesktop.App",
|
||||||
|
"version": "8.0.0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configProperties": {
|
||||||
|
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
||||||
|
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
122
bengaly_crkme/solve.md
Normal file
122
bengaly_crkme/solve.md
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
不清楚是不是兼容问题,这个crackme在winxp、win7都无法显示窗体
|
||||||
|
|
||||||
|
1. 修bug
|
||||||
|
|
||||||
|
排查了一下
|
||||||
|
|
||||||
|
```assembly
|
||||||
|
0040108B | 6A 00 | push 0 |
|
||||||
|
0040108D | 6A 00 | push 0 |
|
||||||
|
0040108F | 6A 00 | push 0 |
|
||||||
|
00401091 | 68 1F304000 | push crackme1.40301F | 40301F:"MainWindow"
|
||||||
|
00401096 | FF35 3C314000 | push dword ptr ds:[40313C] |
|
||||||
|
0040109C | E8 1F020000 | call <JMP.&_CreateDialogParamA@20> |
|
||||||
|
```
|
||||||
|
|
||||||
|
这里call完之后返回值为null,错误`0x57F`
|
||||||
|
|
||||||
|
尝试下修一下
|
||||||
|
|
||||||
|
```assembly
|
||||||
|
00401096 | FF35 3C314000 | push dword ptr ds:[40313C] | Patch
|
||||||
|
|
||||||
|
00401096 | 6A 00 | push 0 |
|
||||||
|
00401098 | 90 | nop |
|
||||||
|
00401099 | 90 | nop |
|
||||||
|
0040109A | 90 | nop |
|
||||||
|
0040109B | 90 | nop |
|
||||||
|
```
|
||||||
|
|
||||||
|
2. name
|
||||||
|
|
||||||
|
```assembly
|
||||||
|
0040124B | 55 | push ebp |
|
||||||
|
0040124C | 8BEC | mov ebp,esp |
|
||||||
|
0040124E | 53 | push ebx |
|
||||||
|
0040124F | 51 | push ecx | ecx:_lstrlenA@4+2F
|
||||||
|
00401250 | 52 | push edx |
|
||||||
|
00401251 | 57 | push edi |
|
||||||
|
00401252 | 56 | push esi |
|
||||||
|
00401253 | 55 | push ebp |
|
||||||
|
00401254 | 33D2 | xor edx,edx |
|
||||||
|
00401256 | 8B75 08 | mov esi,dword ptr ss:[ebp+8] |
|
||||||
|
00401259 | 8B4D 0C | mov ecx,dword ptr ss:[ebp+C] | ecx:_lstrlenA@4+2F
|
||||||
|
0040125C | 49 | dec ecx | ecx:_lstrlenA@4+2F
|
||||||
|
0040125D | 0FBE06 | movsx eax,byte ptr ds:[esi] | 循环
|
||||||
|
00401260 | 2B05 00304000 | sub eax,dword ptr ds:[403000] |
|
||||||
|
00401266 | 0FBE5E 01 | movsx ebx,byte ptr ds:[esi+1] |
|
||||||
|
0040126A | 2B1D 04304000 | sub ebx,dword ptr ds:[403004] |
|
||||||
|
00401270 | 0FAFC3 | imul eax,ebx |
|
||||||
|
00401273 | 03D0 | add edx,eax |
|
||||||
|
00401275 | 46 | inc esi |
|
||||||
|
00401276 | E2 E5 | loop crackme1_fix.40125D |
|
||||||
|
00401278 | 8BC2 | mov eax,edx |
|
||||||
|
0040127A | 5D | pop ebp |
|
||||||
|
0040127B | 5E | pop esi |
|
||||||
|
0040127C | 5F | pop edi |
|
||||||
|
0040127D | 5A | pop edx |
|
||||||
|
0040127E | 59 | pop ecx | ecx:_lstrlenA@4+2F
|
||||||
|
0040127F | 5B | pop ebx |
|
||||||
|
00401280 | C9 | leave |
|
||||||
|
00401281 | C2 0800 | ret 8 |
|
||||||
|
```
|
||||||
|
|
||||||
|
```c#
|
||||||
|
string name = "userinput";
|
||||||
|
int ecx = name.Length - 1;
|
||||||
|
int index = 0;
|
||||||
|
int edx = 0;
|
||||||
|
|
||||||
|
while (ecx > 0)
|
||||||
|
{
|
||||||
|
char c = (char)(name[index] - '*');
|
||||||
|
char c2 = (char)(name[index + 1] - 'A');
|
||||||
|
c = (char)(c * c2);
|
||||||
|
edx += (int)c;
|
||||||
|
index++;
|
||||||
|
ecx--;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Name(不能使用数字)会计算出一个edx值
|
||||||
|
|
||||||
|
3. Serial
|
||||||
|
|
||||||
|
```assembly
|
||||||
|
00401284 | 55 | push ebp |
|
||||||
|
00401285 | 8BEC | mov ebp,esp |
|
||||||
|
00401287 | 53 | push ebx |
|
||||||
|
00401288 | 51 | push ecx | ecx:_lstrlenA@4+2F
|
||||||
|
00401289 | 52 | push edx |
|
||||||
|
0040128A | 56 | push esi |
|
||||||
|
0040128B | 57 | push edi |
|
||||||
|
0040128C | 55 | push ebp |
|
||||||
|
0040128D | 8B75 08 | mov esi,dword ptr ss:[ebp+8] |
|
||||||
|
00401290 | 8B4D 0C | mov ecx,dword ptr ss:[ebp+C] | ecx:_lstrlenA@4+2F
|
||||||
|
00401293 | 33D2 | xor edx,edx |
|
||||||
|
00401295 | 0FB64431 FF | movzx eax,byte ptr ds:[ecx+esi-1] |
|
||||||
|
0040129A | 83E8 30 | sub eax,30 |
|
||||||
|
0040129D | 51 | push ecx | ecx:_lstrlenA@4+2F
|
||||||
|
0040129E | 8BD9 | mov ebx,ecx | ecx:_lstrlenA@4+2F
|
||||||
|
004012A0 | 2B4D 0C | sub ecx,dword ptr ss:[ebp+C] | ecx:_lstrlenA@4+2F
|
||||||
|
004012A3 | F7D9 | neg ecx | ecx:_lstrlenA@4+2F
|
||||||
|
004012A5 | 85C9 | test ecx,ecx | ecx:_lstrlenA@4+2F
|
||||||
|
004012A7 | 74 05 | je crackme1_fix.4012AE |
|
||||||
|
004012A9 | 6BC0 0A | imul eax,eax,A |
|
||||||
|
004012AC | E2 FB | loop crackme1_fix.4012A9 |
|
||||||
|
004012AE | 59 | pop ecx | ecx:_lstrlenA@4+2F
|
||||||
|
004012AF | 03D0 | add edx,eax |
|
||||||
|
004012B1 | E2 E2 | loop crackme1_fix.401295 |
|
||||||
|
004012B3 | 8BC2 | mov eax,edx |
|
||||||
|
004012B5 | 5D | pop ebp |
|
||||||
|
004012B6 | 5F | pop edi |
|
||||||
|
004012B7 | 5E | pop esi |
|
||||||
|
004012B8 | 5A | pop edx |
|
||||||
|
004012B9 | 59 | pop ecx | ecx:_lstrlenA@4+2F
|
||||||
|
004012BA | 5B | pop ebx |
|
||||||
|
004012BB | C9 | leave |
|
||||||
|
004012BC | C2 0800 | ret 8 |
|
||||||
|
```
|
||||||
|
|
||||||
|
这里似乎只是将传入的serial字符串转成整形,后面比较用
|
||||||
|
|
79
bengaly_crkme/source/keygen1.sln
Normal file
79
bengaly_crkme/source/keygen1.sln
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
|
||||||
|
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
|
||||||
|
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|Any CPU
|
||||||
|
{D0E162E3-FC99-4405-BEE1-AB85D9D41DA9}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{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|Any CPU
|
||||||
|
{BC47A6DE-7F9D-4D65-A996-69FB778C95F3}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{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
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {01ED3EE8-E89A-4A27-AF68-EF2490CB6BD7}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
219
bengaly_crkme/source/keygen1/Form1.Designer.cs
generated
Normal file
219
bengaly_crkme/source/keygen1/Form1.Designer.cs
generated
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
namespace keygen1
|
||||||
|
{
|
||||||
|
partial class Form1
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
button1 = new Button();
|
||||||
|
label1 = new Label();
|
||||||
|
textBox1 = new TextBox();
|
||||||
|
label2 = new Label();
|
||||||
|
textBox2 = new TextBox();
|
||||||
|
label3 = new Label();
|
||||||
|
checkBox1 = new CheckBox();
|
||||||
|
button2 = new Button();
|
||||||
|
button3 = new Button();
|
||||||
|
label4 = new Label();
|
||||||
|
textBox3 = new TextBox();
|
||||||
|
button4 = new Button();
|
||||||
|
label5 = new Label();
|
||||||
|
textBox4 = new TextBox();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
button1.Location = new Point(393, 2);
|
||||||
|
button1.Name = "button1";
|
||||||
|
button1.Size = new Size(93, 172);
|
||||||
|
button1.TabIndex = 0;
|
||||||
|
button1.Text = "Generate";
|
||||||
|
button1.UseVisualStyleBackColor = true;
|
||||||
|
button1.Click += Button1_Click;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
label1.AutoSize = true;
|
||||||
|
label1.Location = new Point(30, 18);
|
||||||
|
label1.Name = "label1";
|
||||||
|
label1.Size = new Size(39, 15);
|
||||||
|
label1.TabIndex = 1;
|
||||||
|
label1.Text = "Name";
|
||||||
|
//
|
||||||
|
// textBox1
|
||||||
|
//
|
||||||
|
textBox1.Location = new Point(75, 14);
|
||||||
|
textBox1.Name = "textBox1";
|
||||||
|
textBox1.Size = new Size(262, 23);
|
||||||
|
textBox1.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
label2.AutoSize = true;
|
||||||
|
label2.Location = new Point(34, 51);
|
||||||
|
label2.Name = "label2";
|
||||||
|
label2.Size = new Size(35, 15);
|
||||||
|
label2.TabIndex = 3;
|
||||||
|
label2.Text = "Serial";
|
||||||
|
//
|
||||||
|
// textBox2
|
||||||
|
//
|
||||||
|
textBox2.Location = new Point(75, 47);
|
||||||
|
textBox2.Name = "textBox2";
|
||||||
|
textBox2.Size = new Size(262, 23);
|
||||||
|
textBox2.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
label3.AutoSize = true;
|
||||||
|
label3.Location = new Point(312, 155);
|
||||||
|
label3.Name = "label3";
|
||||||
|
label3.Size = new Size(75, 15);
|
||||||
|
label3.TabIndex = 5;
|
||||||
|
label3.Text = "By Chenx221";
|
||||||
|
//
|
||||||
|
// checkBox1
|
||||||
|
//
|
||||||
|
checkBox1.AutoSize = true;
|
||||||
|
checkBox1.Location = new Point(75, 155);
|
||||||
|
checkBox1.Name = "checkBox1";
|
||||||
|
checkBox1.Size = new Size(89, 19);
|
||||||
|
checkBox1.TabIndex = 6;
|
||||||
|
checkBox1.Text = "Auto Mode ";
|
||||||
|
checkBox1.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// button2
|
||||||
|
//
|
||||||
|
button2.Location = new Point(343, 13);
|
||||||
|
button2.Name = "button2";
|
||||||
|
button2.Size = new Size(44, 24);
|
||||||
|
button2.TabIndex = 7;
|
||||||
|
button2.Text = "Copy";
|
||||||
|
button2.UseVisualStyleBackColor = true;
|
||||||
|
button2.Click += Button2_Click;
|
||||||
|
//
|
||||||
|
// button3
|
||||||
|
//
|
||||||
|
button3.Location = new Point(343, 47);
|
||||||
|
button3.Name = "button3";
|
||||||
|
button3.Size = new Size(44, 23);
|
||||||
|
button3.TabIndex = 8;
|
||||||
|
button3.Text = "Copy";
|
||||||
|
button3.UseVisualStyleBackColor = true;
|
||||||
|
button3.Click += Button3_Click;
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
label4.AutoSize = true;
|
||||||
|
label4.Location = new Point(10, 82);
|
||||||
|
label4.Name = "label4";
|
||||||
|
label4.Size = new Size(59, 15);
|
||||||
|
label4.TabIndex = 9;
|
||||||
|
label4.Text = "Company";
|
||||||
|
label4.Visible = false;
|
||||||
|
//
|
||||||
|
// textBox3
|
||||||
|
//
|
||||||
|
textBox3.Location = new Point(75, 79);
|
||||||
|
textBox3.Name = "textBox3";
|
||||||
|
textBox3.Size = new Size(262, 23);
|
||||||
|
textBox3.TabIndex = 10;
|
||||||
|
textBox3.Visible = false;
|
||||||
|
//
|
||||||
|
// button4
|
||||||
|
//
|
||||||
|
button4.Location = new Point(343, 79);
|
||||||
|
button4.Name = "button4";
|
||||||
|
button4.Size = new Size(44, 23);
|
||||||
|
button4.TabIndex = 11;
|
||||||
|
button4.Text = "Copy";
|
||||||
|
button4.UseVisualStyleBackColor = true;
|
||||||
|
button4.Visible = false;
|
||||||
|
button4.Click += Button4_Click;
|
||||||
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
label5.AutoSize = true;
|
||||||
|
label5.Location = new Point(31, 116);
|
||||||
|
label5.Name = "label5";
|
||||||
|
label5.Size = new Size(35, 15);
|
||||||
|
label5.TabIndex = 12;
|
||||||
|
label5.Text = "Serial";
|
||||||
|
label5.Visible = false;
|
||||||
|
//
|
||||||
|
// textBox4
|
||||||
|
//
|
||||||
|
textBox4.Location = new Point(75, 113);
|
||||||
|
textBox4.Name = "textBox4";
|
||||||
|
textBox4.Size = new Size(262, 23);
|
||||||
|
textBox4.TabIndex = 13;
|
||||||
|
textBox4.Visible = false;
|
||||||
|
//
|
||||||
|
// Form1
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(491, 183);
|
||||||
|
Controls.Add(textBox4);
|
||||||
|
Controls.Add(label5);
|
||||||
|
Controls.Add(button4);
|
||||||
|
Controls.Add(textBox3);
|
||||||
|
Controls.Add(label4);
|
||||||
|
Controls.Add(button3);
|
||||||
|
Controls.Add(button2);
|
||||||
|
Controls.Add(checkBox1);
|
||||||
|
Controls.Add(label3);
|
||||||
|
Controls.Add(textBox2);
|
||||||
|
Controls.Add(label2);
|
||||||
|
Controls.Add(textBox1);
|
||||||
|
Controls.Add(label1);
|
||||||
|
Controls.Add(button1);
|
||||||
|
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||||
|
MaximizeBox = false;
|
||||||
|
Name = "Form1";
|
||||||
|
Text = "KeyGen For bengaly_crkme";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Button button1;
|
||||||
|
private Label label1;
|
||||||
|
private TextBox textBox1;
|
||||||
|
private Label label2;
|
||||||
|
private TextBox textBox2;
|
||||||
|
private Label label3;
|
||||||
|
private CheckBox checkBox1;
|
||||||
|
private Button button2;
|
||||||
|
private Button button3;
|
||||||
|
private Label label4;
|
||||||
|
private TextBox textBox3;
|
||||||
|
private Button button4;
|
||||||
|
private Label label5;
|
||||||
|
private TextBox textBox4;
|
||||||
|
}
|
||||||
|
}
|
151
bengaly_crkme/source/keygen1/Form1.cs
Normal file
151
bengaly_crkme/source/keygen1/Form1.cs
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
|
||||||
|
|
||||||
|
namespace keygen1
|
||||||
|
{
|
||||||
|
public partial class Form1 : Form
|
||||||
|
{
|
||||||
|
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||||
|
static extern IntPtr FindWindow(string? lpClassName, string lpWindowName);
|
||||||
|
|
||||||
|
[DllImport("user32.dll", SetLastError = true)]
|
||||||
|
static extern IntPtr GetDlgItem(IntPtr hDlg, int nIDDlgItem);
|
||||||
|
|
||||||
|
[DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = false)]
|
||||||
|
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, StringBuilder? lParam);
|
||||||
|
|
||||||
|
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
|
||||||
|
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
|
||||||
|
|
||||||
|
const uint WM_SETTEXT = 0x000C;
|
||||||
|
const uint BM_CLICK = 0x00F5;
|
||||||
|
|
||||||
|
public Form1()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(textBox1.Text))
|
||||||
|
{
|
||||||
|
MessageBox.Show("Name不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//if (string.IsNullOrEmpty(textBox2.Text))
|
||||||
|
//{
|
||||||
|
// MessageBox.Show("First Name不能为空");
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
//if (string.IsNullOrEmpty(textBox3.Text))
|
||||||
|
//{
|
||||||
|
// MessageBox.Show("Company不能为空");
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
//Generate(textBox1.Text, textBox2.Text, textBox3.Text);
|
||||||
|
Generate(textBox1.Text);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Generate(string username)
|
||||||
|
{
|
||||||
|
if (username.Length <= 1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Name长度需大于1位");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(Regex.IsMatch(username, @"\d"))
|
||||||
|
{
|
||||||
|
MessageBox.Show("Name不允许包含数字");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
string? key = GenerateKey(username);
|
||||||
|
if (key == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("生成Key失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//if (!int.TryParse(username, out int serial1))
|
||||||
|
//{
|
||||||
|
// MessageBox.Show("Serial1不是有效数字");
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
//string key = GenerateKey(serial1);
|
||||||
|
//textBox4.Text = string.Join("-", key);
|
||||||
|
textBox2.Text = key;
|
||||||
|
if (checkBox1.Checked) AutoMode(username,key);
|
||||||
|
//禁用,由于controlId不固定
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string? GenerateKey(string name)
|
||||||
|
{
|
||||||
|
int edx = 0;
|
||||||
|
|
||||||
|
for (int index = 0; index < name.Length - 1; index++)
|
||||||
|
{
|
||||||
|
char c = (char)((name[index] - '*') * (name[index + 1] - 'A'));
|
||||||
|
edx += c;
|
||||||
|
}
|
||||||
|
|
||||||
|
return edx.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void AutoMode(string username, string key)
|
||||||
|
{
|
||||||
|
string windowTitle = "Crack The Hell Out Of Me By Bengaly";
|
||||||
|
IntPtr hWnd = FindWindow(null, windowTitle);
|
||||||
|
|
||||||
|
if (hWnd == IntPtr.Zero)
|
||||||
|
{
|
||||||
|
MessageBox.Show("窗口未找到");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int usernameControlId = 0x6A;
|
||||||
|
int serialControlId = 0x6B;
|
||||||
|
int submitButtonId = 0x6C;
|
||||||
|
|
||||||
|
IntPtr usernameHwnd = GetDlgItem(hWnd, usernameControlId);
|
||||||
|
IntPtr serialHwnd = GetDlgItem(hWnd, serialControlId);
|
||||||
|
IntPtr submitButtonHwnd = GetDlgItem(hWnd, submitButtonId);
|
||||||
|
|
||||||
|
if (usernameHwnd == IntPtr.Zero || serialHwnd == IntPtr.Zero || submitButtonHwnd == IntPtr.Zero)
|
||||||
|
{
|
||||||
|
MessageBox.Show("控件未找到");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder usernameToSet = new(username);
|
||||||
|
StringBuilder serialToSet = new(key);
|
||||||
|
|
||||||
|
SendMessage(usernameHwnd, WM_SETTEXT, IntPtr.Zero, usernameToSet);
|
||||||
|
SendMessage(serialHwnd, WM_SETTEXT, IntPtr.Zero, serialToSet);
|
||||||
|
SendMessage(submitButtonHwnd, BM_CLICK, IntPtr.Zero, IntPtr.Zero);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button2_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(textBox1.Text))
|
||||||
|
{
|
||||||
|
Clipboard.SetText(textBox1.Text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button3_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(textBox2.Text))
|
||||||
|
{
|
||||||
|
Clipboard.SetText(textBox2.Text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button4_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(textBox3.Text))
|
||||||
|
{
|
||||||
|
Clipboard.SetText(textBox3.Text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
bengaly_crkme/source/keygen1/Form1.resx
Normal file
120
bengaly_crkme/source/keygen1/Form1.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
17
bengaly_crkme/source/keygen1/Program.cs
Normal file
17
bengaly_crkme/source/keygen1/Program.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
namespace keygen1
|
||||||
|
{
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
|
// see https://aka.ms/applicationconfiguration.
|
||||||
|
ApplicationConfiguration.Initialize();
|
||||||
|
Application.Run(new Form1());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
31
bengaly_crkme/source/keygen1/keygen1.csproj
Normal file
31
bengaly_crkme/source/keygen1/keygen1.csproj
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<Platforms>AnyCPU;x86</Platforms>
|
||||||
|
<Authors>chenx221</Authors>
|
||||||
|
<Company>chenx221</Company>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
<DebugType>portable</DebugType>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
|
||||||
|
<DebugType>portable</DebugType>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
|
<DebugType>portable</DebugType>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
|
||||||
|
<DebugType>portable</DebugType>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
Loading…
Reference in New Issue
Block a user