Reverse Engineering RET Homepage RET Members Reverse Engineering Projects Reverse Engineering Papers Reversing Challenges Reverser Tools RET Re-Search Engine Reverse Engineering Forum Reverse Engineering Links

Go Back   Reverse Engineering Team Board > Reverse Engineering Board > .NET Reverse Engineering
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 06-29-2008, 06:26 AM
tribal tribal is offline
Member
 
Join Date: Jun 2008
Posts: 11
Default Help with rebuilding .net assembly

Hello,

Im trying to rebuild a .net assembly which I think is protected by reactor.

I dumped the assembly using ollydebug which results in a dump I can open with reflector.

I tryd fixing the header with CFF explorer using the way rongchaua described in his video tutorial. I fixed the MetaData RVA and MetaData size. After fixing this the errors disapeard and I could see the metadata header and stream. I fixed the nt fileheader charastics (unchecked "File is a DLL").

I tried running the "fixed" executable which results in a "Application failed to initialize (0xc000007b)." error. I guess this is the result of an invalid memory pointer ?

I dont know what to do next, im a noob in (.net) reversing. Can someone help me out?

The following zip file contains the original dump and the dump i tryd to fix but doesnt work.
Reply With Quote
  #2  
Old 06-29-2008, 06:53 AM
Kurapica Kurapica is offline
Senior Member
 
Join Date: May 2006
Location: Archives
Posts: 357
Default

1 - Open the dumped exe in CFF explorer
2 - Select the ".NET Directory" node
3 - Fix these 3 values as in the picture

It should work.

__________________
Life can only be understood backwards but It must be read forwards.
Reply With Quote
  #3  
Old 06-29-2008, 07:08 AM
tribal tribal is offline
Member
 
Join Date: Jun 2008
Posts: 11
Default

It works, thanks allot.
Could you please explain what the values represent and how you knew what where the correct values?
Reply With Quote
  #4  
Old 06-29-2008, 07:35 AM
Kurapica Kurapica is offline
Senior Member
 
Join Date: May 2006
Location: Archives
Posts: 357
Default

Quote:
The .NET Directory

The obsolete COM Directory in PEs is now the .NET Directory (I call it this way). This sections starts with the COR20 structure, also known as CLI header:
// COM+ 2.0 header structure.
typedef struct IMAGE_COR20_HEADER
{
// Header versioning
DWORD cb;
WORD MajorRuntimeVersion;
WORD MinorRuntimeVersion;

// Symbol table and startup information
IMAGE_DATA_DIRECTORY MetaData;
DWORD Flags;
// DDBLD - Added next section to replace following lin
// DDBLD - Still verifying, since not in NT SDK
// DWORD EntryPointToken;

// If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is not set, EntryPointToken represents a managed entrypoint.
// If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is set, EntryPointRVA represents an RVA to a native entrypoint.
union {
DWORD EntryPointToken;
DWORD EntryPointRVA;
};
// DDBLD - End of Added Area

// Binding information
IMAGE_DATA_DIRECTORY Resources;
IMAGE_DATA_DIRECTORY StrongNameSignature;

// Regular fixup and binding information
IMAGE_DATA_DIRECTORY CodeManagerTable;
IMAGE_DATA_DIRECTORY VTableFixups;
IMAGE_DATA_DIRECTORY ExportAddressTableJumps;

// Precompiled image info (internal use only - set to zero)
IMAGE_DATA_DIRECTORY ManagedNativeHeader;

} IMAGE_COR20_HEADER, *PIMAGE_COR20_HEADER;

A brief description of the members:

cb
Size of the structure.

MajorRuntimeVersion and MinorRuntimeVersion Version of the CLR Runtime.
cb : is always 00000048

other values can be obtained from the "Metadata Header" node in CFF explorer, check the "VersionString" value for more info.
__________________
Life can only be understood backwards but It must be read forwards.
Reply With Quote
  #5  
Old 07-25-2008, 05:07 PM
sirp sirp is offline
Senior Member
 
Join Date: Apr 2008
Posts: 76
Default

hmm i checkd with dotnet tracer ... and so i found License.dll
loaded app in olly searchd mem for License and found the License.dll
could dump it nicely ,) ... but i have problems with the main exe can u plz explain again how to dump it if i check for it in olly and dump it
my CFF Explorer crashes with the .exe although it even shows the original .exe icon

and found another interesting thin ezencryption_lib
...isnt that net reactor ?

Last edited by sirp : 07-25-2008 at 05:16 PM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump





Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.