Click here to Skip to main content
15,891,184 members
Home / Discussions / Web Development
   

Web Development

 
QuestionDecode or deobfuscate php Pin
Mahdi 8216102118-Mar-14 23:10
Mahdi 8216102118-Mar-14 23:10 
AnswerRe: Decode or deobfuscate php Pin
Richard Deeming19-Mar-14 2:56
mveRichard Deeming19-Mar-14 2:56 
GeneralRe: Decode or deobfuscate php Pin
Mahdi 8216102121-Mar-14 4:35
Mahdi 8216102121-Mar-14 4:35 
GeneralRe: Decode or deobfuscate php Pin
Richard Deeming21-Mar-14 5:01
mveRichard Deeming21-Mar-14 5:01 
GeneralRe: Decode or deobfuscate php Pin
Mahdi 8216102121-Mar-14 5:14
Mahdi 8216102121-Mar-14 5:14 
GeneralRe: Decode or deobfuscate php Pin
Richard Deeming21-Mar-14 5:26
mveRichard Deeming21-Mar-14 5:26 
GeneralRe: Decode or deobfuscate php Pin
Mahdi 8216102121-Mar-14 5:30
Mahdi 8216102121-Mar-14 5:30 
GeneralRe: Decode or deobfuscate php Pin
Richard Deeming21-Mar-14 6:01
mveRichard Deeming21-Mar-14 6:01 
It's not the cleanest code, but it works:
C#
static void Main()
{
    const string input = @"...";
    // This should be the long string from the "eval(T7FC56270E7A70FA81A5935B72EACBE29(" line of your original post.
    
    Console.WriteLine(Decode(input));
}

static string Decode(string input)
{
    input = base64_decode(input);    
    
    int a = 0;
    int b = 0;
    int c = 0;
    int d = (ord(input[1]) << 8) + ord(input[2]);
    int e = 3;
    int f = 0;
    int g = 16;
    int length = input.Length;
    var result = new List<char>(length << 2);
    
    /*
    $TFF44570ACA8241914870AFBC310CDB85 = __FILE__;
    $TFF44570ACA8241914870AFBC310CDB85 = file_get_contents($TFF44570ACA8241914870AFBC310CDB85);
    $TA5F3C6A11B03839D46AF9FB43C97C188 = 0;
    preg_match(base64_decode("LyhwcmludHxzcHJpbnR8ZWNobykv"), $TFF44570ACA8241914870AFBC310CDB85, $TA5F3C6A11B03839D46AF9FB43C97C188);
    */
    
    for (; e < length; )
    {
        // if (count($TA5F3C6A11B03839D46AF9FB43C97C188)) exit;
        
        if (g == 0)
        {
            d = (ord(input[e++]) << 8);
            d += ord(input[e++]);
            g = 16;
        }
        if ((d & 0x8000) != 0)
        {
            a = (ord(input[e++]) << 4);
            a += (ord(input[e]) >> 4);
            if (a != 0)
            {
                b = (ord(input[e++]) & 0x0F) + 3;
                for (c = 0; c < b; c++)
                    Set(result, f+c, Get(result, f-a+c));
                
                f += b;
            }
            else
            {
                b = (ord(input[e++]) << 8);
                b += ord(input[e++]) + 16;
                
                for (c = 0; c < b; Set(result, f+c++, input[e]));
                
                e++;
                f += b;
            }
        }
        else 
            Set(result, f++, input[e++]);
        
        d <<= 1;
        g--;
        
        if (e == length)
        {
            return new string(result.ToArray());
        }
    }
    
    // Needed because the compiler doesn't think the loop ever exits:
    return null;
}

static string base64_decode(string value)
{
    return System.Text.Encoding.Default.GetString(Convert.FromBase64String(value));
}

static int ord(char c)
{
    return Microsoft.VisualBasic.Strings.Asc(c);
}

static T Get<T>(IList<T> list, int index)
{
    if (index < 0 || index >= list.Count) return default(T);
    return list[index];
}

static void Set<T>(IList<T> list, int index, T value)
{
    while (list.Count <= index) list.Add(default(T));
    list[index] = value;
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


Questionwhich backend technology for an advanced messaging application? Pin
chronodekar18-Mar-14 21:05
chronodekar18-Mar-14 21:05 
AnswerRe: which backend technology for an advanced messaging application? Pin
Dar Brett24-Mar-14 19:50
Dar Brett24-Mar-14 19:50 
GeneralRe: which backend technology for an advanced messaging application? Pin
chronodekar7-Apr-14 5:58
chronodekar7-Apr-14 5:58 
AnswerRe: which backend technology for an advanced messaging application? Pin
stevic9-Apr-14 7:11
professionalstevic9-Apr-14 7:11 
QuestionFacebook share button is not working Pin
Member 803236014-Mar-14 21:47
Member 803236014-Mar-14 21:47 
AnswerRe: Facebook share button is not working Pin
Blikkies17-Mar-14 3:50
professionalBlikkies17-Mar-14 3:50 
AnswerRe: Facebook share button is not working Pin
stevic9-Apr-14 7:14
professionalstevic9-Apr-14 7:14 
QuestionHow to playing song in the mobil devices with my ASP Pin
famontepeque13-Mar-14 10:53
famontepeque13-Mar-14 10:53 
SuggestionRe: How to playing song in the mobil devices with my ASP Pin
Richard Deeming14-Mar-14 2:15
mveRichard Deeming14-Mar-14 2:15 
QuestionRazor - render to "js" files as supposed to "cshtml"? Pin
Swab.Jat13-Mar-14 2:13
Swab.Jat13-Mar-14 2:13 
QuestionChrist the redeemer Pin
Rich.Edwards10-Mar-14 22:55
Rich.Edwards10-Mar-14 22:55 
AnswerRe: Christ the redeemer Pin
Kornfeld Eliyahu Peter10-Mar-14 23:38
professionalKornfeld Eliyahu Peter10-Mar-14 23:38 
AnswerRe: Christ the redeemer Pin
vbmike17-Mar-14 3:40
vbmike17-Mar-14 3:40 
AnswerRe: Christ the redeemer Pin
toms9803321-Mar-14 1:41
toms9803321-Mar-14 1:41 
QuestionASP.Net MVC 4 Web API Param is Null Pin
Kevin Marois6-Mar-14 14:59
professionalKevin Marois6-Mar-14 14:59 
QuestionPHP Pin
zunisheikh4-Mar-14 20:18
zunisheikh4-Mar-14 20:18 
SuggestionRe: PHP Pin
thatraja4-Mar-14 21:07
professionalthatraja4-Mar-14 21:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.