diff options
author | jmpoep <OriginalEntryPoint@qq.com> | 2023-12-07 16:51:07 +0800 |
---|---|---|
committer | jmpoep <OriginalEntryPoint@qq.com> | 2023-12-07 16:51:07 +0800 |
commit | 28008a746a31abb7909dd86cb0cd413ac8943b0b (patch) | |
tree | a30b74b8cad548048c3c1551d652828ab76fa9bd /examples/dotnet/forms_cil/Form1.cs | |
download | vmprotect-3.5.1-master.tar vmprotect-3.5.1-master.tar.gz vmprotect-3.5.1-master.tar.bz2 vmprotect-3.5.1-master.zip |
Diffstat (limited to 'examples/dotnet/forms_cil/Form1.cs')
-rw-r--r-- | examples/dotnet/forms_cil/Form1.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/dotnet/forms_cil/Form1.cs b/examples/dotnet/forms_cil/Form1.cs new file mode 100644 index 0000000..a19ec42 --- /dev/null +++ b/examples/dotnet/forms_cil/Form1.cs @@ -0,0 +1,33 @@ +using System; +using System.Reflection; +using System.Windows.Forms; + +namespace forms_cil +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + private bool CheckPassword(string pwd) + { + UInt64 magicNum; + return (UInt64.TryParse(pwd, out magicNum) && magicNum % 17 == 13); + } + + [VMProtect.BeginVirtualization] + private void btnCheckPassword_Click(object sender, EventArgs e) + { + if (CheckPassword(txtPassword.Text)) + { + MessageBox.Show(VMProtect.SDK.DecryptString("Correct password"), VMProtect.SDK.DecryptString("Password check"), MessageBoxButtons.OK, MessageBoxIcon.Information); + } else + { + MessageBox.Show(VMProtect.SDK.DecryptString("Incorrect password"), VMProtect.SDK.DecryptString("Password check"), MessageBoxButtons.OK, MessageBoxIcon.Error); + txtPassword.Focus(); + } + } + } +}
\ No newline at end of file |