Skip to content

Instantly share code, notes, and snippets.

@relyky
Last active November 7, 2023 08:10
Show Gist options
  • Save relyky/286c3fff5145a193a943b9949f0d0037 to your computer and use it in GitHub Desktop.
Save relyky/286c3fff5145a193a943b9949f0d0037 to your computer and use it in GitHub Desktop.
Fake64
function openencryptedpackage(encryptedpackage) {
function e2c(e) {encryptedpackage
return Array.from(e).map(function (c) {
return c === 'a' ? 'A': c === 'g' ? 'E': c === '1' ? 'I': c === '0' ? 'O': c === '7' ? 'U': c === 'p' ? 'P': c === 'w' ? 'W': c === 'e' ? 'H': c === '5' ? 'S': c === 'A' ? 'a': c === 'H' ? 'e': c === 'E' ? 'i': c === 'v' ? 'o': c === 'o' ? 'u': c === 'u' ? 'v': c === 'i' ? 'g': c === 'P' ? 'p': c === 'W' ? 'w': c === 'O' ? '0': c === 'I' ? '1': c === 'S' ? '5': c === 'U' ? '7': c;
}).join('');
}
function c2a(e) {
return Array.from(e).map(function (c) {
return c === 'x' ? '%' : c === '1' ? '2' : c === '%' ? 'x' : c === '2' ? '1' : c;
}).join('');
}
const info = JSON.parse(window.decodeURIComponent(c2a(window.atob(e2c(encryptedpackage)))));
[...]
}
@functions {
public static string MakeFake64(string b64)
{
var f64 = new System.Text.StringBuilder();
var vistor = b64.GetEnumerator();
while (vistor.MoveNext())
{
switch (vistor.Current)
{
case 'A': f64.Append('a'); break;
case 'E': f64.Append('g'); break;
case 'I': f64.Append('1'); break;
case 'O': f64.Append('0'); break;
case 'U': f64.Append('7'); break;
case 'P': f64.Append('p'); break;
case 'W': f64.Append('w'); break;
case 'H': f64.Append('e'); break;
case 'S': f64.Append('5'); break;
case 'a': f64.Append('A'); break;
case 'e': f64.Append('H'); break;
case 'i': f64.Append('E'); break;
case 'o': f64.Append('v'); break;
case 'u': f64.Append('o'); break;
case 'v': f64.Append('u'); break;
case 'g': f64.Append('i'); break;
case 'p': f64.Append('P'); break;
case 'w': f64.Append('W'); break;
case '0': f64.Append('O'); break;
case '1': f64.Append('I'); break;
case '5': f64.Append('S'); break;
case '7': f64.Append('U'); break;
default: f64.Append(vistor.Current); break;
}
}
return f64.ToString();
}
public static string MakeFake3986(string s3968)
{
var f3968 = new System.Text.StringBuilder();
var vistor = s3968.GetEnumerator();
while (vistor.MoveNext())
{
switch (vistor.Current)
{
case '%': f3968.Append('x'); break;
case 'x': f3968.Append('%'); break;
case '2': f3968.Append('1'); break;
case '1': f3968.Append('2'); break;
default: f3968.Append(vistor.Current); break;
}
}
return f3968.ToString();
}
}
string encryptedpackage = ViewFunctions.MakeFake64(Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(
ViewFunctions.MakeFake3986(Uri.EscapeDataString(Newtonsoft.Json.JsonConvert.SerializeObject(info, Newtonsoft.Json.Formatting.None))))));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment