Monday 29 June 2009

How to copy dll from GAC

Well windows Global Assembly Cache(GAC) is a directory and it's not so. You can add file just dragging and dropping it in the folder or using Gacutil( preferred way :) ).
But what about copying back a dll from GAC? I tried to just copy it from windows explorer, but it didn't work. Context menu does not shows copy/pest. And obviously Ctrl+c Ctrl+v does not work. But as I said it's a directory you can copy it some way.
Simply use command prompt. From your windows command window change directory to C:\WINDOWS\assembly
When you run 'dir' command on this directory you will see following sub directories:
GAC
GAC_32
GAC_MSIL
NativeImages1_v1.1.4322
NativeImages_v2.0.50727_32

Go to your target directory, you can derived this information from 'Processor Architecture' columns information in windows explorer(C:\WINDOWS\Assembly). So for managed code it will be MSIL and your target directory is GAC_MSIL.

You are almost there, again 'dir' will display list of directory named after all the dlls. Change into intended directory and you will see directories with version number and your dll is inside that directory.

Enjoy reverse engineering.


No comments:

Post a Comment