Log in

View Full Version : .net / reflector help needed...


j00n
April 22nd, 2009, 09:38
Code:
Private Sub InitializeLicenseController()
Try
Me.lc = New LicenseController("programnamehere", New Integer() { 1, 2 }, 36)
Catch permissions As NotEnoughPermissions
MessageBox.Show((" programnamehere was unable to connect to your Registry in order to" & ChrW(10) & "verify your installation. Make sure you are logged in as an" & ChrW(10) & "Administrator, or have appropriate permissions to read/write" & ChrW(10) & "the Windows Registry" & ChrW(10) & ChrW(10) & "The exact error was: " & permissions.Message), "Registry Error", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
Environment.Exit(1)
Catch exception As NoInternetException
MessageBox.Show(("programnamehere was not able to verify your license key." & ChrW(10) & "Please check that you have an active internet connection" & ChrW(10) & "and your Anti-Virus or Firewall software is configured" & ChrW(10) & "to allow programnamehere to connect to the internet and try again." & ChrW(10) & ChrW(10) & "The exact error was: " & exception.Message), "No Internet Connection Detected", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
Environment.Exit(1)
Catch exception2 As TrialTamperedException
MessageBox.Show(("It appears that the Trial Version of this software" & ChrW(10) & "has been tampered with. Please contact the manufacturer" & ChrW(10) & "at email@email.com." & ChrW(10) & ChrW(10) & "The exact error was: " & exception2.Message), "Trial Version Tampered", MessageBoxButtons.OK, MessageBoxIcon.Hand)
Environment.Exit(1)
Catch exception3 As Exception
MessageBox.Show(("An unknown error ocurred when trying to verify" & ChrW(10) & "your license key. Please report this error to" & ChrW(10) & "email@email.com and include the following:" & ChrW(10) & ChrW(10) & exception3.Message), "Unknown Error Verifying License", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
Environment.Exit(1)
End Try
End Sub




please point me in the right direction...

I need to get rid of the msgbox and environment.exit...

i've tried everything... no luck!



Code:
Offset OpCode Operand
0 nop
1 newarr System.Int32
6 nop
7 ldstr programname
12 ldc.i4.2
13 ldloc.s -> (4) V_4 (System.Int32[])
15 ldarg.0
16 stloc.s -> (4) V_4 (System.Int32[])
18 ldc.i4.0
19 ldc.i4.1
20 stelem.i4
21 ldloc.s -> (4) V_4 (System.Int32[])
23 ldc.i4.1
24 ldc.i4.2
25 stelem.i4
26 ldloc.s -> (4) V_4 (System.Int32[])
28 ldc.r8 36
37 stfld companyname.LicenseController programname.frmMain::lc
42 nop
43 newobj System.Void companyname.LicenseController::.ctor(System.String,System.Int32[],System.Double)
48 leave -> (85) nop
53 stloc.0
54 nop
55 ldstr programname was unable to connect to your Registry in order to
verify your installation. Make sure you are logged in as an
Administrator, or have appropriate permissions to read/write
the Windows Registry

The exact error was:
60 ldloc.0
61 callvirt System.String System.Exception::get_Message()
66 call System.String System.String::Concat(System.String,System.String)
71 ldstr Registry Error
76 ldc.i4.0
77 ldc.i4.s 64
79 call System.Windows.Forms.DialogResult System.Windows.Forms.MessageBox::Show(System.String,System.String,System.Windows.Forms.MessageBoxBut tons,System.Windows.Forms.MessageBoxIcon)
84 pop
85 ldc.i4.1
86 call System.Void System.Environment::Exit(System.Int32)
91 nop
92 nop
93 leave.s -> (85) nop
95 stloc.1
96 nop
97 ldstr programname was not able to verify your license key.
Please check that you have an active internet connection
and your Anti-Virus or Firewall software is configured
to allow programname to connect to the internet and try again.

The exact error was:
102 ldloc.1
103 callvirt System.String System.Exception::get_Message()
108 call System.String System.String::Concat(System.String,System.String)
113 ldstr No Internet Connection Detected
118 ldc.i4.0
119 ldc.i4.s 64
121 call System.Windows.Forms.DialogResult System.Windows.Forms.MessageBox::Show(System.String,System.String,System.Windows.Forms.MessageBoxBut tons,System.Windows.Forms.MessageBoxIcon)
126 pop
127 ldc.i4.1
128 call System.Void System.Environment::Exit(System.Int32)
133 nop
134 nop
135 leave.s -> (85) nop
137 stloc.2
138 nop
139 ldstr It appears that the Trial Version of this software
has been tampered with. Please contact the manufacturer
at support@companyname.com.

The exact error was:
144 ldloc.2
145 callvirt System.String System.Exception::get_Message()
150 call System.String System.String::Concat(System.String,System.String)
155 ldstr Trial Version Tampered
160 ldc.i4.0
161 ldc.i4.s 16
163 call System.Windows.Forms.DialogResult System.Windows.Forms.MessageBox::Show(System.String,System.String,System.Windows.Forms.MessageBoxBut tons,System.Windows.Forms.MessageBoxIcon)
168 pop
169 ldc.i4.1
170 call System.Void System.Environment::Exit(System.Int32)
175 nop
176 nop
177 leave.s -> (85) nop
179 stloc.3
180 nop
181 ldstr An unknown error ocurred when trying to verify
your license key. Please report this error to
supportr@companyname.com and include the following:


186 ldloc.3
187 callvirt System.String System.Exception::get_Message()
192 call System.String System.String::Concat(System.String,System.String)
197 ldstr Unknown Error Verifying License
202 ldc.i4.0
203 ldc.i4.s 64
205 call System.Windows.Forms.DialogResult System.Windows.Forms.MessageBox::Show(System.String,System.String,System.Windows.Forms.MessageBoxBut tons,System.Windows.Forms.MessageBoxIcon)
210 pop
211 ldc.i4.1
212 call System.Void System.Environment::Exit(System.Int32)
217 nop
218 nop
219 leave.s -> (85) nop
221 nop
222 ret


equilvalent IL code

fr33ke
April 22nd, 2009, 10:55
Look inside the constructor of LicenseController (LicenseController.ctor). That is what is called at `New LicenseController'.
Try to patch the problem at the core, so it doesn't throw the exceptions and Me.lc is set correctly.