Share via


Compiled Assemblies (.dll).. How to decompile, edit, and recompile??

Question

Monday, August 18, 2008 10:43 AM

A programmer for my website has already compiled these .DLL files for the website and I just want to decompile them, make some variable edits, and recompile? How do I do this? I got Reflector to disassemble them and then I open the project with VS2008.. And in there I can edit the variables I want to change.. But from there how do I recompile??

 

Please help, may be very simple, but I'm new to this and just want to make some changes.. Thanks.

 

All replies (7)

Monday, August 18, 2008 12:39 PM

You should be able to build this as usual (selecting build/build solution in the toolbar)....? 


Monday, August 18, 2008 2:26 PM

Yeah I guess my real problem is I haven't used VS2008 up until a couple days ago.. I always just oversaw the programmer and his codes, but never knew VS. Kind of  like I could understand the language enough to communicate with him but I couldn't speak it.. And now  he's gone and there's just these variables that needed to be changed. So I disassembled the compiled assemblies, opened up in VS, made the changes, and now when I go to build solution it creates a .sln file and I want the .dll I disassembled earlier so I can just replace on the website and the variables will be changed..

 

I was wondering if I could just use the .CS file created that is in the assembly but now available because it's disassembled.. So I only needed to make changes in RegisterUser.CS in the project.. Anyway I could just use that?


Monday, August 18, 2008 2:51 PM

 Ah with you know mate. yes if you open the sln file and carry out the following steps :

 - right click on the project and select properties. on the default tab ensure the namespace and assembly name match that of the existing dll then on the build tab check the output path (and change if you wish) - this details the directory the DLL with be compiled too.

 - make the changes to the code as you require and save. 

- go and build the solution as I mentioned earlier (select build/build solution on the toolbar)

now navigate to the specified directory of the build output path - you will find here the compiled DLL files with your changes. Did the developer not leave the code for you?

 Let me know any problems.
 


Monday, August 18, 2008 3:21 PM

Yeah. Well he had a pretty bad falling out with our boss and I'm the design, so I deal mostly with graphics, but I followed along side of him and then when he left there's just a couple variables that need to be changed.. On our Registration Page some fields are filled out with information that should be blank fields.. So I wanted to just go in the codebehind files to edit them, but he had compiled them all into .DLL files.. I then got Reflector and used it to disassemble.. Then I went into the proper .CS files and made the changes, but I can't recompile now in the same format.

 I did exactly what you said, but the build keeps on creating a .vshost file and not a .dll.. I feel stupid, but this just isn't my field, but I want to get it done since it's such a simple thing.


Monday, August 18, 2008 3:42 PM

 umm. the vshost is the hosting process for use when debugging. when you go the properties of the project as you did before what does the output type state class library? I know there is tools that can inject IL into the DLL but thats a bit far for what you are doing. How big is the solution? Can you create a new solution in VS and copy the files over? You will then also have the code moving forward for any future changes.


Monday, August 18, 2008 4:01 PM

I guess I could make a new one if that's what it comes down to.. But honestly I figured there would be an easier way to do this.. All I want to do is change the values in the Registration fields because they show some name the programmer first typed in.. (you can see all this at http://www.myhomeforsaleontv.com/RegisterUser.aspx)

It's output is a class library. I edited the values in the RegisterUser class.. Did Build Solution.. And it says there's 9 errors, mostly classes can't reference a MyHomeFuncs namespace and a App_Code file..


Monday, August 18, 2008 5:14 PM

OK.. I have the .dll file disassembled and all the classes broken up obviously into seperate files.. If I upload all those files and then make the Registration page codebehind="RegisterUser.CS" will it be able to still call functions from all these other files and work properly??