-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjs-shellcode-to-c.1sc
More file actions
72 lines (58 loc) · 1.53 KB
/
js-shellcode-to-c.1sc
File metadata and controls
72 lines (58 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//------------------------------------------------
//--- 010 Editor v9.0.2 Script File
//
// File:
// Authors:
// Version:
// Purpose:
// Category:
// History:
//------------------------------------------------
//------------------------------------------------
//--- 010 Editor Script File
#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();