mercredi 13 décembre 2017

Reflexil is unable to save this assembly: Member is declared in another module and needs to be imported

Im trying to just do the most basic change in logic of a .net assembly with reflexil.

Most basic change i can think of is throwing a new exception in the constructor of the class i am trying to modify.

So I created a similar class with a constructor, throwing an exception. When modifying with reflexil this code for the constructor looks like this:

Offset  OpCode  Operand
0   ldarg.0 
1   call    System.Void System.Object::.ctor()
6   nop 
7   nop 
8   ldstr   THIS ASSEMBLY IS HACKED
13  newobj  System.Void System.Exception::.ctor(System.String)
18  throw   

I then try to modify the empty constructor of the assembly that i actually want to modify from this:

Offset  OpCode  Operand
0   ldarg.0 
1   call    System.Void System.Object::.ctor()
6   ret 

and change it to look exactly like the code at the top.

when i then try to save the assembly with this modifications i get the following error:

Reflexil is unable to save this assembly: Member 'System.Void System.Exception::.ctor(System.String)' is declared in another module and needs to be imported

How do i import "another module" with reflexil ?

I am using reflexil with ilspy, I am not using Mono.Cecil





Aucun commentaire:

Enregistrer un commentaire