javascript shellcode to c shellcode
程序员文章站
2022-07-15 14:39:17
...
分析脚本类的shellcode时,需要转成C版本的,更方便调试一些
为此写了一个010editor脚本,一键转换
#define TITLE "js-shellcode-to-c"
void Main(void)
{
int iIter;
int iStart;
int iSize;
string sToClipboard;
string sTemp;
if (FileCount() == 0)
{
MessageBox(idOk, TITLE, "At least one file needs to be open.");
return;
}
// Initializes the variables
iSize = GetSelSize();
iStart = GetSelStart();
// Check that bytes were selected, otherwise process complete file
if (iSize == 0)
{
iSize = FileSize();
iStart = 0;
}
if (iSize > 10000 && MessageBox(idYes | idNo, TITLE, "It could take a long time to process %d bytes, do you want to continue?", iSize) == idNo)
return;
int i;
sTemp = "unsigned char sc[] = \"";
for(i = 0;i < iSize; i+=6)
{
if(i % 8 == 0)
{
sTemp += "\n";
}
sTemp += "\\x";
sTemp += ReadString(iStart+i+4,2);
sTemp += "\\x";
sTemp += ReadString(iStart+i+2,2);
//Printf("%s\n",ReadString(iStart+i+2,4));
}
sTemp+= "\";\n";
Printf(sTemp);
ClearClipboard();
CopyStringToClipboard(sTemp);
FileNew("Hex");
Printf("Successfully created a new tab with [ 0x%x ] bytes.\n", i);
}
Main();
然后再用scdbg跑一下shellcode,简单看下调用了哪些api
推荐阅读
-
在C#中调用VBScript、javascript等脚本的实现代码
-
详解JavaScript对W3C DOM模版的支持情况
-
C#实现Javascript的Splice
-
.net中前台javascript与后台c#函数相互调用问题
-
Javascript 使用ajax与C#获取文件大小实例详解
-
JavaScript、C# URL编码、解码总结
-
C# javaScript函数的相互调用
-
浅析Java、C/C++、JavaScript、PHP、Python分别用来开发什么?
-
mvc C# JavaScript LigerUI oracle实现用户的注册、登陆验证、登陆
-
从此不再惧怕URI编码 JavaScript及C# URI编码详解