Skip to content

Commit cbe5ead

Browse files
committed
Add utility to convert shellcode
1 parent ca64d6c commit cbe5ead

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CVE-2020-16040/convert_shellcode.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var shellcode = "\x90\x90"; // replace with shellcode
2+
while(shellcode.length % 4)
3+
shellcode += "\x90";
4+
5+
var buf = new ArrayBuffer(shellcode.length);
6+
var arr = new Uint32Array(buf);
7+
var u8_arr = new Uint8Array(buf);
8+
9+
for(var i=0;i<shellcode.length;++i)
10+
u8_arr[i] = shellcode.charCodeAt(i);
11+
12+
console.log(arr);

chrome-exploit/convert_shellcode.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CVE-2020-16040/convert_shellcode.js

0 commit comments

Comments
 (0)