Hack Forums
[C#] C# Reflection (Disassembling the .dll) - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] C# Reflection (Disassembling the .dll) (/showthread.php?tid=1457599)



C# Reflection (Disassembling the .dll) - eliteh4xer - Jul 8, 2011

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





* - WESTi - Jul 8, 2011

This is really cool mate, nice share :D




* - eliteh4xer - Jul 8, 2011

thanks for comment mate :)


* - KingCobraXD - Jul 8, 2011

Lol. Simple and easy. Great share. =)


* - eliteh4xer - Jul 8, 2011

Quote:Lol. Simple and easy. Great share. =)


Thank 👍s Mate 😁


* - #Macklemore - Jul 8, 2011

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?tid=1352590&highlight=plugin+system (not by me)


* - DragQueen - Jul 8, 2011

(Jul 8, 2011 06:49 AM)Gaara 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?tid=1352590&highlight=plugin+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.


* - eliteh4xer - Jul 8, 2011


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 🤗 👍



* - nicks707 - Jul 8, 2011

nice share .. u can even improve your code by including method definitions in the dissassembler


* - eliteh4xer - Jul 8, 2011

Quote:nice share .. u can even improve your code by including method definitions in the dissassembler


Thanks Dear :) :victoire:


* - eliteh4xer - Jul 17, 2011

Pls Commnet..If You Like it.Guys