A Failure about ildasm/ilasm MSIL

T

ThomasLiu83

Dear friends,

I'm a newer in MSIL , nowadays I have a problem about
disassemble/assemble .net MSIL.

I found a dll plugin ,i want to dissamble it for studing , so i ildasm
it to prog.il, and then i ilasm it ,but it not works and failure.i do
not konw why it failed.

here is the command:
ilasm /resource=prog.src prog.il /DLL

and it failed~
 
B

Barry Kelly

I'm a newer in MSIL , nowadays I have a problem about
disassemble/assemble .net MSIL.

I found a dll plugin

Can you tell us what it is?
,i want to dissamble it for studing ,

The .NET Reflector tool (http://www.aisto.com/roeder/DotNet/) is an
easier tool to work with if you just want to look inside the assembly.

However, you're trying to reassemble, so you're performing
modifications. Be aware that current obfuscation techniques can
currently create identifiers in Unicode that, by default, don't
round-trip because ILDASM outputs in ANSI by default. You need to use
the /unicode flag to ILDASM if you want to preserve these identifiers.

Also, ILDASM is only really expert about CLI assembly sections. Windows
..EXE files are in PE format, which can include resources that can be
read by the native Win32 APIs, which ILDASM may not extract correctly.

The .NET reflector tool above is a good example of an obfuscated
assembly. It uses a Win32 .rsrc section which (last time I checked)
contains an XOR encrypted .DLL assembly, using a simple key. As well as
that, the assemblies are strong named. If you simply run:

ildasm /unicode /all /out:reflector.il reflector.exe

followed by

ilasm reflector.il /resource=reflector.res

.... it won't work. The .res file extracted by ILDASM is only the start
of the actual .rsrc section in the object file, which is actually a good
750KB or so in size. Opening up the section using the Win32 resource
APIs allows reading in the extra parts of the .rsrc - but that won't
help you for round-tripping Reflector.exe.
so i ildasm
it to prog.il, and then i ilasm it ,but it not works and failure.i do
not konw why it failed.

here is the command:
ilasm /resource=prog.src prog.il /DLL

and it failed~

What was the error message from running this at the command prompt?

-- Barry
 
T

ThomasLiu83

Dear Barry,

Thank you for you post and Sorry that i have not say the problem
clearly.
Can you tell us what it is?
it is a commercial .net control for drawing chart in WinForm
application--Dundas Chart for .net windows form .
However, you're trying to reassemble, so you're performing
modifications.
In my original intention , i would modify someplace of the IL . In
fact, i did not make any modifications , only dissamble the .dll then
re-assemble the IL code, and it failed, print error message:

Class 554: DC01.co
Class 555: Dundas.Charting.WinControl.AnnotationPathPointé´„
Class 556: UNKNOWN_OWNER
Error: Reference to undefined class 'UNKNOWN_OWNER'
Could not create output file, error code=0x80004005

***** FAILURE *****



So i am very confused! why that?
perhapse it use the command :
command: > ilasm /owner a.il /DLL ??
but now ilasm do not suppurt the option "/owner"....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top