\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{feststelltast3} \pdfinfo{ /Title (hacking.pdf) /Creator (Cheatography) /Author (feststelltast3) /Subject (Hacking Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{E04300} \definecolor{LightBackground}{HTML}{FDF3EF} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Hacking Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{feststelltast3} via \textcolor{DarkBackground}{\uline{cheatography.com/42140/cs/12727/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}feststelltast3 \\ \uline{cheatography.com/feststelltast3} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 6th September, 2017.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Debugging \& Co.}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{objdump}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `objdump` & Programm, um verschiedene Informationen\{\{nl\}\}über Objekt-Dateien anzuzeigen\{\{nl\}\}(auch Assemblercode). \tn % Row Count 7 (+ 6) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{~ `-D \textless{}datei\textgreater{}`} \tn % Row Count 8 (+ 1) % Row 3 \SetRowColor{white} ~ `-M \textless{}Syntax-Typ\textgreater{}` & Intel oder AT\&T Syntax verwenden \tn % Row Count 10 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{bt\}\}{\bf{GDB}}} \tn % Row Count 11 (+ 1) % Row 5 \SetRowColor{white} `gdb -q \textless{}Pfad zu Datei\textgreater{}` & Führt GNU-Debugger aus \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} `set args \textless{}arguments\textgreater{}` & Übergibt Argumente an das auszuführende Programm. \tn % Row Count 16 (+ 3) % Row 7 \SetRowColor{white} `list` & Quellcode anzeigen. \tn % Row Count 17 (+ 1) % Row 8 \SetRowColor{LightBackground} `disassemble \textless{}funktion\textgreater{}` & Disassemblierung einer Funktion. \tn % Row Count 19 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{{\bf{{\emph{GDB ausführen}}}}} \tn % Row Count 20 (+ 1) % Row 10 \SetRowColor{LightBackground} `run` & Programm in GDB starten. \tn % Row Count 22 (+ 2) % Row 11 \SetRowColor{white} `kill` & Killt das laufende Programm. \tn % Row Count 24 (+ 2) % Row 12 \SetRowColor{LightBackground} `quit` & GDB beenden. \tn % Row Count 25 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{{\bf{{\emph{Breakpoints}}}}} \tn % Row Count 26 (+ 1) % Row 14 \SetRowColor{LightBackground} `break \textless{}zeile\textgreater{}` & Stoppt bei Erreichen der genannten Zeile. \tn % Row Count 29 (+ 3) % Row 15 \SetRowColor{white} `break \textless{}funktion\textgreater{}` & Stoppt beim Erreichen der Funktion.\{\{nl\}\}(nur C) \tn % Row Count 32 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Debugging \& Co. (cont)}} \tn % Row 16 \SetRowColor{LightBackground} `break \textless{}datei:zeile\textgreater{}` & Stoppt bei Zeile in spezifischer Datei. \tn % Row Count 2 (+ 2) % Row 17 \SetRowColor{white} `delete \textless{}breakpoint \#\textgreater{}` & Entfernt einen Breakpoint. \tn % Row Count 4 (+ 2) % Row 18 \SetRowColor{LightBackground} `clear` & Entfernt alle Breakpoints. \tn % Row Count 6 (+ 2) % Row 19 \SetRowColor{white} `enable \textless{}breakpoint \#\textgreater{}` & Aktiviert deaktivierten Breakpoint. \tn % Row Count 8 (+ 2) % Row 20 \SetRowColor{LightBackground} `disable \textless{}breakpoint \#\textgreater{}` & Deaktiviert aktivieren Breakpoint. \tn % Row Count 10 (+ 2) % Row 21 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{{\bf{{\emph{Watchpoints}}}}} \tn % Row Count 11 (+ 1) % Row 22 \SetRowColor{LightBackground} `watch \textless{}zeile\textgreater{}` & Setze neuen Watchpoint bei Erreichen der genannten Zeile. \tn % Row Count 14 (+ 3) % Row 23 \SetRowColor{white} `watch \textless{}funktion\textgreater{}` & Setze neuen Watchpoint bei Erreichen der genannten Funktion. \tn % Row Count 17 (+ 3) % Row 24 \SetRowColor{LightBackground} `watch \textless{}datei:zeile\textgreater{}` & Setze neuen Watchpoint bei Erreichen der genannten Zeile in spezifischer Datei. \tn % Row Count 21 (+ 4) % Row 25 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{{\bf{{\emph{Stepping}}}}} \tn % Row Count 22 (+ 1) % Row 26 \SetRowColor{LightBackground} `continue` & Weiterlaufen lassen bis zum n{\"a}chsten\{\{nl\}\}Unterbruch. \tn % Row Count 25 (+ 3) % Row 27 \SetRowColor{white} `next` & Nur eine einzelne Zeile ausführen,\{\{nl\}\}in der aktuellen Ebene bleiben. \tn % Row Count 29 (+ 4) % Row 28 \SetRowColor{LightBackground} `step` & Führt die n{\"a}chste Linie aus,\{\{nl\}\}springt aber in aufgerufene Funktionen. \tn % Row Count 33 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Debugging \& Co. (cont)}} \tn % Row 29 \SetRowColor{LightBackground} `finish` & Beendet die Funktion und kehrt zum Aufrufer zurück. \tn % Row Count 3 (+ 3) % Row 30 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{{\bf{{\emph{Examine}}}}\{\{nl\}\}Untersuchung des Speichers} \tn % Row Count 4 (+ 1) % Row 31 \SetRowColor{LightBackground} `x/\textless{}n\textgreater{}\textless{}f\textgreater{}\textless{}u\textgreater{} addr` & `x: examine`\{\{nl\}\}`n`: Wiederholungen, `f`: Anzeigeformat,\{\{nl\}\}`u`: Einheitgr{\"o}{\ss}e (`nfu` optional)\{\{nl\}\}`addr: Adresse` \tn % Row Count 11 (+ 7) % Row 32 \SetRowColor{white} \textless{}f\textgreater{}`\{\{nl\}\}o\{\{nl\}\}x\{\{nl\}\}u\{\{nl\}\}t` & \{\{nl\}\}Oktale Darstellung\{\{nl\}\}Hexa. Darstellung\{\{nl\}\}Vorzeichenlose Darstellung\{\{nl\}\}Bin{\"a}re Darstellung \tn % Row Count 17 (+ 6) % Row 33 \SetRowColor{LightBackground} \textless{}u\textgreater{}`\{\{nl\}\}b\{\{nl\}\}h\{\{nl\}\}w\{\{nl\}\}g` & \{\{nl\}\}Einzelnes Byte\{\{nl\}\}Halbwort (2 Byte)\{\{nl\}\}Wort (4 Byte)\{\{nl\}\}Giant (8 Byte) \tn % Row Count 22 (+ 5) % Row 34 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{{\bf{{\emph{Informationen anzeigen}}}}} \tn % Row Count 23 (+ 1) % Row 35 \SetRowColor{LightBackground} `info registers` & Zeige Register bei aktuellem Breakpoint. \tn % Row Count 25 (+ 2) % Row 36 \SetRowColor{white} `info register \textless{}register\textgreater{}`\{\{nl\}\}kurz: `i r \textless{}register\textgreater{}` & Zeige Info zu spez. Register. \tn % Row Count 28 (+ 3) % Row 37 \SetRowColor{LightBackground} `info args` & Zeige Argumente der Funktion bei aktuellem Breakpoint. \tn % Row Count 31 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Debugging \& Co. (cont)}} \tn % Row 38 \SetRowColor{LightBackground} `info breakpoints` & Zeige Infos über Break- und Watchpoints. \tn % Row Count 3 (+ 3) % Row 39 \SetRowColor{white} `info threads` & Zeige alle Threads an. \tn % Row Count 5 (+ 2) % Row 40 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{{\emph{Einstellungen in GDB}}}}} \tn % Row Count 6 (+ 1) % Row 41 \SetRowColor{white} `set dis intel` & Disassembler-Syntax auf {\emph{intel}} {\"a}ndern. \tn % Row Count 8 (+ 2) % Row 42 \SetRowColor{LightBackground} `echo "set dis intel" \textgreater{} \textasciitilde{}/.gdbinit` & Speichere obige Einstellung dauerhaft. \tn % Row Count 10 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Assembler}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{Allgemeine Register}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}{\emph{Register sind für den Prozessor wie interne Variablen.\{\{nl\}\}Der Prozessor unterscheidet zwischen verschiedenen Arten von Registern.}}} \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} `eax` / `rax` & Akkumulator-Register\{\{nl\}\}\textasciicircum{}Allgemein verwendbar, spezielle Bedeutung bei Arithmetikfehlern.\textasciicircum{} \tn % Row Count 8 (+ 4) % Row 3 \SetRowColor{white} `ecx` / `rcx` & Z{\"a}hler-Register\{\{nl\}\}\textasciicircum{}Allgemein verwendbar, spezielle Bedeutung bei Schleifen.\textasciicircum{} \tn % Row Count 12 (+ 4) % Row 4 \SetRowColor{LightBackground} `edx` / `rdx` & Daten-Register\{\{nl\}\}\textasciicircum{}Allgemein verwendbar.\textasciicircum{} \tn % Row Count 14 (+ 2) % Row 5 \SetRowColor{white} `ebx` / `rbx` & Basis-Register\{\{nl\}\}\textasciicircum{}Allgemein verwendbar.\textasciicircum{} \tn % Row Count 16 (+ 2) % Row 6 \SetRowColor{LightBackground} `esp` / `rsp` & Stack Pointer \tn % Row Count 17 (+ 1) % Row 7 \SetRowColor{white} `ebp` / `rbp` & Base Pointer \tn % Row Count 18 (+ 1) % Row 8 \SetRowColor{LightBackground} `esi` / `rsi` & Source Index\{\{nl\}\}\textasciicircum{}Quelle für Stringoperationen.\textasciicircum{} \tn % Row Count 21 (+ 3) % Row 9 \SetRowColor{white} `edi` / `rdi` & Destination Index\{\{nl\}\}\textasciicircum{}Ziel für Stringoperationen.\textasciicircum{} \tn % Row Count 24 (+ 3) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{Segmentregister}}} \tn % Row Count 25 (+ 1) % Row 11 \SetRowColor{white} `cs` & Codesegment \tn % Row Count 26 (+ 1) % Row 12 \SetRowColor{LightBackground} `ds` & Datensegment \tn % Row Count 27 (+ 1) % Row 13 \SetRowColor{white} `ss` & Stacksegment \tn % Row Count 28 (+ 1) % Row 14 \SetRowColor{LightBackground} `es` & beliebiges Segment \tn % Row Count 29 (+ 1) % Row 15 \SetRowColor{white} `fs` & beliebiges Segment \tn % Row Count 30 (+ 1) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Assembler (cont)}} \tn % Row 16 \SetRowColor{LightBackground} `gs` & beliebiges Segment \tn % Row Count 1 (+ 1) % Row 17 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{{\bf{Sonstige Register}}} \tn % Row Count 2 (+ 1) % Row 18 \SetRowColor{LightBackground} `eip` / `rip` & Instruction Pointer\{\{nl\}\}\textasciicircum{}zeigt auf aktuelle Instruktion, die der Prozessor gerade verarbeitet.\textasciicircum{} \tn % Row Count 7 (+ 5) % Row 19 \SetRowColor{white} `ef` / `RFLAGS` & EFLAGS\{\{nl\}\}\textasciicircum{}Wird für Vergleiche und Speichersegmentierung verwendet.\textasciicircum{} \tn % Row Count 11 (+ 4) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{bt\}\}{\bf{Assembler Sprache}}\{\{nl\}\}in Intel-Syntax} \tn % Row Count 12 (+ 1) % Row 21 \SetRowColor{white} `operation \textless{}ziel\textgreater{}, \textless{}quelle\textgreater{}` & Format der Intel-Syntax \tn % Row Count 14 (+ 2) % Row 22 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{{\emph{Data Movement Instruktionen}}}}} \tn % Row Count 15 (+ 1) % Row 23 \SetRowColor{white} `mov` & bewegt Wert von Quelle ans Ziel. \tn % Row Count 17 (+ 2) % Row 24 \SetRowColor{LightBackground} `push` & setzt seinen Operanden oben auf den hardwaregestützten Stack im Speicher. \tn % Row Count 21 (+ 4) % Row 25 \SetRowColor{white} `pop` & entfernt das 4-Byte-Datenelement vom oberen Rand des hardwaregestützten Stacks in den angegebenen Operanden. \tn % Row Count 26 (+ 5) % Row 26 \SetRowColor{LightBackground} `lea` & setzt die durch seinen zweiten Operanden angegebene Adresse in das Register des ersten Operanden. \tn % Row Count 31 (+ 5) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Assembler (cont)}} \tn % Row 27 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{{\emph{Arithemtische und Logische Instruktionen}}}}} \tn % Row Count 1 (+ 1) % Row 28 \SetRowColor{white} `add` & addiert seine beiden Operanden zusammen und speichert das Ergebnis in seinem ersten Operanden. \tn % Row Count 6 (+ 5) % Row 29 \SetRowColor{LightBackground} `sub` & siehe `add`, nur mit Subtraktion. \tn % Row Count 8 (+ 2) % Row 30 \SetRowColor{white} `inc` & inkrementiert den Inhalt seines Operanden um eins. \tn % Row Count 11 (+ 3) % Row 31 \SetRowColor{LightBackground} `dec` & dekrementiert den Inhalt seines Operanden um eins. \tn % Row Count 14 (+ 3) % Row 32 \SetRowColor{white} `imul` & Integer Multiplikation \tn % Row Count 15 (+ 1) % Row 33 \SetRowColor{LightBackground} `idiv` & Integer Division \tn % Row Count 16 (+ 1) % Row 34 \SetRowColor{white} `and, or, xor` & Bitweise logisches UND, ODER \& EXKLUSIVES ODER \tn % Row Count 18 (+ 2) % Row 35 \SetRowColor{LightBackground} `not` & Bitweise logisches NOT \tn % Row Count 19 (+ 1) % Row 36 \SetRowColor{white} `neg` & Negieren \tn % Row Count 20 (+ 1) % Row 37 \SetRowColor{LightBackground} `shl, shr` & Bitshift nach links, Bitshift nach rechts. \tn % Row Count 22 (+ 2) % Row 38 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{{\bf{{\emph{Kontrollfluss-Instruktionen}}}}} \tn % Row Count 23 (+ 1) % Row 39 \SetRowColor{LightBackground} `jmp` & Sprung zu anderem Teil des Codes. \tn % Row Count 25 (+ 2) % Row 40 \SetRowColor{white} `j{[}kondition{]}` & Konditioneller Sprung\{\{nl\}\}Konditionen: `je, jne, jz, jg, jge, jl, jle` \tn % Row Count 29 (+ 4) % Row 41 \SetRowColor{LightBackground} `cmp` & Vergleich von Werten \tn % Row Count 30 (+ 1) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Assembler (cont)}} \tn % Row 42 \SetRowColor{LightBackground} `call, ret` & Diese Anweisungen implementieren einen Unterprogrammaufruf und -rückgabe. \tn % Row Count 4 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}