first init project code
This commit is contained in:
1
05-Other/hijack_files/Create-Hijack Files-test-1.exe
Normal file
1
05-Other/hijack_files/Create-Hijack Files-test-1.exe
Normal file
File diff suppressed because one or more lines are too long
BIN
05-Other/hijack_files/Create-Hijack Files-test-2.gif
Normal file
BIN
05-Other/hijack_files/Create-Hijack Files-test-2.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 MiB |
185
05-Other/hijack_files/Create-Hijack Files-test-3.html
Normal file
185
05-Other/hijack_files/Create-Hijack Files-test-3.html
Normal file
@@ -0,0 +1,185 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>新建网页</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta name="description" content=""/>
|
||||
<meta name="keywords" content=""/>
|
||||
|
||||
<script type="text/javascript">
|
||||
//① 绘制地图
|
||||
function Map() {
|
||||
//私有成员(不会随便发生变化)
|
||||
var w = 800;
|
||||
var h = 400;
|
||||
|
||||
//成员方法,绘制地图
|
||||
this.showmap = function () {
|
||||
//创建div、设置css样式、追加给body
|
||||
var tu = document.createElement('div');
|
||||
|
||||
tu.style.width = w + "px";
|
||||
tu.style.height = h + "px";
|
||||
tu.style.backgroundImage = "url(./12.jpg)";
|
||||
|
||||
document.body.appendChild(tu);
|
||||
}
|
||||
}
|
||||
|
||||
//② 绘制食物
|
||||
function Food() {
|
||||
var len = 20;
|
||||
//把食物(权值)坐标声明为公开的,以便在外部访问
|
||||
this.xFood = 0;
|
||||
this.yFood = 0;
|
||||
this.piece = null; //页面上唯一的食物对象
|
||||
//绘制
|
||||
this.showfood = function () {
|
||||
//创建div、设置css样式、追加给body
|
||||
if (this.piece === null) {
|
||||
this.piece = document.createElement('div');
|
||||
this.piece.style.width = this.piece.style.height = len + "px";
|
||||
this.piece.style.backgroundColor = "green";
|
||||
this.piece.style.position = "absolute";
|
||||
|
||||
document.body.appendChild(this.piece);
|
||||
}
|
||||
//食物设置绝对定位(position/left/top)
|
||||
//食物位置“随机”摆放
|
||||
//移动步进值:20px
|
||||
//食物“权值”坐标: X轴(0-39) Y轴(0-19)
|
||||
//食物真实坐标:权值坐标 * 步进值
|
||||
this.xFood = Math.floor(Math.random() * 40); //0-39的随机数
|
||||
this.yFood = Math.floor(Math.random() * 20); //0-19的随机数
|
||||
|
||||
this.piece.style.left = this.xFood * len + "px";
|
||||
this.piece.style.top = this.yFood * len + "px";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//③ 小蛇
|
||||
function Snake() {
|
||||
var len = 20;
|
||||
this.redirect = "right"; //默认向右边移动
|
||||
//后期snakebody要变化,因此声明为公开的(每个蛇节:[x坐标,y坐标,颜色,蛇节对象])
|
||||
this.snakebody = [[0, 1, 'green', null], [1, 1, 'green', null], [2, 1, 'green', null], [3, 1, 'red', null]];
|
||||
//a.绘制小蛇
|
||||
this.showsnake = function () {
|
||||
//遍历小蛇的各个蛇节,并依次创建即可
|
||||
for (var i = 0; i < this.snakebody.length; i++) {
|
||||
//this.snakebody[i]//代表每个蛇节
|
||||
//创建蛇节div
|
||||
if (this.snakebody[i][3] === null) {//判断没有创建对应的蛇节
|
||||
this.snakebody[i][3] = document.createElement('div');
|
||||
//设置css样式(宽度、高度、颜色)
|
||||
this.snakebody[i][3].style.width = this.snakebody[i][3].style.height = len + "px";
|
||||
this.snakebody[i][3].style.backgroundColor = this.snakebody[i][2];
|
||||
//绝对定位及位置
|
||||
this.snakebody[i][3].style.position = "absolute";
|
||||
//把蛇节追加给body
|
||||
document.body.appendChild(this.snakebody[i][3]);
|
||||
}
|
||||
this.snakebody[i][3].style.left = this.snakebody[i][0] * len + "px";
|
||||
this.snakebody[i][3].style.top = this.snakebody[i][1] * len + "px";
|
||||
}
|
||||
}
|
||||
|
||||
//b.移动小蛇
|
||||
this.movesnake = function () {
|
||||
//非蛇头蛇节(当前蛇节的新坐标 是"下个蛇节"的旧坐标)
|
||||
for (var i = 0; i < this.snakebody.length - 1; i++) {
|
||||
this.snakebody[i][0] = this.snakebody[i + 1][0];
|
||||
this.snakebody[i][1] = this.snakebody[i + 1][1];
|
||||
}
|
||||
if (this.redirect == "right") {
|
||||
//蛇头x坐标递增
|
||||
this.snakebody[this.snakebody.length - 1][0] += 1;
|
||||
}
|
||||
if (this.redirect == "left") {
|
||||
//蛇头x坐标递减
|
||||
this.snakebody[this.snakebody.length - 1][0] -= 1;
|
||||
}
|
||||
if (this.redirect == "up") {
|
||||
//蛇头y坐标递减
|
||||
this.snakebody[this.snakebody.length - 1][1] -= 1;
|
||||
}
|
||||
if (this.redirect == "down") {
|
||||
//蛇头y坐标递增
|
||||
this.snakebody[this.snakebody.length - 1][1] += 1;
|
||||
}
|
||||
|
||||
//判断蛇头碰到食物
|
||||
//蛇头坐标
|
||||
var xSnake = this.snakebody[this.snakebody.length - 1][0];
|
||||
var ySnake = this.snakebody[this.snakebody.length - 1][1];
|
||||
//食物坐标food.xFood/food.yFood;
|
||||
if (xSnake == food.xFood && ySnake == food.yFood) {
|
||||
//吃食物增加蛇节
|
||||
var newjie = [this.snakebody[0][0], this.snakebody[0][1], 'green', null];
|
||||
this.snakebody.unshift(newjie);//把newjie放到数组的第一个位置去
|
||||
|
||||
//原食物消失,重新生成一个食物
|
||||
food.showfood();
|
||||
}
|
||||
|
||||
//控制小蛇在地图范围内移动
|
||||
if (xSnake < 0 || xSnake > 39 || ySnake < 0 || ySnake > 19) {
|
||||
alert('game over');
|
||||
clearInterval(mytime);
|
||||
return false;
|
||||
}
|
||||
//吃到自己判断(蛇头坐标与其他蛇节坐标一致)
|
||||
for (var k = 0; k < this.snakebody.length - 1; k++) {
|
||||
if (this.snakebody[k][0] == xSnake && this.snakebody[k][1] == ySnake) {
|
||||
alert('game over kill you by yourself');
|
||||
clearInterval(mytime);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//根据新坐标绘制小蛇
|
||||
this.showsnake();
|
||||
}
|
||||
}
|
||||
|
||||
window.onload = function () {
|
||||
var map = new Map();
|
||||
map.showmap();
|
||||
|
||||
food = new Food();//声明为全局的以便在该加载事件函数外部访问
|
||||
food.showfood();
|
||||
|
||||
snake = new Snake();//声明为全局的snake对象
|
||||
snake.showsnake();
|
||||
|
||||
//移动小蛇
|
||||
//setInterval(全局变量,时间)
|
||||
mytime = setInterval("snake.movesnake()", 200);
|
||||
|
||||
//设置键盘事件,控制器小蛇移动方向
|
||||
document.onkeydown = function (evt) {
|
||||
var num = evt.keyCode;//通过事件对象获得数值码,进而知道被触发键子
|
||||
if (num == 38) {
|
||||
snake.redirect = "up";
|
||||
}
|
||||
if (num == 40) {
|
||||
snake.redirect = "down";
|
||||
}
|
||||
if (num == 37) {
|
||||
snake.redirect = "left";
|
||||
}
|
||||
if (num == 39) {
|
||||
snake.redirect = "right";
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
</style> -->
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
BIN
05-Other/hijack_files/Create-Hijack Files-test-4.jpeg
Normal file
BIN
05-Other/hijack_files/Create-Hijack Files-test-4.jpeg
Normal file
Binary file not shown.
BIN
05-Other/hijack_files/Create-Hijack Files-test-5.png
Normal file
BIN
05-Other/hijack_files/Create-Hijack Files-test-5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
84
05-Other/hijack_files/Create-Hijack Files-test-6.svg
Normal file
84
05-Other/hijack_files/Create-Hijack Files-test-6.svg
Normal file
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M512,71.596c0-13.719-5.344-26.617-15.044-36.317c-20.025-20.025-52.608-20.024-72.634,0l-1.512,1.511
|
||||
c-0.001,0.002-0.003,0.003-0.005,0.005c-0.003,0.003-0.006,0.007-0.01,0.01l-44.12,44.12c-0.001,0.002-0.003,0.003-0.005,0.005
|
||||
c-0.003,0.003-0.006,0.007-0.01,0.01L255.388,204.213c-30.172-6-61.756,3.433-83.649,25.324
|
||||
c-28.553,28.553-26.538,55.759-24.59,82.069c1.551,20.939,3.154,42.592-8.937,69.176c-1.291,2.837-1.185,6.114,0.287,8.861
|
||||
c1.472,2.748,4.141,4.652,7.217,5.15c17.396,2.816,33.728,4.222,48.975,4.222c46.161,0,82.372-12.885,108.006-38.518
|
||||
c0.146-0.146,0.284-0.296,0.428-0.443c0.271-0.252,0.529-0.517,0.77-0.796c21.028-21.833,30.014-52.797,24.126-82.409
|
||||
l168.935-168.935C506.656,98.212,512,85.315,512,71.596z M161.296,376.828c8.83-25.735,7.23-47.336,5.798-66.699
|
||||
c-0.875-11.814-1.632-22.123-0.073-31.955c0.044-0.025,0.089-0.043,0.133-0.069c0.121-0.071,12.506-6.971,26.356-2.348
|
||||
c12.121,4.049,22.293,15.723,30.234,34.699c12.804,30.6,31.909,43.202,45.682,48.384c0.833,0.314,1.654,0.598,2.468,0.868
|
||||
C244.969,376.884,207.917,382.632,161.296,376.828z M291.675,343.029c-8.688,0.036-33.979-3.239-49.484-40.291
|
||||
c-10.265-24.533-24.513-39.992-42.348-45.949c-8.468-2.828-16.488-3.032-23.248-2.157c2.503-3.588,5.552-7.221,9.285-10.955
|
||||
c17.644-17.644,43.323-24.969,67.578-19.434l54.532,54.533C313.184,301.55,307.045,325.576,291.675,343.029z M317.042,259.545
|
||||
l-44.352-44.352l31.942-31.942l44.352,44.352L317.042,259.545z M363.125,213.461l-44.352-44.352l33.69-33.69
|
||||
c-0.366,3.336-0.57,6.706-0.57,10.109c0,21.491,7.391,41.853,20.96,58.204L363.125,213.461z M387.084,189.503
|
||||
c-9.838-12.512-15.191-27.832-15.191-43.975c0-19.047,7.428-36.965,20.917-50.455l3.789-3.789
|
||||
c-0.366,3.336-0.57,6.706-0.57,10.109c-0.001,21.491,7.39,41.853,20.959,58.205L387.084,189.503z M431.218,145.368
|
||||
c-9.838-12.512-15.191-27.832-15.191-43.975c0-19.048,7.429-36.968,20.92-50.458l1.517-1.517c0.705-0.705,1.439-1.37,2.197-1.998
|
||||
c-2.689,24.401,4.569,48.878,20.464,68.04L431.218,145.368z M482.815,93.771l-7.469,7.469
|
||||
c-13.538-17.223-18.406-39.573-13.142-60.968c7.789,0.38,15.058,3.594,20.61,9.147c5.924,5.924,9.187,13.799,9.187,22.175
|
||||
C492.001,79.971,488.739,87.848,482.815,93.771z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M407.051,248.931c-1.859-1.86-4.439-2.93-7.068-2.93c-2.63,0-5.21,1.07-7.069,2.93s-2.93,4.44-2.93,7.069
|
||||
c0,2.63,1.069,5.21,2.93,7.069c1.861,1.86,4.44,2.93,7.069,2.93c2.63,0,5.21-1.07,7.068-2.93c1.86-1.86,2.931-4.44,2.931-7.069
|
||||
C409.982,253.37,408.912,250.79,407.051,248.931z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M202.837,50.946c-1.86-1.86-4.44-2.93-7.069-2.93s-5.21,1.07-7.068,2.93c-1.861,1.86-2.931,4.44-2.931,7.069
|
||||
c0,2.63,1.071,5.21,2.931,7.069c1.859,1.86,4.439,2.93,7.068,2.93s5.209-1.07,7.069-2.93c1.861-1.86,2.93-4.44,2.93-7.069
|
||||
C205.766,55.385,204.696,52.806,202.837,50.946z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M461.787,435.986h-51.806V296.997c0-5.523-4.478-9.999-9.999-9.999c-5.522,0-9.999,4.477-9.999,9.999v138.989H121.991
|
||||
c-5.522,0-9.999,4.477-9.999,9.999c0,25.362-20.634,45.996-45.996,45.996s-45.997-20.634-45.997-45.996V68.014h133.711
|
||||
c5.522,0,9.999-4.477,9.999-9.999s-4.478-9.999-9.999-9.999H19.998V20.018h369.995v10.217c0,5.523,4.478,9.999,9.999,9.999
|
||||
c5.522,0,9.999-4.477,9.999-9.999V10.019c0-5.523-4.478-9.999-9.999-9.999H9.999C4.478,0.02,0,4.496,0,10.019v435.967
|
||||
c0,35.266,27.804,64.16,62.642,65.911c0.427,0.055,0.861,0.084,1.303,0.084h341.846c36.39,0,65.995-29.605,65.995-65.995
|
||||
C471.786,440.463,467.309,435.986,461.787,435.986z M405.791,491.982H113.276c9.373-9.632,15.838-22.11,17.958-35.997h319.459
|
||||
C446.114,476.554,427.72,491.982,405.791,491.982z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
1
05-Other/hijack_files/Create-Hijack Files-test.apk
Normal file
1
05-Other/hijack_files/Create-Hijack Files-test.apk
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user