@ Stewie, I don't like .NET because it can be easily disassembled. For instance, I built a registration system in VB.NET, and I am able to disassemble it with the following command:
C:\Users\Ethin\Documents\Visual Studio 2013\Projects\RGAUI\RGAUI\bin\Debug>ildasm rgaui.exe
Of course, I can obfuscate the code, but obfuscators cost lots of money, and its just not worth it. Plus, MSIL is very easy to read.
Example: keyrwzrd : void():
.method private instance void keyrwzrd() cil managed
{
// Code size 548 (0x224)
.maxstack 5
.locals init ([0] valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult correct,
[1] string email,
[2] class [mscorlib]System.Random Generator,
[3] string name,
[4] string oldkey,
[5] string oldpidn,
[6] string phone,
[7] int32 pidn,
[8] string pnames,
[9] string[] VB$t_array$S0,
[10] bool VB$CG$t_bool$S0)
IL_0000: nop
IL_0001: newobj instance void [mscorlib]System.Random::.ctor()
IL_0006: stloc.2
IL_0007: ldloc.2
IL_0008: ldc.i4 0x3e8
IL_000d: ldc.i4 0x270f
IL_0012: callvirt instance int32 [mscorlib]System.Random::Next(int32,
int32)
IL_0017: stloc.s pidn
IL_0019: ldstr "Enter the name of the person who the product will "
+ "be registered to: "
IL_001e: ldstr "Key Replacement Request Wizard"
IL_0023: ldstr ""
IL_0028: ldc.i4.m1
IL_0029: ldc.i4.m1
IL_002a: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.Interaction::InputBox(string,
string,
string,
int32,
int32)
IL_002f: stloc.3
IL_0030: ldstr "If available, enter your old product key. It must "
+ "be exactly as was given in your email that was sent to you upon complet"
+ "ion of your order, and must match the registration name entered and the"
+ " PIDN given to you at the start of this order. Note that, if you do not"
+ " enter your old product key, a new one will have to be generated, despi"
+ "te the name entered here, even if it is in our records, and may delay t"
+ "he generation and transmission of your product key."
IL_0035: ldstr "Key Replacement Request Wizard"
IL_003a: ldstr ""
IL_003f: ldc.i4.m1
IL_0040: ldc.i4.m1
IL_0041: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.Interaction::InputBox(string,
string,
string,
int32,
int32)
IL_0046: stloc.s oldkey
IL_0048: ldstr "If applicable, enter the old four digit PIDN that "
+ "was used when you last ordered this product."
IL_004d: ldstr "Key Replacement Request Wizard"
IL_0052: ldstr ""
IL_0057: ldc.i4.m1
IL_0058: ldc.i4.m1
IL_0059: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.Interaction::InputBox(string,
string,
string,
int32,
int32)
IL_005e: stloc.s oldpidn
IL_0060: ldstr "Enter a telephone number in case we need to contac"
+ "t you: "
IL_0065: ldstr "Key Replacement Request Wizard"
IL_006a: ldstr ""
IL_006f: ldc.i4.m1
IL_0070: ldc.i4.m1
IL_0071: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.Interaction::InputBox(string,
string,
string,
int32,
int32)
IL_0076: stloc.s phone
IL_0078: ldstr "Enter your e-mail address."
IL_007d: ldstr "Key Replacement Request Wizard"
IL_0082: ldstr ""
IL_0087: ldc.i4.m1
IL_0088: ldc.i4.m1
IL_0089: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.Interaction::InputBox(string,
string,
string,
int32,
int32)
IL_008e: stloc.1
IL_008f: ldstr "Enter the product names that you wish to order, e."
+ "g.: Snow Race. Separate them with commas: "
IL_0094: ldstr "Key Replacement Request Wizard"
IL_0099: ldstr ""
IL_009e: ldc.i4.m1
IL_009f: ldc.i4.m1
IL_00a0: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.Interaction::InputBox(string,
string,
string,
int32,
int32)
IL_00a5: stloc.s pnames
IL_00a7: ldc.i4.s 15
IL_00a9: newarr [mscorlib]System.String
IL_00ae: stloc.s VB$t_array$S0
IL_00b0: ldloc.s VB$t_array$S0
IL_00b2: ldc.i4.0
IL_00b3: ldstr "Is this information correct\? \r\nKey replacement req"
+ "uest\r\nRegistered user: \r\n"
IL_00b8: stelem.ref
IL_00b9: nop
IL_00ba: ldloc.s VB$t_array$S0
IL_00bc: ldc.i4.1
IL_00bd: ldloc.3
IL_00be: stelem.ref
IL_00bf: nop
IL_00c0: ldloc.s VB$t_array$S0
IL_00c2: ldc.i4.2
IL_00c3: ldstr "\r\nOld product key: \r\n"
IL_00c8: stelem.ref
IL_00c9: nop
IL_00ca: ldloc.s VB$t_array$S0
IL_00cc: ldc.i4.3
IL_00cd: ldloc.s oldkey
IL_00cf: stelem.ref
IL_00d0: nop
IL_00d1: ldloc.s VB$t_array$S0
IL_00d3: ldc.i4.4
IL_00d4: ldstr "\r\nOld PIDN: \r\n"
IL_00d9: stelem.ref
IL_00da: nop
IL_00db: ldloc.s VB$t_array$S0
IL_00dd: ldc.i4.5
IL_00de: ldloc.s oldpidn
IL_00e0: stelem.ref
IL_00e1: nop
IL_00e2: ldloc.s VB$t_array$S0
IL_00e4: ldc.i4.6
IL_00e5: ldstr "\r\nPhone number: \r\n"
IL_00ea: stelem.ref
IL_00eb: nop
IL_00ec: ldloc.s VB$t_array$S0
IL_00ee: ldc.i4.7
IL_00ef: ldloc.s phone
IL_00f1: stelem.ref
IL_00f2: nop
IL_00f3: ldloc.s VB$t_array$S0
IL_00f5: ldc.i4.8
IL_00f6: ldstr "\r\nEmail address: \r\n"
IL_00fb: stelem.ref
IL_00fc: nop
IL_00fd: ldloc.s VB$t_array$S0
IL_00ff: ldc.i4.s 9
IL_0101: ldloc.1
IL_0102: stelem.ref
IL_0103: nop
IL_0104: ldloc.s VB$t_array$S0
IL_0106: ldc.i4.s 10
IL_0108: ldstr "\r\nProducts requested: \r\n"
IL_010d: stelem.ref
IL_010e: nop
IL_010f: ldloc.s VB$t_array$S0
IL_0111: ldc.i4.s 11
IL_0113: ldloc.s pnames
IL_0115: stelem.ref
IL_0116: nop
IL_0117: ldloc.s VB$t_array$S0
IL_0119: ldc.i4.s 12
IL_011b: ldstr "\r\nPIDN: \r\n"
IL_0120: stelem.ref
IL_0121: nop
IL_0122: ldloc.s VB$t_array$S0
IL_0124: ldc.i4.s 13
IL_0126: ldloc.s pidn
IL_0128: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.Conversions::ToString(int32)
IL_012d: stelem.ref
IL_012e: nop
IL_012f: ldloc.s VB$t_array$S0
IL_0131: ldc.i4.s 14
IL_0133: ldstr "\r\nTo confirm this, click yes. Otherwise, click no "
+ "to start over again."
IL_0138: stelem.ref
IL_0139: nop
IL_013a: ldloc.s VB$t_array$S0
IL_013c: call string [mscorlib]System.String::Concat(string[])
IL_0141: ldstr "Key Replacement Request Wizard"
IL_0146: ldc.i4.4
IL_0147: call valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult [System.Windows.Forms]System.Windows.Forms.MessageBox::Show(string,
string,
valuetype [System.Windows.Forms]System.Windows.Forms.MessageBoxButtons)
IL_014c: stloc.0
IL_014d: ldloc.0
IL_014e: ldc.i4.6
IL_014f: ceq
IL_0151: stloc.s VB$CG$t_bool$S0
IL_0153: ldloc.s VB$CG$t_bool$S0
IL_0155: brfalse IL_0219
IL_015a: call class RGAUI.My.MyComputer RGAUI.My.MyProject::get_Computer()
IL_015f: callvirt instance class [Microsoft.VisualBasic]Microsoft.VisualBasic.MyServices.ClipboardProxy [Microsoft.VisualBasic]Microsoft.VisualBasic.Devices.Computer::get_Clipboard()
IL_0164: ldc.i4.s 15
IL_0166: newarr [mscorlib]System.String
IL_016b: stloc.s VB$t_array$S0
IL_016d: ldloc.s VB$t_array$S0
IL_016f: ldc.i4.0
IL_0170: ldstr "Key replacement request\r\nRegistered user: \r\n"
IL_0175: stelem.ref
IL_0176: nop
IL_0177: ldloc.s VB$t_array$S0
IL_0179: ldc.i4.1
IL_017a: ldloc.3
IL_017b: stelem.ref
IL_017c: nop
IL_017d: ldloc.s VB$t_array$S0
IL_017f: ldc.i4.2
IL_0180: ldstr "\r\nOld product key: \r\n"
IL_0185: stelem.ref
IL_0186: nop
IL_0187: ldloc.s VB$t_array$S0
IL_0189: ldc.i4.3
IL_018a: ldloc.s oldkey
IL_018c: stelem.ref
IL_018d: nop
IL_018e: ldloc.s VB$t_array$S0
IL_0190: ldc.i4.4
IL_0191: ldstr "\r\nOld PIDN: \r\n"
IL_0196: stelem.ref
IL_0197: nop
IL_0198: ldloc.s VB$t_array$S0
IL_019a: ldc.i4.5
IL_019b: ldloc.s oldpidn
IL_019d: stelem.ref
IL_019e: nop
IL_019f: ldloc.s VB$t_array$S0
IL_01a1: ldc.i4.6
IL_01a2: ldstr "\r\nPhone number: \r\n"
IL_01a7: stelem.ref
IL_01a8: nop
IL_01a9: ldloc.s VB$t_array$S0
IL_01ab: ldc.i4.7
IL_01ac: ldloc.s phone
IL_01ae: stelem.ref
IL_01af: nop
IL_01b0: ldloc.s VB$t_array$S0
IL_01b2: ldc.i4.8
IL_01b3: ldstr "\r\nEmail address: \r\n"
IL_01b8: stelem.ref
IL_01b9: nop
IL_01ba: ldloc.s VB$t_array$S0
IL_01bc: ldc.i4.s 9
IL_01be: ldloc.1
IL_01bf: stelem.ref
IL_01c0: nop
IL_01c1: ldloc.s VB$t_array$S0
IL_01c3: ldc.i4.s 10
IL_01c5: ldstr "\r\nProducts requested: \r\n"
IL_01ca: stelem.ref
IL_01cb: nop
IL_01cc: ldloc.s VB$t_array$S0
IL_01ce: ldc.i4.s 11
IL_01d0: ldloc.s pnames
IL_01d2: stelem.ref
IL_01d3: nop
IL_01d4: ldloc.s VB$t_array$S0
IL_01d6: ldc.i4.s 12
IL_01d8: ldstr "\r\nPIDN: \r\n"
IL_01dd: stelem.ref
IL_01de: nop
IL_01df: ldloc.s VB$t_array$S0
IL_01e1: ldc.i4.s 13
IL_01e3: ldloc.s pidn
IL_01e5: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.Conversions::ToString(int32)
IL_01ea: stelem.ref
IL_01eb: nop
IL_01ec: ldloc.s VB$t_array$S0
IL_01ee: ldc.i4.s 14
IL_01f0: ldstr "\r\nContact information: \r\nPhone: 701-509-0166\r\nEmai"
+ "l: [email protected]; [email protected]"
IL_01f5: stelem.ref
IL_01f6: nop
IL_01f7: ldloc.s VB$t_array$S0
IL_01f9: call string [mscorlib]System.String::Concat(string[])
IL_01fe: callvirt instance void [Microsoft.VisualBasic]Microsoft.VisualBasic.MyServices.ClipboardProxy::SetText(string)
IL_0203: nop
IL_0204: ldstr "The information you have entered has been successf"
+ "ully copied to the clipboard. You may now transmit the information that"
+ " you have entered over the internet via email to [email protected]"
+ "m or [email protected]. If you wish to purchase a different produc"
+ "t, you may either use the ordering wizard or visit the store at http://"
+ "realitygaming.no-ip.net/store. Thank you for purchasing a reality gamin"
+ "g product! Press enter to continue."
IL_0209: ldstr "Key replacement request completed!"
IL_020e: ldc.i4.0
IL_020f: ldc.i4.s 64
IL_0211: call valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult [System.Windows.Forms]System.Windows.Forms.MessageBox::Show(string,
string,
valuetype [System.Windows.Forms]System.Windows.Forms.MessageBoxButtons,
valuetype [System.Windows.Forms]System.Windows.Forms.MessageBoxIcon)
IL_0216: pop
IL_0217: br.s IL_0221
IL_0219: nop
IL_021a: ldarg.0
IL_021b: callvirt instance void [System.Windows.Forms]System.Windows.Forms.Form::Close()
IL_0220: nop
IL_0221: nop
IL_0222: nop
IL_0223: ret
} // end of method Form1::keyrwzrd
This translates to:
Private Sub keyrwzrd()
Dim Generator As System.Random = New System.Random()
Dim pidn = Generator.Next(1000, 9999)
Dim name = InputBox("Enter the name of the person who the product will be registered to: ", "Key Replacement Request Wizard")
Dim oldkey = InputBox("If available, enter your old product key. It must be exactly as was given in your email that was sent to you upon completion of your order, and must match the registration name entered and the PIDN given to you at the start of this order. Note that, if you do not enter your old product key, a new one will have to be generated, despite the name entered here, even if it is in our records, and may delay the generation and transmission of your product key.", "Key Replacement Request Wizard")
Dim oldpidn = InputBox("If applicable, enter the old four digit PIDN that was used when you last ordered this product.", "Key Replacement Request Wizard")
Dim phone = InputBox("Enter a telephone number in case we need to contact you: ", "Key Replacement Request Wizard")
Dim email = InputBox("Enter your e-mail address.", "Key Replacement Request Wizard")
Dim pnames = InputBox("Enter the product names that you wish to order, e.g.: Snow Race. Separate them with commas: ", "Key Replacement Request Wizard")
Dim correct = MessageBox.Show("Is this information correct? " & vbCrLf & "Key replacement request" & vbCrLf & "Registered user: " & vbCrLf & name & vbCrLf & "Old product key: " & vbCrLf & oldkey & vbCrLf & "Old PIDN: " & vbCrLf & oldpidn & vbCrLf & "Phone number: " & vbCrLf & phone & vbCrLf & "Email address: " & vbCrLf & email & vbCrLf & "Products requested: " & vbCrLf & pnames & vbCrLf & "PIDN: " & vbCrLf & pidn & vbCrLf & "To confirm this, click yes. Otherwise, click no to start over again.", "Key Replacement Request Wizard", MessageBoxButtons.YesNo)
If correct = Windows.Forms.DialogResult.Yes Then
My.Computer.Clipboard.SetText("Key replacement request" & vbCrLf & "Registered user: " & vbCrLf & name & vbCrLf & "Old product key: " & vbCrLf & oldkey & vbCrLf & "Old PIDN: " & vbCrLf & oldpidn & vbCrLf & "Phone number: " & vbCrLf & phone & vbCrLf & "Email address: " & vbCrLf & email & vbCrLf & "Products requested: " & vbCrLf & pnames & vbCrLf & "PIDN: " & vbCrLf & pidn & vbCrLf & "Contact information: " & vbCrLf & "Phone: 701-509-0166" & vbCrLf & "Email: [email protected]; [email protected]")
MessageBox.Show("The information you have entered has been successfully copied to the clipboard. You may now transmit the information that you have entered over the internet via email to [email protected] or [email protected]. If you wish to purchase a different product, you may either use the ordering wizard or visit the store at http://realitygaming.no-ip.net/store. Thank you for purchasing a reality gaming product! Press enter to continue.", "Key replacement request completed!", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
Me.Close()
End If
End Sub
Of course, I won't, ever be using that again. We've got something else i mind. (No, don't raise your eyebrows in question like that! Your not getting the code for the new registration system!)
So, a good hint to all of you, do not use Microsoft's .NET languages if you can avoid it.
"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." — Charles Babbage.
My Github