473,394 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Decompiling and modifying an Assembly....

Gaz
....and recompiling it again

Hi all,

I've got an Assembly DLL and associated .NetModules and want to amend
a function in one of the .NetModules

I've used ILDASM to decompile the .NetModules into IL so I can modify
the code but am having trouble trying to compile up the .NetModule and
effectively renew the Assembly.

If I use ILASM to rebuild the .NetModule I get an error
'System.IO.FileLoadException - The check of the modules hash failed'
when trying to use my Assembly DLL so obviously I need to do a full
rebuild of the Assembly DLL.

However, if I try to us AL.exe with any of my NetModule .il files I
get an 'unspecified error' when it tries to import them....

Can anyone tell me the necessary sequence of events required to :
disassemble an Assembly and it's NetModules,
Modify the IL of one of the NetModules,
Rebuild the NetModules and Assembly DLL correctly

I'm new to C# and apologise if this is a daft question, but I've not
seen an answer for disassembling, modifying and rebuilding an Assembly
in the Groups so far and would appreciate any help!

Thanks for your time,

Gareth
Nov 15 '05 #1
2 3258
Gaz <Ga****@hotmail.com> wrote:
I've got an Assembly DLL and associated .NetModules and want to amend
a function in one of the .NetModules

I've used ILDASM to decompile the .NetModules into IL so I can modify
the code but am having trouble trying to compile up the .NetModule and
effectively renew the Assembly.


Do you have the legal right to modify this code? If so, couldn't you
just ask the author for the original source code, modify that, and then
recompile it in a normal way?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
Gaz,
Legal issues notwithstanding, this is most likely because the assembly you
are attempting to ILASM from il code was a strong-named assembly. You would
have to remove the public key portion and any other similar metadata.
--Peter

"Gaz" <Ga****@hotmail.com> wrote in message
news:7c**************************@posting.google.c om...
...and recompiling it again

Hi all,

I've got an Assembly DLL and associated .NetModules and want to amend
a function in one of the .NetModules

I've used ILDASM to decompile the .NetModules into IL so I can modify
the code but am having trouble trying to compile up the .NetModule and
effectively renew the Assembly.

If I use ILASM to rebuild the .NetModule I get an error
'System.IO.FileLoadException - The check of the modules hash failed'
when trying to use my Assembly DLL so obviously I need to do a full
rebuild of the Assembly DLL.

However, if I try to us AL.exe with any of my NetModule .il files I
get an 'unspecified error' when it tries to import them....

Can anyone tell me the necessary sequence of events required to :
disassemble an Assembly and it's NetModules,
Modify the IL of one of the NetModules,
Rebuild the NetModules and Assembly DLL correctly

I'm new to C# and apologise if this is a daft question, but I've not
seen an answer for disassembling, modifying and rebuilding an Assembly
in the Groups so far and would appreciate any help!

Thanks for your time,

Gareth

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Deano | last post by:
Just wondering if there is a tool or method that will allow me to compare the state of my database before and after I decompile it. The last time I decompiled a few fields lost default values and...
1
by: Richard Dutton | last post by:
I would like to be able to modify a type at runtime so that I can add an IL prologue and epilogue to its methods (either to implement some kind of aspect-oriented programming framework, or a simple...
2
by: Roger Webb | last post by:
Hey. Is there a way to attach a satellite assembly to a specific programs' App.Config File? I have some assembly functions that get used in multiple programs... each configured in its own way. ...
18
by: Diogo Alves - Software Developer | last post by:
I found a few days ago that was possible to decompile any program developed in C# That is a huge failure.... It's not aceptable that a company that pays a lot for visual studio and pays to the...
6
by: MLH | last post by:
Can decompiling an A97 mdb result in fixing minor nasties that may be responsible for some premature terminations of A97 (We are sorry. MS Access 97 needs to close.... messages). I've found the...
13
by: Robin Becker | last post by:
When young I was warned repeatedly by more knowledgeable folk that self modifying code was dangerous. Is the following idiom dangerous or unpythonic? def func(a): global func, data data =...
1
by: # Cyrille37 # | last post by:
Hello, I'm trying to add a resource to an existing assembly, but I failed. I've only nearly found how to create a new assembly, but not change a existing one. I would like to write a little C#...
8
by: Torben Laursen | last post by:
Hi I need to be sure that my C# code is as hard as possible to decompile. Can anyone tell what is the best tool for that job? Also will this be a part of Visual Studio 2008? It seems...
14
by: Grant | last post by:
I've seen a couple of articles on the internet that VB.NET applications can be decompiled very easy. For those who have had experience with this, is it true? What steps can be taken to avoid...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.