Thursday 16 March 2023

How to get code from a published ASP.Net build where we don't have source code?


If you have ever lost or misplaced your source code for an ASP.Net web application, you might wonder if there is a way to recover it from the published build on your server. The good news is that it is possible, but only with some challenges and limitations. In this blog post, I will explain how to get code from a published ASP.Net build using some tools and techniques.


What is a published ASP.Net build?

A published ASP.Net build results from compiling and packaging your web application into a set of files that can be deployed to a web server. Depending on the type of project you are using (WebForms or MVC), the structure and content of these files may vary.



--> For WebForms projects, a published build typically consists of the following:
- **.aspx** files: These web pages contain HTML markup and server-side controls. They are usually not compiled and can be edited directly.
- **bin** folder: This folder contains one or more **.dll** files that are the compiled code-behind classes for your web pages and other components. These files are binary and cannot be edited directly.
- **web.config** file: This file contains configuration settings for your web application, such as connection strings, app settings, etc.
- Other optional files and folders: These may include images, scripts, stylesheets, etc.



--> For MVC projects, a published build typically consists of the following:
- **Views** folder: This folder contains **.cshtml** or **.vbhtml** files that are the Razor views for your web pages. They are usually not compiled and can be edited directly.
- **bin** folder: This folder contains one or more **.dll** files that are your web application's compiled controllers, models, helpers, and other components. These files are binary and cannot be edited directly.
- **web.config** file: This file contains configuration settings for your web application, such as connection strings, app settings, etc.
- Other optional files and folders: These may include images, scripts, stylesheets, etc.
 

How to get code from .dll files?

The main challenge in getting code from a published ASP.Net build is to extract the source code from the .dll files in the bin folder. These files contain intermediate language (IL) code that can be executed by the .Net runtime but cannot be easily read by humans.
To get code from .dll files, we need to use a tool called a decompiler. A decompiler program can reverse-engineer IL code into high-level source code in C#, VB.NET or other languages.
There are many decompilers available online, some of them are free, and some of them are paid. Some examples of popular decompilers are:
- [ILSpy](https://github.com/icsharpcode/ILSpy): A free open-source decompiler with a graphical user interface (GUI) and command-line options.
- [dotPeek](https://www.jetbrains.com/decompiler/): A free decompiler by JetBrains with a GUI and integration with Visual Studio.
- [dnSpy](https://github.com/dnSpy/dnSpy): A free open-source decompiler with advanced features such as debugging and editing IL code.

To use any of these tools, you need to open the .dll file(s) in their GUI or command-line interface and browse through their namespaces, classes, methods, properties, etc., until you find the piece of code you are looking. You can copy the source code into a text editor or save it as a new file. However, there are some limitations and caveats when using decompilers:
- The source code may differ from the original one because some information may be lost during compilation (such as comments, variable names, formatting, etc.).
- The source code may only compile with errors because some dependencies (such as references, libraries, frameworks, etc.) may be missing or incompatible.
- The source code may not run correctly because some logic or functionality may be altered or broken during compilation or decompilation (such as encryption, obfuscation, optimization, etc.).


Wednesday 1 March 2023

Why someone will need Power BI ?

 

Microsoft Power BI: Data Visualisation.


In today's fast-paced business environment, data has become the most valuable asset for companies of all sizes. However, managing and making sense of extensive data takes time and effort. It is where business intelligence (BI) tools come into play. BI tools help companies to visualise and analyse their data, enabling them to make informed decisions based on data-driven insights. One such powerful BI tool is Power BI, a business analytics solution from Microsoft.

 

 

What is Power BI?

Power BI is a cloud-based business intelligence and data visualisation tool that helps organisations gather, analyse, and visualise their data. It is a part of the Microsoft Power Platform, including Power Apps and Power Automate. Power BI connects to various data sources, including Excel, SQL Server, SharePoint, and cloud-based sources like Azure SQL Database, Salesforce, and Dynamics 365. It allows users to create interactive reports, dashboards, and data visualisations that can be shared across the organisation or with external stakeholders.

 

Key Features of Power BI

Power BI offers a range of features, making it a comprehensive business intelligence solution for companies. Here are some of the key features of Power BI:

  1. Data connectivity: Power BI can connect to a wide range of data sources, including cloud-based sources like Azure, Salesforce, and Dynamics 365, as well as on-premises data sources like SQL Server and SharePoint.
  2. Data modelling: Power BI offers a powerful data modelling engine that allows users to create relationships between different data sources, create calculated columns and measures, and perform complex data transformations.
  3. Data visualisation: Power BI offers a range of visualisations, including charts, graphs, maps, and gauges, that allow users to create compelling data visualisations.
  4. Collaboration: Power BI allows users to share their reports and dashboards with colleagues or external stakeholders, making collaboration easier.
  5. AI-powered insights: Power BI uses artificial intelligence and machine learning algorithms to identify trends, outliers, and anomalies in the data, allowing users to gain insights quickly.

 

Benefits of Power BI for Companies

Here are some of the critical benefits of Power BI for companies:

  1. Centralised data management: Power BI allows companies to centralise their data management, making accessing and analysing data across the organisation easier.
  2. Real-time data insights: Power BI allows companies to gain real-time insights into their business operations, enabling them to make quick and informed decisions.
  3. Enhanced collaboration: Power BI makes collaboration more accessible by allowing users to share reports and dashboards with colleagues and external stakeholders.
  4. Cost-effective: Power BI is a cost-effective solution, eliminating the need for expensive hardware and software.
  5. Scalable: Power BI is a scalable solution, allowing companies to start small and grow as their data needs increase.


In conclusion, Power BI is a powerful business intelligence solution that enables companies to gain insights from their data quickly and easily. Power BI offers a comprehensive solution for companies of all sizes with its data connectivity, modelling, data visualisation, collaboration, and AI-powered insights features. Power BI can help companies make informed decisions and stay ahead of the competition by centralising data management and providing real-time data insights.

How to get code from a published ASP.Net build where we don't have source code?

If you have ever lost or misplaced your source code for an ASP.Net web application, you might wonder if there is a way to recover it from th...