Washi1337 / OldRod

An automated KoiVM disassembler and devirtualisation utility
GNU General Public License v3.0
352 stars 80 forks source link

CodeAnalysisStage.cs (OldRod.Pipeline) throws InvalidCastException #6

Closed KNIF closed 5 years ago

KNIF commented 5 years ago

Image: https://imgur.com/RxFbvh9

If I try to fix the issue and build it I get this error when trying to devirt an assembly:

17:28:47.538 [Main]: Started devirtualisation.
17:28:47.546 [Main]: Opening target file C:\Users\MauriceHuber\Desktop\DevirtMe.exe...
17:28:47.612 [Main]: Runtime is embedded in the target assembly.
17:28:47.613 [Main]: Executing Constants resolution stage...
17:28:47.674 [Main]: Executing #Koi stream parsing stage...
17:28:47.676 [Main]: Executing Virtualised method detection stage...
17:28:47.716 [Main]: Executing OpCode mapping resolution stage...
17:28:47.736 [Main]: Executing VM code recovery stage...
17:28:48.011 [Main]: Executing Code Analysis Stage...
17:28:48.020 [Main]: Executing IL AST builder stage...
17:28:48.158 [Main]: Executing CIL Recompiler stage...
17:28:48.338 [TUI]: Something went wrong! Try the latest version or report a bug at the repository.
17:28:48.339 [TUI]: InvalidCastException: The object of the type "AsmResolver.Net.Cts.TypeReference" can not be converted to type "AsmResolver.Net.Signatures.ByReferenceTypeSignature".
17:28:48.340 [TUI]: Use --verbose or inspect the full report.log using --log-file for more details.
17:28:48.341 [TUI]: Process finished with 0 warnings and 1 errors.
Press any key to continue...
Washi1337 commented 5 years ago

Make sure you have the correct version of AsmResolver downloaded (such as the dev branch).

KNIF commented 5 years ago

I used the dev branch, it built successfully and it devirts crackme's successfully, but when I try to devirt some bigger applications I still get the InvalidCastException.

Washi1337 commented 5 years ago

Seems like a bug then!

In the meantime, try using --salvage to ignore any errors that might occur during the recompilation.

zsr2531 commented 5 years ago

Can you provide your "bigger application" that produced this error?

KNIF commented 5 years ago

Can you provide your "bigger application" that produced this error?

I will send you the file in Discord DMs.

Washi1337 commented 5 years ago

I wouldn't mind the sample either ...

KNIF commented 5 years ago

I wouldn't mind the sample either ...

Is there a way where I can contact you privately and send the file? Discord, Skype, Email, etc.?

Edit: I sent you the file via RTN private message.

1x37x commented 4 years ago

Please fix this I'm also getting

[TUI]: Something went wrong! Try the latest version or report a bug at the repository. 17:28:48.339 [TUI]: InvalidCastException: The object of the type "AsmResolver.Net.Cts.TypeReference" can not be converted to type "AsmResolver.Net.Signatures.ByReferenceTypeSignature". 17:28:48.340 [TUI]: Use --verbose or inspect the full report.log using --log-

Washi1337 commented 4 years ago

Make sure you're using the latest build 1x37x. If you still get an error like this, please don't hijack the issue and instead create a new one.