| 4-Stage |
#include <iostream>
#include <string>
#include <cstdlib>
#include <cerrno>
#include <cstdint>
uint16_t g_consoleModeFlags;
uint16_t g_consoleMask;
uint8_t stage1(const std::string& pass) {
std::string sub = pass.substr(0, 2);
char* end;
errno = 0;
long val = strtol(sub.c_str(), &end, 10);
uint8_t b = (uint8_t)val;
return (b << 7) | (b >> 1);
}
int16_t stage2(const std::string& pass) {
char buf[2] = { pass[2], pass[3] };
for (int i = 0; i < 2; i++) {
buf[i] = (buf[i] ^ (i * 7)) + i;
}
return *(int16_t*)buf;
}
uint16_t stage3(const std::string& pass) {
uint8_t b0 = pass[4], b1 = pass[5];
uint16_t val = ((uint16_t)b1 << 7) | (b0 >> 1);
return val & g_consoleMask;
}
int16_t stage4(const std::string& pass) {
uint8_t b0 = pass[6];
uint8_t b1 = pass[7] ^ 0x5A;
uint8_t high = (b1 << 2) | (b1 >> 6);
uint8_t low = ((b0 + 3) * 2) | ((int8_t)(b0 + 3) < 0 ? 1 : 0);
return (int16_t)((high << 8) | low);
}
bool checkPassword(const std::string& pass) {
if (pass.size() != 8) {
std::cout << "Password must be 8 characters long!\n";
return false;
}
if (stage1(pass) != 0x1E) {
std::cout << "Stage 1 failed\n";
return false;
}
if (stage2(pass) != 0x646f) {
std::cout << "Stage 2 failed\n";
return false;
}
if (stage3(pass) != g_consoleMask) {
std::cout << "Stage 3 failed\n";
return false;
}
if (stage4(pass) != (int16_t)0xEDCA) {
std::cout << "Stage 4 failed\n";
return false;
}
return true;
}
int main() {
while (true) {
std::cout << "Enter password: ";
std::string input;
std::cin >> input;
if (checkPassword(input)) {
std::cout << "Password IS Correct!\n";
} else {
std::cout << "Password Is NOT Correct!\n";
}
}
return 0;
} |
2026-03-01 18:42 |
| Test my obf. PLS |
ts looks so skidded from PyObfuscate - Simple Python Code Obfuscator by HTR-TECH |
2026-02-28 22:38 |