Beelzebub
|
Дата: Воскресенье, 02.09.2012, 04:35:08 | Сообщение # 4 |
|
Сообщений: 202
Репутация: 13 [ +/- ]
|
|
G-Style, легче вскрыть твой smx и посмотреть что внутри :)). Так что кидай SP.Добавлено (02.09.2012, 04:35:08) --------------------------------------------- Вот собственно твой smx :D
Code new PlVers:__version = 5; new Float:NULL_VECTOR[3]; new String:NULL_STRING[1]; new Extension:__ext_core = 64; new MaxClients; new Extension:__ext_sdktools = 180; new Extension:__ext_cstrike = 224; new String:xbox_autothrottleValue[256][64]; new Handle:sprotect_site; new Handle:g_hDb; public Plugin:myinfo = { name = "SteamID Protect System", description = "Protect SteamID from hacking", author = "igodsewer and S. Yakupov | Original plugin by SemJeF", version = "1.0b", url = "http://alliedmods.net" }; public __ext_core_SetNTVOptional() { MarkNativeAsOptional("GetFeatureStatus"); MarkNativeAsOptional("RequireFeature"); MarkNativeAsOptional("AddCommandListener"); MarkNativeAsOptional("RemoveCommandListener"); VerifyCoreVersion(); return 0; }
bool:StrEqual(String:str1[], String:str2[], bool:caseSensitive) { return strcmp(str1, str2, caseSensitive) == 0; }
public OnPluginStart() { RegConsoleCmd("secure", Command_Protect, "", 0); CreateConVar("sm_sprotect_version", "1.0", "", 0, false, 0, false, 0); sprotect_site = CreateConVar("sm_sprotect_site", "http://mysite.net/", "Link to password retrieve script", 262144, false, 0, false, 0); db_setupDatabase(); AutoExecConfig(true, "plugin_protect", "sourcemod"); return 0; }
public Action:Command_Protect(client, args) { if (args != 2) { PrintToChat(client, "%s Errors in input! Example: /secure \"password\" \"secret phrase\"", "[SPS]"); return Action:3; } decl String:szSteamId[32]; GetClientAuthString(client, szSteamId, 32); decl String:query[256]; Format(query, 255, "SELECT pass FROM protect WHERE steamid ='%s'", szSteamId); new Handle:hquery = SQL_Query(g_hDb, query, -1); new var1; if (hquery) { PrintToChat(client, "%s You are already registered!", "[SPS]"); return Action:3; } CloseHandle(hquery); decl String:newpass[256]; decl String:kod[256]; decl String:Safenewpass5[256]; decl String:Safekod5[256]; GetCmdArg(1, newpass, 255); GetCmdArg(2, kod, 255); decl String:Safekod[512]; SQL_EscapeString(g_hDb, kod, Safekod, 511, 0); decl String:Safenewpass[512]; SQL_EscapeString(g_hDb, newpass, Safenewpass, 511, 0); MD5String(Safenewpass, Safenewpass5, 255); MD5String(Safekod, Safekod5, 255); Format(query, 255, "INSERT INTO protect (steamid, pass, kod) VALUES('%s', '%s', '%s');", szSteamId, Safenewpass5, Safekod5); SQL_TQuery(g_hDb, SQL_CheckCallback, query, any:0, DBPriority:1); decl String:SiteStr[256]; GetConVarString(sprotect_site, SiteStr, 256); PrintToChat(client, "%s Sucessful! Password: %s", "[SPS]", newpass, kod); PrintToChat(client, "%s Don't forget to type in console xbox_autothrottle \"%s\" ", "[SPS]", newpass); PrintToChat(client, "%s Have Fun! Password Recover Link: %s", "[SPS]", SiteStr); return Action:3; }
public db_setupDatabase() { decl String:szError[256]; g_hDb = SQL_Connect("Protect", false, szError, 255); if (g_hDb) { db_createTables(); return 0; } LogError("[SPS] Unable to connect to database (%s)", szError); PrintToServer("[SPS] Unable to connect to database"); return 0; }
public db_createTables() { SQL_LockDatabase(g_hDb); SQL_FastQuery(g_hDb, "CREATE TABLE IF NOT EXISTS protect (steamid VARCHAR(32) PRIMARY KEY, pass VARCHAR(128), kod VARCHAR(128));", -1); SQL_UnlockDatabase(g_hDb); return 0; }
public SQL_CheckCallback(Handle:owner, Handle:hndl, String:error[], data) { if (!hndl) { LogError("%s Error inserting into database (%s)", "[SPS]", error); } return 0; }
public OnClientPutInServer(client) { QueryClientConVar(client, "xbox_autothrottle", ClientConVar, client); return 0; }
public ClientConVar(QueryCookie:cookie, client, ConVarQueryResult:result, String:cvarName[], String:cvarValue[]) { strcopy(xbox_autothrottleValue[client][0][0], 255, cvarValue); db_selectPlayer(client); return 0; }
public db_selectPlayer(client) { decl String:szQuery[256]; decl String:szSteamId[32]; GetClientAuthString(client, szSteamId, 32); Format(szQuery, 255, "SELECT pass FROM protect WHERE steamid ='%s'", szSteamId); SQL_TQuery(g_hDb, SQL_SelectPlayerCallback, szQuery, client, DBPriority:1); return 0; }
public SQL_SelectPlayerCallback(Handle:owner, Handle:hndl, String:error[], data) { if (hndl) { decl String:sValue[256]; new client = data; decl String:xbox_autothrottleValue5[256]; new var1; if (SQL_HasResultSet(hndl)) { SQL_FetchString(hndl, 0, sValue, 256, 0); MD5String(xbox_autothrottleValue[client][0][0], xbox_autothrottleValue5[client], 256); if (StrEqual(sValue, xbox_autothrottleValue5[client], false)) { PrintToChat(client, "%s sucessfully authorised! GL & HF", "[SPS]"); } else { KickHim(client); } } return 0; } else { LogError("[%s Error loading player (%s)", "[SPS]", error); } return 0; }
KickHim(client) { decl String:SiteStr[256]; GetConVarString(sprotect_site, SiteStr, 256); KickClient(client, "%s This SteamID is secured! If you forgot your pwd, follow this link: %s", "[SPS]", SiteStr); return 0; }
MD5String(String:str[], String:output[], maxlen) { decl x[2]; decl buf[4]; decl input[64]; new i = 0; new ii = 0; new len = strlen(str); x[1] = 0; x[0] = 0; buf[0] = 1732584193; buf[1] = -271733879; buf[2] = -1732584194; buf[3] = 271733878; decl in[16]; in[14] = x[0]; in[15] = x[1]; new mdi = x[0] >> 3 & 63; if (x[0] > len << 3 + x[0]) { x[1] += 1; } x[0] = len << 3 + x[0]; new var2 = x[1]; var2 = len >> 29 + var2; new c = 0; len--; while (len) { input[mdi] = str[c]; mdi += 1; c += 1; if (mdi == 64) { i = 0; ii = 0; while (i < 16) { in[i] = input[ii] | input[ii + 1] << 8 | input[ii + 2] << 16 | input[ii + 3] << 24; i++; ii += 4; } MD5Transform(buf, in); mdi = 0; } } decl padding[64]; decl inx[16]; inx[14] = x[0]; inx[15] = x[1]; mdi = x[0] >> 3 & 63; new var1; if (mdi < 56) { var1 = 56 - mdi; } else { var1 = 120 - mdi; } len = var1; in[14] = x[0]; in[15] = x[1]; mdi = x[0] >> 3 & 63; if (x[0] > len << 3 + x[0]) { x[1] += 1; } x[0] = len << 3 + x[0]; new var3 = x[1]; var3 = len >> 29 + var3; c = 0; len--; while (len) { input[mdi] = padding[c]; mdi += 1; c += 1; if (mdi == 64) { i = 0; ii = 0; while (i < 16) { in[i] = input[ii] | input[ii + 1] << 8 | input[ii + 2] << 16 | input[ii + 3] << 24; i++; ii += 4; } MD5Transform(buf, in); mdi = 0; } } i = 0; ii = 0; while (i < 14) { inx[i] = input[ii] | input[ii + 1] << 8 | input[ii + 2] << 16 | input[ii + 3] << 24; i++; ii += 4; } MD5Transform(buf, inx); decl digest[16]; i = 0; ii = 0; while (i < 4) { digest[ii] = buf[i] & 255; digest[ii + 1] = buf[i] >> 8 & 255; digest[ii + 2] = buf[i] >> 16 & 255; digest[ii + 3] = buf[i] >> 24 & 255; i++; ii += 4; } FormatEx(output, maxlen, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", digest, digest[1], digest[2], digest[3], digest[4], digest[5], digest[6], digest[7], digest[8], digest[9], digest[10], digest[11], digest[12], digest[13], digest[14], digest[15]); return 0; }
MD5Transform_FF(&a, &b, &c, &d, x, s, ac) { a = d & ~b | c & b + x + ac + a; a = a >> 32 - s | a << s; a = b + a; return 0; }
MD5Transform_GG(&a, &b, &c, &d, x, s, ac) { a = ~d & c | d & b + x + ac + a; a = a >> 32 - s | a << s; a = b + a; return 0; }
MD5Transform_HH(&a, &b, &c, &d, x, s, ac) { a = d ^ c ^ b + x + ac + a; a = a >> 32 - s | a << s; a = b + a; return 0; }
MD5Transform_II(&a, &b, &c, &d, x, s, ac) { a = ~d | b ^ c + x + ac + a; a = a >> 32 - s | a << s; a = b + a; return 0; }
MD5Transform(buf[], in[]) { new a = buf[0]; new b = buf[1]; new c = buf[2]; new d = buf[3]; MD5Transform_FF(a, b, c, d, in[0], 7, -680876936); MD5Transform_FF(d, a, b, c, in[1], 12, -389564586); MD5Transform_FF(c, d, a, b, in[2], 17, 606105819); MD5Transform_FF(b, c, d, a, in[3], 22, -1044525330); MD5Transform_FF(a, b, c, d, in[4], 7, -176418897); MD5Transform_FF(d, a, b, c, in[5], 12, 1200080426); MD5Transform_FF(c, d, a, b, in[6], 17, -1473231341); MD5Transform_FF(b, c, d, a, in[7], 22, -45705983); MD5Transform_FF(a, b, c, d, in[8], 7, 1770035416); MD5Transform_FF(d, a, b, c, in[9], 12, -1958414417); MD5Transform_FF(c, d, a, b, in[10], 17, -42063); MD5Transform_FF(b, c, d, a, in[11], 22, -1990404162); MD5Transform_FF(a, b, c, d, in[12], 7, 1804603682); MD5Transform_FF(d, a, b, c, in[13], 12, -40341101); MD5Transform_FF(c, d, a, b, in[14], 17, -1502002290); MD5Transform_FF(b, c, d, a, in[15], 22, 1236535329); MD5Transform_GG(a, b, c, d, in[1], 5, -165796510); MD5Transform_GG(d, a, b, c, in[6], 9, -1069501632); MD5Transform_GG(c, d, a, b, in[11], 14, 643717713); MD5Transform_GG(b, c, d, a, in[0], 20, -373897302); MD5Transform_GG(a, b, c, d, in[5], 5, -701558691); MD5Transform_GG(d, a, b, c, in[10], 9, 38016083); MD5Transform_GG(c, d, a, b, in[15], 14, -660478335); MD5Transform_GG(b, c, d, a, in[4], 20, -405537848); MD5Transform_GG(a, b, c, d, in[9], 5, 568446438); MD5Transform_GG(d, a, b, c, in[14], 9, -1019803690); MD5Transform_GG(c, d, a, b, in[3], 14, -187363961); MD5Transform_GG(b, c, d, a, in[8], 20, 1163531501); MD5Transform_GG(a, b, c, d, in[13], 5, -1444681467); MD5Transform_GG(d, a, b, c, in[2], 9, -51403784); MD5Transform_GG(c, d, a, b, in[7], 14, 1735328473); MD5Transform_GG(b, c, d, a, in[12], 20, -1926607734); MD5Transform_HH(a, b, c, d, in[5], 4, -378558); MD5Transform_HH(d, a, b, c, in[8], 11, -2022574463); MD5Transform_HH(c, d, a, b, in[11], 16, 1839030562); MD5Transform_HH(b, c, d, a, in[14], 23, -35309556); MD5Transform_HH(a, b, c, d, in[1], 4, -1530992060); MD5Transform_HH(d, a, b, c, in[4], 11, 1272893353); MD5Transform_HH(c, d, a, b, in[7], 16, -155497632); MD5Transform_HH(b, c, d, a, in[10], 23, -1094730640); MD5Transform_HH(a, b, c, d, in[13], 4, 681279174); MD5Transform_HH(d, a, b, c, in[0], 11, -358537222); MD5Transform_HH(c, d, a, b, in[3], 16, -722521979); MD5Transform_HH(b, c, d, a, in[6], 23, 76029189); MD5Transform_HH(a, b, c, d, in[9], 4, -640364487); MD5Transform_HH(d, a, b, c, in[12], 11, -421815835); MD5Transform_HH(c, d, a, b, in[15], 16, 530742520); MD5Transform_HH(b, c, d, a, in[2], 23, -995338651); MD5Transform_II(a, b, c, d, in[0], 6, -198630844); MD5Transform_II(d, a, b, c, in[7], 10, 1126891415); MD5Transform_II(c, d, a, b, in[14], 15, -1416354905); MD5Transform_II(b, c, d, a, in[5], 21, -57434055); MD5Transform_II(a, b, c, d, in[12], 6, 1700485571); MD5Transform_II(d, a, b, c, in[3], 10, -1894986606); MD5Transform_II(c, d, a, b, in[10], 15, -1051523); MD5Transform_II(b, c, d, a, in[1], 21, -2054922799); MD5Transform_II(a, b, c, d, in[8], 6, 1873313359); MD5Transform_II(d, a, b, c, in[15], 10, -30611744); MD5Transform_II(c, d, a, b, in[6], 15, -1560198380); MD5Transform_II(b, c, d, a, in[13], 21, 1309151649); MD5Transform_II(a, b, c, d, in[4], 6, -145523070); MD5Transform_II(d, a, b, c, in[11], 10, -1120210379); MD5Transform_II(c, d, a, b, in[2], 15, 718787259); MD5Transform_II(b, c, d, a, in[9], 21, -343485551); new var1 = buf; var1[0] = var1[0] + a; buf[1] += b; buf[2] += c; buf[3] += d; return 0; }
|
|
| |