Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用原版ConfuserEx加密后无法反流程混淆 #2

Closed
CreateAndInject opened this issue Aug 3, 2019 · 17 comments
Closed

使用原版ConfuserEx加密后无法反流程混淆 #2

CreateAndInject opened this issue Aug 3, 2019 · 17 comments

Comments

@CreateAndInject
Copy link

CtrlFlowTest.zip
压缩包中Original.exe是未加密的,CtrlFlow.exe是我用原版ConfuserEx1.0只加了流程混淆后生成的。
我自己写的,以及这个贴子中的,还有你的都无法反流程

另外:

用来测试ConfuserExSwitchDeobfuscator的UnpackMe,我加了15层控制流混淆

请问你这个UnpackMe是直接用原版ConfuserEx加密的吗?你这个15层是怎么控制的?

@wwh1004
Copy link
Owner

wwh1004 commented Aug 5, 2019

可以脱
foreach (InvalidBlockException invalidBlockException in BlockVerifier.Verify(methodBlock))
throw invalidBlockException;
这个可能有点问题,验证出现问题了,实际上是脱了,但是被验证拦下了。
15层混淆是原版confuserex的,我改了下而已

@wwh1004
Copy link
Owner

wwh1004 commented Aug 5, 2019

然后Original.exe是用其它工具清理过的吧?总觉得怪怪的,没有SEH的地方怎么会出现leave指令?我用dnlib.dll来加壳再脱壳测试的时候都没出现这种情况

@CreateAndInject
Copy link
Author

CreateAndInject commented Aug 5, 2019

foreach (InvalidBlockException invalidBlockException in BlockVerifier.Verify(methodBlock))
throw invalidBlockException;
这个可能有点问题,验证出现问题了,实际上是脱了,但是被验证拦下了

可以把你脱后的文件上传上来吗?我看一下脱后的每个函数是否有缺失IL的情况

15层混淆是原版confuserex的,我改了下而已

你改的是配置文件的参数(未重新编译exe),还是修改源码了?

@CreateAndInject
Copy link
Author

CreateAndInject commented Aug 5, 2019

然后Original.exe是用其它工具清理过的吧?

Original.exe是用.Net Reactor加密的脱出来的

总觉得怪怪的,没有SEH的地方怎么会出现leave指令?我用dnlib.dll来加壳再脱壳测试的时候都没出现这种情况

哪一个函数有这种情况?

@wwh1004
Copy link
Owner

wwh1004 commented Aug 5, 2019

我检查过了,没有缺失的,文件不发了。我的那个confuserex switch的清理器是很稳定的,我试过加dnlib.dll n层,清理之后和原来是一样的。
很多方法有leave的问题,比如clsMyDog.ReadSn

@wwh1004
Copy link
Owner

wwh1004 commented Aug 5, 2019

foreach (InvalidBlockException invalidBlockException in BlockVerifier.Verify(methodBlock))
throw invalidBlockException;
这个可能有点问题,验证出现问题了,实际上是脱了,但是被验证拦下了

可以把你脱后的文件上传上来吗?我看一下脱后的每个函数是否有缺失IL的情况

15层混淆是原版confuserex的,我改了下而已

你改的是配置文件的参数(未重新编译exe),还是修改源码了?

我改的源码

@CreateAndInject
Copy link
Author

CreateAndInject commented Aug 5, 2019

我检查过了,没有缺失的,文件不发了。我的那个confuserex switch的清理器是很稳定的,我试过加dnlib.dll n层,清理之后和原来是一样的。
很多方法有leave的问题,比如clsMyDog.ReadSn

搜索一下函数 : PrintLuDan,会找到3个,比较一下脱壳后的和原始的,看一下switch混淆是不是都清理了,并且IL指令数并没有减少

@CreateAndInject
Copy link
Author

CreateAndInject commented Aug 5, 2019

我把你的工具的s.f函数直接return以屏蔽异常
结果似乎有点问题:
Fishing_10_BL.PlayerDB.PrintLuDan(string)
原始的switch指令并没有在循环中,用你的工具反混淆后,switch位于一个循环中:

int num;
do
{
switch{}
num = 0;
}
while (num < 6);

而且这个循环似乎陷入了死循环

@wwh1004
Copy link
Owner

wwh1004 commented Aug 5, 2019

num = 0; while (num < 6);不是死循环

@CreateAndInject
Copy link
Author

CreateAndInject commented Aug 5, 2019

int num;
do
{
    num = 0;
}
while (num < 6);

这不是死循环?

@wwh1004
Copy link
Owner

wwh1004 commented Aug 5, 2019

好吧,看错了,我看看怎么回事...

@wwh1004
Copy link
Owner

wwh1004 commented Aug 5, 2019

你把整个程序打包发过来,我运行看看

@CreateAndInject
Copy link
Author

CreateAndInject commented Aug 5, 2019

这个程序需要有相关硬件及数据库才能运行,你那里运行不了
我之前遇到过一个无法反混淆的程序,后来找不到了,然后我尝试用ConfuserEx加密了一些程序,发现这个反不了

for (int i = 0; i < 6; i++)
{
	string text4 = "";
	for (int j = 0; j < ((array.Length % 6 != 0) ? (array.Length / 6 + 1) : (array.Length / 6)); j++)
	{
		if (i + j * 6 < array.Length)
		{
			text4 += array[i + j * 6];
		}
	}
	array2[i + 1] = text4;
}

似乎你的工具把以上循环套到switch里了,导致该循环体未执行
例如原版会通过循环来为array2中每个元素赋值,反混淆后只有array2[0]被赋值

@wwh1004
Copy link
Owner

wwh1004 commented Aug 5, 2019

dll给我就行了,我只需要执行那一个方法,我怀疑是不是加壳有问题了,我用其它人的工具清理也是死循环

@CreateAndInject
Copy link
Author

CreateAndInject commented Aug 5, 2019

我也怀疑是ConfuserEx的bug,这有一个可执行的案例

@wwh1004
Copy link
Owner

wwh1004 commented Aug 5, 2019

那我暂时不管这个了,因为我自己测试过很多正常的文件加壳再脱壳,确实没遇到过这种情况。之前调试的时候我完全跟踪了一次,也没发现有脱壳问题,如果有问题,那再看看

@CreateAndInject
Copy link
Author

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants