vtil-project / VTIL-Core

Virtual-machine Translation Intermediate Language
BSD 3-Clause "New" or "Revised" License
1.33k stars 162 forks source link

crash 0518 #11

Closed zzz9328fb closed 4 years ago

zzz9328fb commented 4 years ago
expression X_00 = { {"X_00"}, 1 };
expression X_01 = { {"X_01"}, 1 };
expression X_02 = { {"X_02"}, 1 };
expression X_03 = { {"X_03"}, 1 };
expression X_04 = { {"X_04"}, 1 };
expression X_05 = { {"X_05"}, 1 };
expression X_06 = { {"X_06"}, 1 };
expression X_07 = { {"X_07"}, 1 };
expression X_08 = { {"X_08"}, 1 };
expression X_09 = { {"X_09"}, 1 };
expression X_0A = { {"X_0A"}, 1 };
expression X_0B = { {"X_0B"}, 1 };

expression a = ((X_0B & X_00) | (X_0A & X_01));
expression b = ((((X_0A & X_00) | (X_09 & X_01)) & ((((X_09 & X_00) | (X_08 & X_01)) & ((((X_08 & X_00) | (X_07 & X_01)) & ((((X_07 | X_06) & ((((X_01 & X_00) & (X_05 | (X_04 & (X_00 & X_06)))) & (X_03 | ((X_03 | X_02) & (X_00 & X_04)))) | ((X_01 & X_04) & (X_05 & X_00)))) | ((X_01 & X_05) & (X_06 & X_00))) | ((X_07 & X_00) & (X_06 & X_01)))) | ((X_08 & X_00) & (X_07 & X_01)))) | ((X_09 & X_00) & (X_08 & X_01)))) | ((X_0A & X_00) & (X_09 & X_01)));
expression c = a & b;
log("c = %s\n", c.to_string());
can1357 commented 4 years ago

Outputs c = (((X_0B&X_00)|(X_0A&X_01))&((((X_0A&X_00)|(X_09&X_01))&((((X_09&X_00)|(X_08&X_01))&((((X_08&X_00)|(X_07&X_01))&((((X_07|X_06)&((((X_01&X_00)&(X_05|(X_04&(X_00&X_06))))&(X_03|((X_03|X_02)&(X_00&X_04))))|((X_01&X_04)&(X_05&X_00))))|((X_01&X_05)&(X_06&X_00)))|((X_07&X_00)&(X_06&X_01))))|((X_08&X_00)&(X_07&X_01))))|((X_09&X_00)&(X_08&X_01))))|((X_0A&X_00)&(X_09&X_01))))

Change your stack depth with #pragma comment(linker, "/STACK:<>")

Does not seem to simplify well though, but I really don't recommend solving 12-unknown-variable boolean expressions with VTIL. 😛

zzz9328fb commented 4 years ago

Outputs c = (((X_0B&X_00)|(X_0A&X_01))&((((X_0A&X_00)|(X_09&X_01))&((((X_09&X_00)|(X_08&X_01))&((((X_08&X_00)|(X_07&X_01))&((((X_07|X_06)&((((X_01&X_00)&(X_05|(X_04&(X_00&X_06))))&(X_03|((X_03|X_02)&(X_00&X_04))))|((X_01&X_04)&(X_05&X_00))))|((X_01&X_05)&(X_06&X_00)))|((X_07&X_00)&(X_06&X_01))))|((X_08&X_00)&(X_07&X_01))))|((X_09&X_00)&(X_08&X_01))))|((X_0A&X_00)&(X_09&X_01))))

Change your stack depth with #pragma comment(linker, "/STACK:<>")

Does not seem to simplify well though, but I really don't recommend solving 12-unknown-variable boolean expressions with VTIL. 😛

12 are too few. Just like amd x64 : rax,rcx,rdx,rbx,rbp,rsi,rdi,r8,r9,r10,r11,r12,r13,r15,r16. Do not consider memory variables,there are at least 15 registers.

can1357 commented 4 years ago

Total number of possible variables != Average number of variables an expression depends on. Eitherway changing the stack depth will work fine for your case, if it does not simplify something let me know and I'll check it out.