-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
405 lines (364 loc) · 19.4 KB
/
index.html
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ILUGD</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!--<link rel="stylesheet" href="css/nes.css">-->
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/nesconsole.css">
<link rel="stylesheet" href="css/theme/black.css" id="theme">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="plugin/highlight/highlight.css">
<link href="https://fonts.googleapis.com/css?family=Architects+Daughter|Caveat|Coming+Soon|Fredericka+the+Great|Handlee|Pacifico|Patrick+Hand|Sacramento" rel="stylesheet">
<style type="text/css">
@font-face{
font-family: 'Hinglish';
src: url(hindi.TTF) format("truetype");
}
</style>
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section><!--data-background="mainbg.jpg">-->
<input type="radio" name="nes-size" id="size4" checked>
<p style="font-family: 'Press Start 2P'; font-size: 30px">Welcome!</p>
<div id="nes">
<div class="nes-top">
<div class="lid">
<h5 style="color: navy; font-family: 'Press Start 2P'; font-size: 25px;">TOPIC:</h5>
<h3 style="font-family: 'Press Start 2P', cursive; color: rgb(255,0,0,0.6); font-size:40px;">Assembly101</h3>
</div>
<div class="cartridge-slot">
<div class="cartridge-slot-border"></div>
<div class="cartridge-slot-hole"><a href="#/1"><p style="margin: 8px">PRESS HERE</p></a></div>
</div>
</div>
<div class="nes-bottom">
<div class="power-box">
<input type="checkbox" id="power" />
<div class="reset" id="start"></div>
<label for="power" class="power"></label>
<div class="light"></div>
<p style="font-family: 'Press Start 2P'; font-size: 20px; color: rgb(255,0,0,0.5);">Let's Learn Assembly!<br>(Basics)</p>
</div>
<p style="font-family: 'Press Start 2P'; font-size: 20px; color: rgb(255,0,0,0.5);">A Talk by <br>Nikhil</p>
</div>
<div class="gamepads-slots">
<div class="gamepad-slot p1"></div>
<div class="gamepad-slot p2"></div>
</div>
</div>
</section>
<section style="text-align: left; color: #131c22;" data-background="2.jpg">
<p style="font-family: 'Press Start 2P', cursive; font-size: 25px;">$> whoami</p>
<p class="fragment fade" style="font-family: 'Press Start 2P', cursive; font-size: 20px;"> Nikhil Kumar</p>
<p class="fragment up" style="font-family: 'Press Start 2P', cursive; font-size: 20px;"> I research on random things</p>
<p class="fragment up" style="font-family: 'Press Start 2P', cursive; font-size: 20px;"> I make random things and then test<br> them on myself!</p>
<p class="fragment up" style="font-family: 'Press Start 2P', cursive; font-size: 20px;"> Also, learning security concepts<br> day by day</p>
<p class="fragment up" style="font-family: 'Press Start 2P', cursive; font-size: 20px;"> <i class="icon twitter is-small"></i>@dumbomason</p>
<p class="fragment up" style="font-family: 'Press Start 2P', cursive; font-size: 20px;"> <i class="icon github is-small"></i>@nk521</p>
</section>
<section data-background="patanjali.jpeg" data-background-size="90%">
</section>
<section data-background="eeg-pic.jpeg" data-background-size="50%"></section>
<section data-background-video="eeg-gif.gif"></section>
<section data-background="whatsapp.jpeg">
<p class="fragment up" style="background-color: #111; font-family: 'Press Start 2P', cursive; font-size: 60px;"> SYSTEM WIDE BUG<br> It worked on other devices too!</p>
</section>
<section data-background="lci_ilug.jpg" >
<p style="margin-top: -350px; font-family: 'Press Start 2P', cursive; font-size: 45px;">Thanks to these communities</p>
</section>
<section style="font-family: 'Press Start 2P', cursive; color: white;" data-background="deadpool.jpg">
<p style="text-align: left;font-size: 25px">What you'll learn today</p><br>
<p class="fragment fade" style="text-align: left;font-size: 20px">- x86</p>
<p class="fragment fade" style="text-align: left;font-size: 20px">- Basic Instructions</p>
<p class="fragment fade" style="text-align: left;font-size: 20px">- Writing ASM</p>
<p class="fragment fade" style="text-align: left;font-size: 20px">- How to reverse engineer?</p>
</section>
<!-- Example of nested vertical slides -->
<section>
<section style="font-size: 50px;" data-background="3.jpg">
<p style="font-family: 'Press Start 2P';">But, Why <span style=" font-style: bold;">RE</span> ?</p>
<aside class="notes">asdasddasda</aside>
</section>
<section data-background="4.jpg" style="text-align:left;font-family: 'Press Start 2P', cursive; font-size: 25px">
<p class="fragment fade">- Curiosity</p>
<p class="fragment fade">- Keygen/Trainers/Cracks</p>
<p class="fragment fade">- Exploit Development</p>
<p class="fragment fade">- Propriety Applications</p>
</section>
</section>
<section>
<section data-background="5.jpg" style="font-size: 20px; font-family: 'Press Start 2P'">
<p style="margin-top: -100px; font-size: 40px;">Let's talk about memory!</p>
<br>
<span class="fragment fade">
<p style="text-align: left;"> A byte == 0 - 255</p>
<p style="text-align: left;"> == 0x00 - 0xff</p>
<p style="text-align: left;"> == 0b00000000 - 0b11111111</p>
<hr>
</span>
<span class="fragment up">
<p>2**32 bytes of addressable memory space<br> == 4 Gibibytes ≈ 4 Gigabytes <br> 0x00000000 - 0xffffffff</p>
<hr>
</span>
<span class="fragment up">
<p>2**64 bytes of addressable memory space<br> == 16 Exbibytes ≈ 16 Exabytes <br> 0x0000000000000000 - 0xffffffffffffffff</p>
</span>
</section>
<section style="font-family: 'Press Start 2P'; font-size: 20px;" data-background="6.jpg">
<p style="font-size: 50px; margin-top: -200px; text-align: left; margin-left: -50px">Memory Layout</p>
<p style="text-align: left;margin-left: -50px" class="fragment fade">- Why 0x7fffffff and not 0xffffffff? </p>
<p style="text-align: left;margin-left: -50px" class="fragment fade">- INT32 signed is two's complement!<br> So, hex((2**(32-1))-1) == 0x7fffffff! </p>
</section>
<section style="font-family: 'Press Start 2P'; font-size: 20px;" data-background="7.jpg">
<p style="text-align: left;" class="fragment fade">The <u>CODE/TEXT</u> segment stores the executable address space and is generally read-only and of fixed size.</p>
<p style="text-align: left;" class="fragment fade"><u>RODATA/DATA/BSS</u> in next slide!</p>
<p style="text-align: left;" class="fragment fade"><u>HEAP</u> - You all know about this!</p>
<p style="text-align: left;" class="fragment fade"><u>STACK</u> - LIFO/Higher region in memory. </p>
</section>
<section style="font-family: 'Press Start 2P'; font-size: 20px;" data-background="8.jpg">
<p style="font-size: 25px; margin-top: -150px" class="fragment fade"><u>.BSS segment</u> - uninitialized data and ZERO initialized data</p><br>
<p style="text-align: left;" class="fragment fade">int x;</p>
<p style="text-align: left;" class="fragment fade">un/signed int x;</p>
<p style="text-align: left;" class="fragment fade">un/signed int x[2];</p>
<p style="text-align: left;" class="fragment fade">int x = 0x0;</p>
<p style="text-align: left;" class="fragment fade">un/signed int x = 0x0;</p>
<p style="text-align: left;" class="fragment fade">un/signed int x[2] = {0x0,0x0};</p>
</section>
<section style="font-family: 'Press Start 2P'; font-size: 20px;" data-background="8.jpg">
<p style="text-align: left; font-size: 25px; margin-top: -250px" class="fragment fade"><u>.data segment</u> - initialized data</p><br>
<p style="text-align: left;" class="fragment fade">int x = 0x1;</p>
<p style="text-align: left;" class="fragment fade">un/signed int x = 0x1;</p>
<p style="text-align: left;" class="fragment fade">un/signed int x[2] = {0x1,0x2};</p>
</section>
<section style="font-family: 'Press Start 2P'; font-size: 20px;" data-background="8.jpg">
<p style="text-align: left; font-size: 25px; margin-top: -150px" class="fragment fade"><u>.rodata segment</u> - constant data</p><br>
<p style="text-align: left;" class="fragment fade">const int x;</p>
<p style="text-align: left;" class="fragment fade">const un/signed int x;</p>
<p style="text-align: left;" class="fragment fade">const un/signed int x[2];</p>
<p style="text-align: left;" class="fragment fade">const int x = 0x0;</p>
<p style="text-align: left;" class="fragment fade">const un/signed int x = 0x0;</p>
<p style="text-align: left;" class="fragment fade">const un/signed int x[2] = {0x0,0x0};</p>
</section>
</section>
<section>
<section style="font-family: 'Press Start 2P', cursive; color: white;" data-background="9.jpg">
<p style="font-size: 55px; color: skyblue;">REGISTERS</p>
<p style="font-size: 20px" class="fragment fade">The fastest memory</p>
</section>
<section style="text-align: left;font-size: 20px;font-family: 'Press Start 2P', cursive; color: white;" data-background="9.jpg">
<p style="font-size: 35px">General Purpose:</p>
<p class="fragment fade">AL/AH/AX/EAX/RAX - Accumulator - stores intermediate arithmetic/logic values and return values</p>
<p class="fragment fade">BL/BH/BX/EBX/RBX - stores base index (arrays)</p>
<p class="fragment fade">CL/CH/CX/ECX/RCX - loop counter</p>
<p class="fragment fade">DL/DH/DX/EDX/RDX - extends the precision of Accumulator (EAX/RAX)</p>
<p class="fragment fade">IP/EIP/RIP - Instruction Pointer</p>
<p class="fragment fade">SIL/SI/ESI/RSI - Source Index - for string operations</p>
<p class="fragment fade">DIL/DI/EDI/RDI - Destination Index - for string operations</p>
<p class="fragment fade">SPL/SP/ESP/RSP - Stack Pointer - points<br>the top address of stack</p>
<p class="fragment fade">BPL/BP/EBP/RBP - Base Pointer - points the <br>base address (stack address) of current stack frame</p>
<aside class="notes">Registers can be used for anything. AL/AH (8bit), AX (16bit), eax (32bits) and rax(64bits)</aside>
</section>
<section style="text-align: left;font-size: 20px;font-family: 'Press Start 2P', cursive; color: white;" data-background="9.jpg">
<p >NOTE : SIL/DIL/SPL/BPL are only available in 64bit mode</p>
<p class="fragment fade" style="font-size: 35px">Other Registers:</p>
<p class="fragment fade">r8-r15 (64bit only), EFLAGS/RFLAGS(ZF/PF/CF/etc)</p>
<p class="fragment fade">et cetra (Check out the wikipedia page)</p>
<p class="fragment fade" style="font-size: 35px">Syscalls: (What is this?)</p>
<p class="fragment fade">syscall number -> EAX/RAX</p>
<p class="fragment fade">arg0 -> EBX/RDI</p>
<p class="fragment fade">arg1 - ECX/RSI</p>
<p class="fragment fade">arg2 - EDX/RDX</p>
<p class="fragment fade">arg3 - ESI/R10</p>
<p class="fragment fade">arg4 - EDI/R8</p>
<p class="fragment fade">arg5 - EBP/R9</p>
</section>
<section style="text-align: left;font-size: 20px;font-family: 'Press Start 2P', cursive; color: white;" data-background="9.jpg">
<p class="fragment fade">0x1122334455667788</p>
<p class="fragment fade"> |----------------| -> R* (64bit)</p>
<p class="fragment fade"> |--------| -> E* (32bit)</p>
<p class="fragment fade"> |----| -> *X/*S/*P/*I/IP (16bit)</p>
<p class="fragment fade"> |--| -> *H (upper 8bits of ^)</p>
<p class="fragment fade"> |--| -> *L (rest of the bits)</p>
</section>
</section>
<section>
<section style="font-size: 100px;font-family: 'Press Start 2P', cursive; color: white;" data-background="10.jpg">
<p>Assembly</p>
</section>
<section style="font-size: 20px;text-align: left;font-family: 'Press Start 2P', cursive; color: white; margin-left: -50px;" data-background="11.jpg">
<p style="font-size: 50px;text-align: left;">Compiler</p>
<p class="fragment fade">Converts high-level code (source) to<br>ELF/machine code (1 || 0/hex)</p>
<p class="fragment fade">Example : GCC/G++ (C/C++), GHC (haskell),<br>Delphi (pascal), etc</p>
</section>
</section>
<section style="font-size: 40px;font-family: 'Press Start 2P', cursive; color: white; margin-top: -10px" data-background="12.jpg">
<p style="font-size: 50px">⥣</p>
<p style="font-size: 20px">AT&T format <inst> <src>, <dst></p>
<p>Hello World</p>
<p style="font-size: 20px">INTEL format <inst> <dst>, <src></p>
<p style="font-size: 50px">⥥</p>
</section>
<section style="text-align: left;font-size: 20px;font-family: 'Press Start 2P', cursive; color: white;" data-background="13.jpg">
<p style="font-size: 40px;">Instructions</p>
</section>
<section style="text-align: left;font-size: 20px;font-family: 'Press Start 2P', cursive; color: white;" data-background="14.jpg">
<p style="font-size: 40px;">PUSH/POP/MOV</p>
<p>PUSH -> pushes a value to the top of the stack!</p>
<p>PULL -> pops the topmost value from stack!</p>
<p>MOV -> sets a value to specified register/memory</p>
</section>
<section style="text-align: left;font-size: 20px;font-family: 'Press Start 2P', cursive; color: white;" data-background="14.jpg">
<p style="font-size: 40px;">ADD/SUB/MUL/DIV/INC/DEC</p>
<p>Common arithmetic instructions</p>
<p>INC -> Increment by 1</p>
<p>DEC -> Decrement by 1</p>
</section>
<section style="text-align: left;font-size: 20px;font-family: 'Press Start 2P', cursive; color: white;" data-background="14.jpg">
<p style="font-size: 40px;">ADD/OR/XOR/NOT/SHL/SHR</p>
<p>Common logical instructions</p>
<p>SHL/SHR -> Shift Left/Right -> Byte shifters</p>
</section>
<section style="text-align: left;font-size: 20px;font-family: 'Press Start 2P', cursive; color: white;" data-background="14.jpg">
<p style="font-size: 40px;">JMP and conditions/CMP</p>
<p>JMP -> rewrites the RIP to preferred address</p>
<p>JE -> jump when equal</p>
<p>JNE -> jump when not equal</p>
<p>JZ -> jump when last result was zero</p>
<p>JG -> jump when greater than</p>
<p>JGE -> jump when greater than or equal to</p>
<p>JL -> jump when less than</p>
<p>JLE -> jump when less than or equal to</p>
<p>CMP -> (brother of SUB) compares and changes ZF</p>
</section>
<section style="font-size: 20px;font-family: 'Press Start 2P', cursive; color: white;" data-background="14.jpg">
<p style="font-size: 60px;">DEMO TIME</p>
</section>
<section style="font-size: 20px;font-family: 'Press Start 2P', cursive; color: white;" data-background="15.jpg">
<p style="font-size: 60px;">f i n</p>
<p>Thank You! :D</p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script src="js/classie.js"></script>
<script src="js/modernizr.min.js"></script>
<script src="js/photostack.js"></script>
<script src="js/bookblock.min.js"></script>
<script src="js/jquery.min.js"></script>
<script>
var Page = (function() {
var config = {
$bookBlock : $( '#bb-bookblock' ),
$navNext : $( '#bb-nav-next' ),
$navPrev : $( '#bb-nav-prev' ),
$navFirst : $( '#bb-nav-first' ),
$navLast : $( '#bb-nav-last' )
},
init = function() {
config.$bookBlock.bookblock( {
speed : 800,
direction: 'rtl',
shadowSides : 0.8,
shadowFlip : 0.7
} );
initEvents();
},
initEvents = function() {
var $slides = config.$bookBlock.children();
// add navigation events
config.$navNext.on( 'click touchstart', function() {
config.$bookBlock.bookblock( 'next' );
return false;
} );
config.$navPrev.on( 'click touchstart', function() {
config.$bookBlock.bookblock( 'prev' );
return false;
} );
config.$navFirst.on( 'click touchstart', function() {
config.$bookBlock.bookblock( 'first' );
return false;
} );
config.$navLast.on( 'click touchstart', function() {
config.$bookBlock.bookblock( 'last' );
return false;
} );
// add swipe events
$slides.on( {
'swipeleft' : function( event ) {
config.$bookBlock.bookblock( 'prev' );
return false;
},
'swiperight' : function( event ) {
config.$bookBlock.bookblock( 'next' );
return false;
}
} );
// add keyboard events
$( document ).keydown( function(e) {
var keyCode = e.keyCode || e.which,
arrow = {
left : 37,
up : 38,
right : 39,
down : 40
};
switch (keyCode) {
case arrow.left:
config.$bookBlock.bookblock( 'next' );
break;
case arrow.right:
config.$bookBlock.bookblock( 'prev' );
break;
}
} );
};
return { init : init };
})();
</script>
<script>
Page.init();
</script>
<script>
if($("start").is(":focus")){
window.location='https://www.google.com/';
}
</script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'zoom', // none/fade/slide/convex/concave/zoom
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/search/search.js', async: true },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>