-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.tex
100 lines (87 loc) · 3.05 KB
/
macros.tex
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
% vim macros and mappings
% :let @x='0xyyu@"j'
%j6@x
%:map <F12> :wa<CR>:!hitex.pl TEMPLATE<CR><CR>
%:map <F11> :wa<CR>:!hitex.pl -a TEMPLATE<CR><CR>
%:map <F10> :!xpdf -remote latex TEMPLATE.pdf &> /dev/null &<CR><CR>
%:map <F9> :!evince TEMPLATE.pdf &> /dev/null &<CR><CR>
%:imap <F11> <Esc>:wa<CR>:!hitex.pl -a TEMPLATE<CR><CR>a
%:imap <F12> <Esc>:wa<CR>:!hitex.pl TEMPLATE<CR><CR>a
% some useful macros
\newcommand{\ignore}[1]{}
\newcommand{\lto}{\ensuremath{\leadsto}}
\newcommand{\lvsp}{\ \\[7mm]}
\newcommand{\nl}{\ \\}
\newcommand{\nvsp}{\vspace{-3ex}}
\newcommand{\see}[1]{($\to$\,\ref{#1})}
\newcommand{\svsp}{\ \\[2mm]}
\newcommand{\tab}{\rule{2em}{0pt}}
\newcommand{\todo}{\textbf{\textcolor{cyan}{TODO}}}
\newcommand{\vsp}{\ \\[5mm]}
\newenvironment{asm}{\begin{tabbing}tabs\=mnemonic\=\kill\ttfamily}{\end{tabbing}}
% function-/program-/library names and code snippets
\newcommand{\pgm}[1]{\texttt{#1}}
\newcommand{\ccr}{\pgm{CR}}
\newcommand{\clf}{\pgm{LF}}
\newcommand{\cnull}{\pgm{'\textbackslash0'}}
\newcommand{\eof}{\pgm{EOF}}
\newcommand{\gcc}{\pgm{gcc}}
\newcommand{\gdb}{\pgm{gdb}}
\newcommand{\cgets}{\pgm{gets}}
\newcommand{\libc}{\pgm{libc}}
\newcommand{\ofp}{\pgm{-fomit-frame-pointer}}
\newcommand{\readlower}{\pgm{read\_lower}}
\newcommand{\ropc}{\pgm{ropc}}
\newcommand{\ropgadget}{\pgm{ROPgadget}}
\newcommand{\system}{\pgm{system()}}
\newcommand{\add}{\pgm{add}}
\newcommand{\call}{\pgm{call}}
\newcommand{\enter}{\pgm{enter}}
\newcommand{\leave}{\pgm{leave}}
\newcommand{\mov}{\pgm{mov}}
\newcommand{\movl}{\pgm{movl}}
\newcommand{\nop}{\pgm{nop}}
\newcommand{\ret}{\pgm{ret}}
\newcommand{\sub}{\pgm{sub}}
\newcommand{\pop}{\pgm{pop}}
\newcommand{\push}{\pgm{push}}
\newcommand{\eax}{\pgm{\%eax}}
\newcommand{\ebx}{\pgm{\%ebx}}
\newcommand{\ecx}{\pgm{\%ecx}}
\newcommand{\edx}{\pgm{\%edx}}
\newcommand{\esi}{\pgm{\%esi}}
\newcommand{\edi}{\pgm{\%edi}}
\newcommand{\ebp}{\pgm{\%ebp}}
\newcommand{\esp}{\pgm{\%esp}}
\newcommand{\eip}{\pgm{\%eip}}
\newcommand{\efl}{\pgm{\%eflags}}
% other names
\newcommand{\name}[1]{\textsl{#1}}
\newcommand{\arm}{\name{ARM}}
\newcommand{\aslr}{\name{Address Space Layout Randomization}}
\newcommand{\bpa}{\name{base pointer addressing}}
\newcommand{\cdecl}{\name{cdecl}}
\newcommand{\cfi}{\name{CFI}}
\newcommand{\ia}{\name{IA-32}}
\newcommand{\morris}{\name{Morris worm}}
\newcommand{\payload}{\name{payload}}
\newcommand{\pax}{\name{PaX}}
\newcommand{\pie}{\name{Position Independent Executable}}
\newcommand{\ropeme}{\name{ROPEME}}
\newcommand{\ropdefender}{\name{ROPdefender}}
\newcommand{\sguard}{\name{StackGuard}}
\newcommand{\shellcode}{\name{shellcode}}
\newcommand{\sparc}{\name{SPARC}}
\newcommand{\truss}{\name{TRUSS}}
\newcommand{\wx}{\name{W$\oplus$X}}
\newcommand{\xes}{\name{x86}}
% common terms
\newcommand{\att}{AT\&T}
\newcommand{\bo}{buffer overflow}
\newcommand{\canaries}{stack canaries}
\newcommand{\cfg}{control flow graph}
\newcommand{\rtl}{return-to-\libc}
\newcommand{\ro}{return-oriented}
\newcommand{\roe}{return-oriented exploitation}
\newcommand{\rop}{return-oriented programming}
\newcommand{\shadow}{shadow stack}