0
전체 모듈을 다시로드하지 않고 주입 한 메소드의 RVA를 어떻게 해결합니까?
나는 항상 추가 된 방법의 RVA로 0을 얻고 있습니다. 어셈블리를 작성하고 다시로드하지 않고 RVA를 검색 할 수 있습니까? 감사!Mono.Cecil 메소드 삽입 후 메소드의 RVA를 가져 오거나 해결하십시오.
AssemblyDefinition asm = AssemblyDefinition.ReadAssembly("hello.exe");
ModuleDefinition mod = asm.MainModule;
TypeDefinition modType= mod.GetType("PrintClass"); //get class found in hello.exe
MethodDefinition MethodToInject= new MethodDefinition("PrintMethod", ..., ...); //filled
modType.Methods.Add(MethodToInject);
int InjectedRVA = MethodToInject.RVA; //Always get 0
InjectedRVA = modType.Methods.FirstOrDefault(mtd => mtd.Name == "PrintMethod").RVA; //Also get 0
asm.MainModule.Write("output.exe"); //write output
입력 해 주셔서 감사합니다. – Ron