recover .vb source code in ASP .NET

M

Maellic

Hi,

I'm currently updating a website written with ASP.NET. The original
programmer is overseas, there is no documentation, and files are all
over the place.

Here is a code snippet from one of the .vb file used by the
application (the entire code of the file is at the end of the post):

If EmissionsWebBLL.Security.ValidateLogin(txtUserName.Text,
txtPassword.Text, RptYear) = True Then

I can't find where that EmissionsWebBll class comes from. When I try
to Go To Definition, nothing happens. I've looked for an
EmissionsWebBll.vb but can't find it. I fear the source code might be
missing but as I'm not very familiar with ASP.NET, could somebody tell
me whether I should actually be looking for this file or whether I'm
getting confused? I have file called EmissionsWebBll.dll, is there a
way to recover the vb source code from that file?


Thanks for the help

Maelle

Public Class Secure
Inherits System.Web.UI.Page
Protected WithEvents txtUserName As
System.Web.UI.WebControls.TextBox
Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button
Protected WithEvents btnNewRptYear As
System.Web.UI.WebControls.Button
Protected WithEvents vlUserName As
System.Web.UI.WebControls.RequiredFieldValidator
Protected WithEvents vlPassword As
System.Web.UI.WebControls.RequiredFieldValidator
Protected WithEvents lblStatus As System.Web.UI.WebControls.Label
Protected WithEvents txtPassword As
System.Web.UI.WebControls.TextBox

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form
Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then

End If
End Sub


Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnSubmit.Click
Dim RptYear As String = CType(Request.Form("eYear"), Integer)
- 1 & "/" & Request.Form("eYear")
Dim LoginID As String

'Check to see whether username and password exists
If EmissionsWebBLL.Security.ValidateLogin(txtUserName.Text,
txtPassword.Text, RptYear) = True Then
'First check to see whether its the users first login
If EmissionsWebBLL.Security.ValidateFirstLogin(txtUserName.Text,
txtPassword.Text) = True Then
'User has changed password previously, now check how
long ago password was changed
If EmissionsWebBLL.Security.ValidatePasswordHistory(txtUserName.Text,
txtPassword.Text, RptYear) = False Then
'Password needs changing
Response.Redirect("PasswordChange.aspx?Username="
& txtUserName.Text)
Else
'Everything aok, proceed to asp page with login in
querystring
LoginID =
EmissionsWebBLL.Security.GetLoginID(txtUserName.Text,
txtPassword.Text, RptYear)
Response.Redirect("getUserDetails.asp?LoginID=" &
LoginID)
End If

Else
'User needs to activiate a new password, redirect to
FirstLogin page
Response.Redirect("FirstLogin.aspx?Username=" &
txtUserName.Text)
End If
Else
lblStatus.Text = "Incorrect username or password, try
again."
End If
End Sub

Private Sub btnNewRptYear_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnNewRptYear.Click
Dim RptYear As String = CType(Request.Form("eYear"), Integer)
- 1 & "/" & Request.Form("eYear")
'Check to see whether username and password exists
If EmissionsWebBLL.Security.ValidateLogin(txtUserName.Text,
txtPassword.Text, RptYear) = True Then
Response.Redirect("NewRPTYearSetup.asp?Alias=" &
txtUserName.Text)
Else
lblStatus.Text = "Incorrect username or password, try
again. To activate this function you must also select the most recent
reporting year."
End If
End Sub
End Class
 
T

Thomas Johansen

Hi,

I suggest you take a look at decompilers like Anakrino if you want to
recover the source code (remember all comments are gone, as these are
omitted during compilation) http://www.saurik.com/net/exemplar/

Please not, I have not tested anakrino in a while, and not sure if it can
decompile to VB.NET or only to C#.
 
T

Tommy

If "EmissionsWebBll.dll" is compiled in debug mode, and if you have
"EmissionsWebBll.pdb", then you should be able to step into the dll
and look at the source code using Visual Studio .NET.

Tommy,
 
M

Maellic

If "EmissionsWebBll.dll" is compiled in debug mode, and if you have
"EmissionsWebBll.pdb", then you should be able to step into the dll
and look at the source code using Visual Studio .NET.

Thank you for your response.

I do have EmissionsWebBll.pdb
I don't know if EmissionsWebBll.dll is compiled in debug mode, how do
I find out ?

I've tried running the project in debug mode and stepping through.
When it gets to a dll code, it asks me to locate the file Security.vb
which I don't have. When I hit cancel, it starts stepping through the
machine code.

Is there anything I can do to recover the vb source code apart from
finding a vb .net decompiler (anakrino, the one mentioned in the
previous post is only C#)?

I don't even know if that dll is a vb .net or a vb6 dll. The project
is an ASP .NET project but I have a sneaky suspicion that it might
have originally been an ASP /VB 6 project that was migrated to ASP
..NET. Any way I can find out if the .dll was written in vb .net or vb6
?

Thanks

Maelle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top