首页
社区
课程
招聘
[original]Several fundamental concepts about .net (from cracker's view)
发表于: 2006-9-21 19:58 2831

[original]Several fundamental concepts about .net (from cracker's view)

2006-9-21 19:58
2831
Several fundamental concepts about .net framework (from cracker’s view)

    Recently I’m reading Essential .NET, cause I want to get some common view about .NET framework after I had doing some reversing work on it. This book mainly focus on program design, but the author describe his opinions from very fundamental aspects. So by reading this book, as a crack fan, I hope I can know something new and make clear some confusion in my head. Following notes come out after I read first 2 chapters, some of which are directly refrenced from original book, and some other are my summary.

Assembly: An assembly is a logical collection of one or more modules. Assemblies are logical constructs and are referenced by location-independent names that must be translated to physical paths either in the file system or on the Internet. Those physical paths ultimately point to one or more modules that contain the type definitions, code, and resources that make up the assembly.
For example, mscorlib is assembly, with no ext.

Module: A CLR module is a byte stream, typically stored as a file of the local file system or on a Web server. In contrast to assembly, module is physical and assembly is logic concept.

    Take a view of the cmd line of compiler will make this clear.

Csc.exe /t:module md.cs
(create md.netmodule file, which is a module without any manifest info.)
Csc.exe /t:library /addmodule:md.netmodule lib.cs
(explain using a equation: lib.dll+md.netmodule->lib.dll assembly)
Csc.exe /r:lib.dll main.cs
(create main.exe assembly. main.exe reference lib.dll assembly, which contain two modules: md and lib.)

Type: Type is the atom element in .NET framework, you can see that form naming of CTS(Common Type System). Classes, structs, enums, etc are all types. Three fundamental kinds of type members: fields, methods, and nested types. All other type members (e.g., properties, events) are simply methods that have been augmented with additional metadata. At least description here can make you clear about what that lot’s metadata tables in .NET PE files mean.

Interface: Why I get interested in interface is when I’m reading src code of mdbg sample. This sample demonstrate how to write debugger using managed code. There are lot’s of reference to debug interface in the src(ICorDebug, ICorDebugAppdomain, etc). So I’m eager to know the essential explanation about interface, and this book work well. In the CLR, those categories of types are referred to as interfaces. Interfaces are always implicitly “abstract”. A code sample for this.

public interface IEnglishWriter {}
public class    Person {}

public class ChineseWriter1 : Person, IEnglishWriter {}
public class ChineseWriter2 : Person {}
class PediyForumEnglishColumn
{
   void ReadPost(Person person) {}
void PostNew (IEnglishWriter eperson) {}
}


    We can see from the code that, any one, whether he knows English or not, can read in this column. But only who can write English will be allowed to post here.

hidebysig: This term is often seen in ILDasm code. It has no significant relationship with cracking, but it’s better to know what it means rather than don’t know. This term mainly used in class inherit and overidding. Use hidebysig, two methods having same name can be called respectively if their signature are different. (For example, they need different params, int and strings). But using hidebyname, method of base class will be shaowed if the derived class has a same name method.

That’s all for this time. After I read more chaps, I will talk more about .NET concepts, of cause, from a cracker’s view as best as I can.

[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 331
活跃值: (56)
能力值: ( LV13,RANK:410 )
在线值:
发帖
回帖
粉丝
2
sustain
2006-9-24 15:54
0
雪    币: 433
活跃值: (176)
能力值: ( LV13,RANK:1250 )
在线值:
发帖
回帖
粉丝
3
Authorship? Do you mean "original"?
2006-9-25 19:36
0
雪    币: 5275
活跃值: (456)
能力值: (RANK:1170 )
在线值:
发帖
回帖
粉丝
4
should be original,hehe
2006-9-25 23:51
0
雪    币: 201
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
Passed by
2006-9-29 14:26
0
游客
登录 | 注册 方可回帖
返回
//