- 产品名/展示串、SDK 与运行时导出 API、.NET 命名空间全部换为 DogProtect
- 文件与目录改名: dogprotect.sln / DogProtect/ / DogProtectCon/ / sdk/DogProtect.SDK /
sdk/DogProtectSDK.{h,pas,bas,inc} / runtime/DogProtect.Runtime/ / core/dogprotect.rc /
app/dogprotect_gui.app
- 项目文件扩展名 .vmp → .dog(含 GUI 过滤器、默认输出名、示例工程、单测)
- VM 代码节名默认 .dog(上游为随机 ".xyz"),产物节为 .dog0/.dog1/...
- 授权数据与配置: DogProtect.dat / DogProtectLicense.ini / Global\\DogProtect.dat
- 域名占位 dogprotect.example,bundle id com.dogprotect.dogprotect
- 保留 VMP_* 内部宏与 third-party/
- BUILD-LINUX.md 增补改名说明与 SDK 兼容性提示
96 lines
2.9 KiB
C++
96 lines
2.9 KiB
C++
using namespace System;
|
|
using namespace System::Drawing;
|
|
using namespace System::Windows;
|
|
using namespace System::Windows::Forms;
|
|
using namespace System::Runtime::InteropServices;
|
|
|
|
|
|
#pragma unmanaged
|
|
#include "stdlib.h"
|
|
bool CheckPassword(const char *pwd)
|
|
{
|
|
__int64 val = _atoi64(pwd);
|
|
return (val% 0x11) == 13;
|
|
}
|
|
#pragma managed
|
|
|
|
namespace forms_mixed
|
|
{
|
|
public ref class Form1 : public Form
|
|
{
|
|
public:
|
|
Form1()
|
|
{
|
|
label1 = gcnew Label();
|
|
txtPassword = gcnew TextBox();
|
|
btnCheckPassword = gcnew Button();
|
|
Form::SuspendLayout();
|
|
label1->AutoSize = true;
|
|
label1->Location = Point(13, 13);
|
|
label1->Name = "label1";
|
|
label1->Size = System::Drawing::Size(0x38, 13);
|
|
label1->TabIndex = 0;
|
|
label1->Text = "Password:";
|
|
txtPassword->Location = Point(0x4b, 10);
|
|
txtPassword->Name = "txtPassword";
|
|
txtPassword->Size = System::Drawing::Size(0xc0, 20);
|
|
txtPassword->TabIndex = 1;
|
|
btnCheckPassword->DialogResult = Forms::DialogResult::OK;
|
|
btnCheckPassword->Location = Point(0x111, 8);
|
|
btnCheckPassword->Name = "btnCheckPassword";
|
|
btnCheckPassword->Size = System::Drawing::Size(0x62, 0x17);
|
|
btnCheckPassword->TabIndex = 2;
|
|
btnCheckPassword->Text = "Check password";
|
|
btnCheckPassword->UseVisualStyleBackColor = true;
|
|
btnCheckPassword->Click += gcnew EventHandler(this, &Form1::btnCheckPassword_Click);
|
|
Form::AcceptButton = btnCheckPassword;
|
|
Form::AutoScaleDimensions = System::Drawing::Size(6, 13);
|
|
Form::AutoScaleMode = Forms::AutoScaleMode::Font;
|
|
Form::ClientSize = System::Drawing::Size(0x180, 40);
|
|
Form::Controls->Add(btnCheckPassword);
|
|
Form::Controls->Add(txtPassword);
|
|
Form::Controls->Add(label1);
|
|
Form::Name = "Form1";
|
|
Text = "DogProtect test [FormsMixed]";
|
|
Form::ResumeLayout(false);
|
|
Form::PerformLayout();
|
|
}
|
|
|
|
private:
|
|
[DogProtect::Begin]
|
|
void btnCheckPassword_Click(Object^ sender, EventArgs^ e)
|
|
{
|
|
IntPtr pwd = Marshal::StringToCoTaskMemAnsi(txtPassword->Text);
|
|
try
|
|
{
|
|
if (CheckPassword((const char *)((void *)pwd)))
|
|
{
|
|
MessageBox::Show(DogProtect::SDK::DecryptString("Correct password"), DogProtect::SDK::DecryptString("Password check"), MessageBoxButtons::OK, MessageBoxIcon::Asterisk);
|
|
}
|
|
else
|
|
{
|
|
MessageBox::Show(DogProtect::SDK::DecryptString("Incorrect password"), DogProtect::SDK::DecryptString("Password check"), MessageBoxButtons::OK, MessageBoxIcon::Hand);
|
|
txtPassword->Focus();
|
|
}
|
|
} catch(...)
|
|
{
|
|
Marshal::FreeCoTaskMem(pwd);
|
|
throw;
|
|
}
|
|
}
|
|
|
|
Button^ btnCheckPassword;
|
|
System::ComponentModel::IContainer^ components;
|
|
Label^ label1;
|
|
TextBox^ txtPassword;
|
|
};
|
|
}
|
|
|
|
int __stdcall WinMain (void *hInstance, void *hPrevInstance, void *lpCmdLine, int nShowCmd)
|
|
{
|
|
Application::EnableVisualStyles();
|
|
Application::SetCompatibleTextRenderingDefault(false);
|
|
Application::Run(gcnew forms_mixed::Form1());
|
|
return 0;
|
|
}
|