forked from wangyif2/RE-for-beginners
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tex
executable file
·230 lines (184 loc) · 5.8 KB
/
main.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
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
\ifdefined\ebook
\documentclass[a5paper,oneside]{book}
\newcommand{\FigScale}{0.4}
\else
\documentclass[a4paper,oneside]{book}
\newcommand{\FigScale}{0.66} % FIXME
\fi
\usepackage{cmap}
\usepackage{fancyhdr}
\ifdefined\RUSSIAN
\usepackage[english,russian]{babel}
\else
\usepackage[english]{babel}
\fi
\usepackage{inputenc}
\usepackage{listings}
\usepackage{ulem}
\usepackage{url}
\usepackage{graphicx}
\usepackage{makeidx}
\usepackage[backend=biber,style=alphabetic]{biblatex}
%\usepackage{cite}
\usepackage[cm]{fullpage}
\usepackage{color}
\usepackage{fancyvrb}
\usepackage{xspace}
\usepackage{float}
\usepackage{tabularx}
\usepackage{framed}
\usepackage{fontspec}
% fonts
\setmonofont{Droid Sans Mono}
\setmainfont[Ligatures=TeX]{PT Sans}
\usepackage{epigraph}
\usepackage{ccicons}
\usepackage[nottoc]{tocbibind}
\usepackage{longtable}
\usepackage[footnote,printonlyused,withpage]{acronym}
\usepackage[table]{xcolor}% http://ctan.org/pkg/xcolor
\usepackage[]{bookmark,hyperref} % must be last
\usepackage{glossaries}
\usepackage{tikz}
%\usepackage{fixltx2e}
\usepackage{bytefield}
\usepackage{amsmath}
\usepackage{MnSymbol}
\undef\mathdollar
\usepackage{shorttoc}
\usetikzlibrary{calc,positioning,chains,arrows}
\ifdefined\ebook
\usepackage[margin=0.5in]{geometry}
\fi
\ifdefined\RUSSIAN
\renewcommand\lstlistingname{Листинг}
\renewcommand\lstlistlistingname{Листинг}
\fi
% fancyhdr
\makeatletter
\let\stdchapter\chapter
\renewcommand*\chapter{%
\@ifstar{\starchapter}{\@dblarg\nostarchapter}}
\newcommand*\starchapter[1]{%
\stdchapter*{#1}
\thispagestyle{fancy}
\markboth{\MakeUppercase{#1}}{}
}
\def\nostarchapter[#1]#2{%
\stdchapter[{#1}]{#2}
\thispagestyle{fancy}
}
\makeatother
\newcommand{\footnoteref}[1]{\textsuperscript{\ref{#1}}}
\definecolor{lstbgcolor}{rgb}{0.94,0.94,0.94}
\makeindex
\include{macros}
\include{glossary}
\include{common_URLS}
\include{common_phrases}
\makeglossaries
\newcommand{\TITLE}{\RU{Reverse Engineering для начинающих}
\EN{Reverse Engineering for Beginners}}
\newcommand{\AUTHOR}{\RU{Денис Юричев}\EN{Dennis Yurichev}}
\newcommand{\EMAIL}{[email protected]}
\hypersetup{
pdftex,
colorlinks=true,
allcolors=blue,
pdfauthor={\AUTHOR},
pdftitle={\TITLE}
}
\lstset{
backgroundcolor=\color{lstbgcolor},
basicstyle=\ttfamily\small,
breaklines=true,
prebreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\rhookswarrow}},
postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}},
frame=single,
columns=fullflexible,keepspaces,
inputencoding=utf8
}
\DeclareMathSizes{12}{30}{16}{12}
\bibliography{C_book_\LANG,books,articles,usenet,misc}
\begin{document}
%\setlength{\headheight}{15.2pt}
\setlength{\headheight}{20pt}
\pagestyle{fancy}
\VerbatimFootnotes
\frontmatter
\begin{titlepage}
\input{praise}
\cleardoublepage
\ifdefined\ebook % FIXME
\else
%\input{cover}
%\newpage
\fi
\begin{center}
\vspace*{\fill}
\LARGE \TITLE
\vspace*{\fill}
\large \AUTHOR
\large \TT{<\EMAIL>}
\vspace*{\fill}
\vfill
\ccbyncnd
\textcopyright 2013-2014, \AUTHOR.
\RU{Это произведение доступно по лицензии Creative Commons «Attribution-NonCommercial-NoDerivs»
(«Атрибуция — Некоммерческое использование — Без производных произведений») 3.0 Непортированная.
Чтобы увидеть копию этой лицензии, посетите}
\EN{This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
To view a copy of this license, visit} \url{http://creativecommons.org/licenses/by-nc-nd/3.0/}.
\RU{Версия этого текста}\EN{Text version} ({\large \today}).
\RU{Возможно, более новая версии текста, а также англоязычная версия, также доступна по ссылке}
\EN{There is probably a newer version of this text, and Russian language version also accessible at}
\url{http://beginners.re}.
\ifdefined\ebook
\RU{Версия формата A4 так же доступна по ссылке}
\EN{A4-format version is also available on the page}.
\else
\RU{Версия для электронных читалок так же доступна по ссылке}
\EN{E-book reader version is also available on the page}.
\fi
\RU{Вы также можете подписаться на мой twitter для получения информации о новых версиях этого текста,
и т.д: \TT{@yurichev\_ru}\footnote{\url{https://twitter.com/yurichev_ru}},
либо подписаться на список рассылки}
\EN{You may also subscribe to my twitter, to get information about updates of this text, etc:
\TT{@yurichev}\footnote{\url{https://twitter.com/yurichev}}, or to subscribe to mailing list}
\footnote{\url{http://yurichev.com/mailing_lists.html}}.
\end{center}
\end{titlepage}
\include{please_donate}
\shorttoc{\RU{Краткое оглавление}\EN{Short contents}}{-1} % Only sections
\tableofcontents
\cleardoublepage
\cleardoublepage
\include{preface}
\mainmatter
% only chapters here!
\include{patterns/main}
\include{fundamentals/main}
\include{digging_into_code/main}
\include{OS/main}
\include{tools}
\include{examples/examples}
\include{ff/main}
\include{other/main}
\include{reading}
\include{exercises/main}
\include{afterword}
\include{appendix/appendix}
\include{acronyms}
\bookmarksetup{startatroot}
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{\RU{Глоссарий}\EN{Glossary}}
\printglossaries
\clearpage
\phantomsection
\printindex
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{\RU{Библиография}\EN{Bibliography}}
\printbibliography
\end{document}