Closed kirsan31 closed 5 years ago
@kirsan31 can you share sample file ? I cannot reproduce the issue
@XenocodeRCE I have several app and only with one of them have this problem. I will try to compile test binary to reproduce this...
Did it: tst.zip
You need to press "protect" button until error will happen (in my case it from 1 to 8 protections). And yes, even if protection complete well from 1 run, the confused app will crush with this error in event log:
So, it's 2 bugs in 1?
@XenocodeRCE Any news?
Any news/progress on this?
Describe the bug Unknown error in dnlib (see log below), while Encrypting resources, but not every time. Sometimes all ok, but target app become corrupted (not run at all). Original ConfuserEx with same config work well.
To Reproduce See https://github.com/XenocodeRCE/neo-ConfuserEx/issues/12#issuecomment-412798754
Expected behavior No error.
Log
[DEBUG] Encrypting resources... [ERROR] Unknown error occurred. Exception: dnlib.DotNet.Writer.ModuleWriterException: Target instruction is too far away for a short branch. Use the long branch or call CilBody.SimplifyBranches() and CilBody.OptimizeBranches() at dnlib.DotNet.DummyLogger.Log(Object sender, LoggerEvent loggerEvent, String format, Object[] args) in C:\projects\neo-confuserex\dnlib\src\DotNet\ILogger.cs:line 456 at dnlib.DotNet.Writer.MetaData.dnlib.DotNet.Writer.IWriterError.Error(String message) in C:\projects\neo-confuserex\dnlib\src\DotNet\Writer\MetaData.cs:line 2575 at dnlib.DotNet.Writer.MethodBodyWriterBase.WriteShortInlineBrTarget(BinaryWriter writer, Instruction instr) in C:\projects\neo-confuserex\dnlib\src\DotNet\Writer\MethodBodyWriterBase.cs:line 360 at dnlib.DotNet.Writer.MethodBodyWriterBase.WriteInstructions(BinaryWriter writer) in C:\projects\neo-confuserex\dnlib\src\DotNet\Writer\MethodBodyWriterBase.cs:line 118 at dnlib.DotNet.Writer.MethodBodyWriter.WriteFatHeader() in C:\projects\neo-confuserex\dnlib\src\DotNet\Writer\MethodBodyWriter.cs:line 144 at dnlib.DotNet.Writer.MethodBodyWriter.Write() in C:\projects\neo-confuserex\dnlib\src\DotNet\Writer\MethodBodyWriter.cs:line 97 at dnlib.DotNet.Writer.MetaData.WriteMethodBodies() in C:\projects\neo-confuserex\dnlib\src\DotNet\Writer\MetaData.cs:line 1552 at dnlib.DotNet.Writer.MetaData.Create() in C:\projects\neo-confuserex\dnlib\src\DotNet\Writer\MetaData.cs:line 1206 at dnlib.DotNet.Writer.ModuleWriter.WriteImpl() in C:\projects\neo-confuserex\dnlib\src\DotNet\Writer\ModuleWriter.cs:line 171 at dnlib.DotNet.Writer.ModuleWriterBase.Write(Stream dest) in C:\projects\neo-confuserex\dnlib\src\DotNet\Writer\ModuleWriterBase.cs:line 503 at Confuser.Core.ConfuserEngine.WriteModule(ConfuserContext context) in C:\projects\neo-confuserex\Confuser.Core\ConfuserEngine.cs:line 393 at Confuser.Core.ProtectionPipeline.ExecuteStage(PipelineStage stage, Action`1 func, Func`1 targets, ConfuserContext context) in C:\projects\neo-confuserex\Confuser.Core\ProtectionPipeline.cs:line 135 at Confuser.Core.ConfuserEngine.RunPipeline(ProtectionPipeline pipeline, ConfuserContext context) in C:\projects\neo-confuserex\Confuser.Core\ConfuserEngine.cs:line 244 at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) in C:\projects\neo-confuserex\Confuser.Core\ConfuserEngine.cs:line 175 Failed at 13:45, 0:04 elapsed.