I am trying to "decode" this following Base64 string:
OBFZDTcPCxlCKhdXCQ0kMQhKPh9uIgYIAQxALBtZAwUeOzcdcUEeW0dMO1kbPElWCV1ISFFKZ0kdWFlLAURPZhEFQVseXVtPOUUICVhMAzcfZ14AVEdIVVgfAUIBWVpOUlAeaUVMXFlKIy9rGUN0VF08Oz1POxFfTCcVFw1LMQNbBQYWAQ==
This is what I know about the string itself:
The original string is first passed through the following code:
private static string m000493(string p0, string p1) { StringBuilder builder = new StringBuilder(p0); StringBuilder builder2 = new StringBuilder(p1); StringBuilder builder3 = new StringBuilder(p0.Length); int num = 0; Label_0084: while (num < builder.Length) { int num2 = 0; while (num2 < p1.Length) { if ((num == builder.Length) || (num2 == builder2.Length)) { MessageBox.Show("EH?"); goto Label_0084; } char ch = builder[num]; char ch2 = builder2[num2]; ch = (char)(ch ^ ch2); builder3.Append(ch); num2++; num++; } } return m0001cd(builder3.ToString()); }
The p1
part in the code is supposed to be the string "_p0lizei.
".
It is then converted to a Base64 string by the following code:
private static string m0001cd(string p0) { string str2; try { byte[] buffer = new byte[p0.Length]; str2 = Convert.ToBase64String(Encoding.UTF8.GetBytes(p0)); } catch (Exception exception) { throw new Exception("Error in base64Encode" + exception.Message); } return str2; }
The question is, how do I decode the Base64 string so that I can find out what the original string is?
To decode a file with contents that are base64 encoded, you simply provide the path of the file with the --decode flag. As with encoding files, the output will be a very long string of the original file. You may want to output stdout directly to a file.
In JavaScript there are two functions respectively for decoding and encoding Base64 strings: btoa() : creates a Base64-encoded ASCII string from a "string" of binary data ("btoa" should be read as "binary to ASCII"). atob() : decodes a Base64-encoded string("atob" should be read as "ASCII to binary").
If you are using a Windows system, there is no built-in command to directly perform Base64 encoding and decoding. But you can use the built-in command "certutil -encode/-decode" to indirectly perform Base64 encoding and decoding.
Simple:
byte[] data = Convert.FromBase64String(encodedString); string decodedString = Encoding.UTF8.GetString(data);
The m000493
method seems to perform some kind of XOR encryption. This means that the same method can be used for both encoding and decoding the text. All you have to do is reverse m0001cd
:
string p0 = Encoding.UTF8.GetString(Convert.FromBase64String("OBFZDT...")); string result = m000493(p0, "_p0lizei."); // result == "gaia^unplugged^Ta..."
with return m0001cd(builder3.ToString());
changed to return builder3.ToString();
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With