Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

C# Reflection (Disassembling the .dll)

Using Reflection in C#


Ques : What Is Reflection ,How to Implement ? 😯 😟

[color=#ff]Ans: 😎
Reflection is generally all about getting information about code. Reflection is most commonly used for discovery, and nearly everything in .NET is discoverable.
You Can Create Your Own 🤭 .Net Reflector if you Know Some Basic In Class , Tree View etc . 😝
[/color]

More About Reflection in C#



Now Lets Create A .dll File In Visual studio 2010 in Visual c#
😝
PHP Code

<?php 
Namespace ToTest    // Namespace
{
    public class 
Calc  //Class Name
    
{
  public 
Calc() { ... }
  public 
void Clear() { ... }
  private 
void DoClear() { ... }
  public 
double Add(double number) { ... }
  public static 
double Pi { ... }
  public static 
double GetPi() { ... }
    }
} 
Lets Build it. And You Have Its .dll that is calc.dll

Now Take Other Windows Form in C#

Add a Button Just and A Textbox To Enter The Path of .dll or assembly
[img]http://i56.[censored].com/2vjq1av.png[/img]

Now Creating Assembly Object

PHP Code

<?php 
using System
.Reflection;  // Do not Forget it 
[img]http://i51.[censored].com/r7pt00.png[/img]


Quote:In Form Load
Assembly testAssembly = Assembly.LoadFile(textbox.text);

Type T = testAssembly.GetTypes();
Now Add Message Box To See the .dll



[img]http://i55.[censored].com/142boe0.png[/img]


[img]http://i52.[censored].com/2v1ry2f.png[/img]


PHP Code

<?php 
You Can Get MethodInfo
,PropertyInfo also and Create Object Of Class and Execute Them Also. 
Now This Is Simple Tut ,How to Implement Reflection .
For 
More Go to This Link 
Reflection in C# 🤝

Thanks
👍
Respect
Mr. Predictable


This is really cool mate, nice share :D

thanks for comment mate :)
Lol. Simple and easy. Great share. =)
Quote:Lol. Simple and easy. Great share. =)


Thank 👍s Mate 😁
Love it rated 5 stars and i don't want to hjack your thread but if you want an example using reflection to create a plugin system check this out https://hackforums.net/showthread.php?ti...gin+system (not by me)
(Jul 8, 2011 06:49 AM)#Macklemore Wrote:  Love it rated 5 stars and i don't want to hjack your thread but if you want an example using reflection to create a plugin system check this out https://hackforums.net/showthread.php?ti...gin+system (not by me)

this is bad sample.
if you compare by name.
i would suggest you better way.
use interface from external dll.
and embed it into to dll.
also, check for any class that inherits this intertface.
and use it.

Quote:Love it rated 5 stars and i don't want to hjack your thread but if you want an example using reflection to create a plugin system check this out https://hackforums.net/showthread.php...gin+system (not by me)


Ok man i will Consider

But this is Different Approach 🤗 👍
nice share .. u can even improve your code by including method definitions in the dissassembler
Quote:nice share .. u can even improve your code by including method definitions in the dissassembler


Thanks Dear :) :victoire:
Pls Commnet..If You Like it.Guys


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by ineedsomethingrealfastApr 13, 2020 11:34 AM 0 98 Apr 13, 2020 11:34 AM
Last Post: ineedsomethingrealfast
[C] by SecurifierJan 17, 2020 07:20 AM 12 416 Jan 17, 2020 07:20 AM
Last Post: SIM-3602340
[.NET] by NaywynApr 29, 2017 03:05 PM 48 5,686 Apr 29, 2017 03:05 PM
Last Post: Yattaze