Open Deniskore opened 2 weeks ago
For now, I think the issue is related to the division only. Code to reproduce the issue:
#include <cassert>
#include <cstdint>
#include <iostream>
// TODO: Change the constant!
constexpr uint8_t OBFUSCATED_CONSTANT = 250;
uint8_t f(uint8_t aux0, uint8_t aux1) {
// INSERT the expression for OBFUSCATED_CONSTANT / 1
return 0;
}
void test_mba() {
for (uint8_t i = 0;; ++i) {
for (uint8_t j = 0;; ++j) {
assert(f(i, j) == OBFUSCATED_CONSTANT);
if (j == UINT8_MAX)
break;
}
if (i == UINT8_MAX)
break;
}
std::cout << "All tests passed!" << std::endl;
}
int main() { test_mba(); }
Hey! Thanks for the interesting project!
To eliminate warnings such as 'integer constant is too large,' it's necessary to generate specific type modifiers for constant integers in the expression.
I believe there are occasions when you might encounter an obfuscation issue, such as:
Generated code:
GCC:
Output
```Clang:
Output
```MSVC:
Output
``` example.cpp ASM generation compiler returned: 0 example.cpp Execution build compiler returned: 0 Program returned: 0 Result is 0 ```