How would you reverse engineer this?

2019-03-20 17:56发布

I've got some code that was at the bottom of a php file that is in javascript. It goes through lots of weird contortions like converting hex to ascii then doing regex replacements, executing code and so on...

Is there any way to find out what it's executing before it actually does it?

The code is here:

http://pastebin.ca/1303597

7条回答
我想做一个坏孩纸
2楼-- · 2019-03-20 18:44

Easiest approach would be too simply use a simple c program to convert the escaped hex characters into readable text like so:

#include <stdio.h>

const char wtf[] = ""; // Really long string goes here

int main(void) {
    ::printf("%s\n", wtf);
}

which yields this (I added formatting). I'll let you finish off the last part which appears to be more of the same.

查看更多
登录 后发表回答