Skip to content

Instantly share code, notes, and snippets.

@MrOplus
Created January 8, 2021 18:21
Show Gist options
  • Save MrOplus/ce1f0e6f14fe13b230dff04bad70d2e6 to your computer and use it in GitHub Desktop.
Save MrOplus/ce1f0e6f14fe13b230dff04bad70d2e6 to your computer and use it in GitHub Desktop.
Generate SuperAdmin Password for syscmd.asp based on WAN_MAC_ADDR on AirMaster Family (Latest Update)
#include <iostream>
int generateDebugPass() {
const char* v4; // $s1
size_t v5; // $v0
unsigned int v6; // $a3
int* v7; // $t0
char v8; // $a0
char* v9; // $a1
bool v10; // $v0
bool v11; // $v1
unsigned int v12; // $a0
bool v13; // $a2
bool v14; // $a1
bool v15; // $v0
int v17[4]; // [sp+20h] [-120h] BYREF
char v18[256]; // [sp+30h] [-110h] BYREF
char v19[16]; // [sp+130h] [-10h] BYREF
v4 = "6C:AD:EF:00:00:00";
memset(v18, 0, sizeof(v18));
// sprintf(v18, "generate debug password : %s %s", v4, "V2.0.0B31");
v5 = strlen(v18);
//webMD5Calc(v19, v18, v5);
v6 = 0;
v7 = v17;
v17[0] = 0;
v17[1] = 0;
v17[2] = 0;
v17[3] = 0;
do
{
v12 = *((unsigned __int8*)v7 + 272) * (unsigned int)*((unsigned __int8*)v7 + 273) % 0x3E;
v13 = v12 - 26 < 0xA;
if (v12 < 0x1A)
{
v8 = v12 + 97;
goto LABEL_5;
}
v14 = v12 - 36 < 0x1A;
if (v12 - 26 >= 0xA)
{
v8 = v12 + 29;
if (!v14)
v8 = 48;
LABEL_5:
v9 = (char*)v17 + v6;
v10 = v6++ < 0x10;
v7 = (int*)((char*)v7 + 2);
v11 = v6 < 8;
if (!v10)
goto LABEL_10;
goto LABEL_6;
}
v9 = (char*)v17 + v6;
v15 = v6++ < 0x10;
v8 = v12 + 22;
v7 = (int*)((char*)v7 + 2);
v11 = v6 < 8;
if (!v15)
{
LABEL_10:
// WebsDbgLog(1, "genDebugPassword:: generate password failed!\r\n", v13);
return -1;
}
LABEL_6:
*v9 = v8;
} while (v11);
char g_debugpass[32];
memset(g_debugpass, 0, sizeof(g_debugpass));
strncpy(g_debugpass, (const char*)v17, 32);
printf(g_debugpass);
}
int main()
{
generateDebugPass();
return 0;
}
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu
// Tips for Getting Started:
// 1. Use the Solution Explorer window to add/manage files
// 2. Use the Team Explorer window to connect to source control
// 3. Use the Output window to see build output and other messages
// 4. Use the Error List window to view errors
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
@mghadam
Copy link

mghadam commented Jun 4, 2021

Some passwords are mentioned here for those who don't want to compile this file.

https://twitter.com/MrOplus/status/1347636372375535619

https://twitter.com/MrOplus/status/1347642142940921862

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment