فریمهای پشته: نگاهی از درون
Stack Frames : A Look From Inside
معرفی کتاب «فریمهای پشته: نگاهی از درون» (با عنوان لاتین Stack Frames : A Look From Inside) نوشتهٔ Giuseppe Di Cataldo (auth.)، منتشرشده توسط نشر Apress : Imprint: Apress در سال 2016. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.
Teaches you exactly how program memory content and organization is vital for computer security, especially Unix-like operating systems. You will learn how it is manipulated to take control of a computer system, as well as the countermeasures that system designers set up to avoid this. Neither a guide for hackers nor an all-out theory book, this book is ideal for anyone studying computer security who wants to learn by doing. Using a practical approach, you will understand how stack frames relate to hardware and software theory and the various GNU/Linux distributions, before moving on to Base 2, 8 and 16 notations, executables and libraries. Lastly you will go in-depth to understand the intricacies of stack frames. A vital resource for all computer security students and enthusiasts, add __Stack Frames: A Look Inside__ to your library today. **What You Will Learn** * In-depth knowledge on activation records of functions, and how this information can be used. * A better understanding on how conventions used by compilers work. * Clarify some concepts on libraries and their relationship with executable programs. * Get, or recall, technical skills using compilers, debuggers, and other tools. **Who This Book Is For** The book is suitable for college students with a good knowledge of the C language, who are interested in deepening their study of the content and organization of program memory, namely the activation records of functions, as regards possible implications in computer security. A basic knowledge of both the Assembly language and the UNIX operating system is certainly helpful, as well as some practice with compilers and debuggers; but they are not compulsory. Contents at a Glance 5 Contents 6 About the Author 11 About the Technical Reviewer 12 Introduction 13 Chapter 1: Hardware and Software 15 Hardware 15 Software, Binary Programs, and Source Code 16 Binary and Text Files, Character Encodings 17 Character Encodings 17 The ASCII Character Set 18 Encoding Examples 20 Multibyte Encodings 20 Text Files 21 Binary Files 22 Executable Files 23 System and Application Software 25 Software Types: Free, Semifree, Proprietary 26 Free Software Definition and the Free Software Foundation Licenses 27 Debian Free Software Guidelines 28 BSD Licenses 28 Open Source Software 29 Public Domain Software 30 The Shared Source Initiative 31 Operating Systems and Kernels 31 Summary 32 Chapter 2: GNU/Linux Distributions 34 The GNU Project 34 What Is Linux? 35 The Birth of Linux 36 GNU/Linux Distributions and Packages 37 Classification 37 Installation Hints 38 Packages 39 A Brief History of Distributions 47 Testing Distributions 49 GNU/Linux Distribution Timeline 49 DistroWatch 49 LinuxCounter 49 Lwn.net 50 Virtualization 50 Summary 54 Chapter 3: Base 2, 8, and 16 Notations 55 Notations for Integer Numbers 55 Binary Numbers 56 Hexadecimal Numbers 58 Octal Numbers 58 Bytes 59 Words and Paragraphs 60 Bitwise Operators 60 Operators AND, XOR, OR, NOT 60 Bitwise vs Logical Operators in C 62 Shift Operators 63 Summary 64 Chapter 4: Executables and Libraries 65 Assemblers, Compilers, Linkers 65 The Assembler 65 The Compiler 66 The Linker 67 Object Files 68 The GNU Linker 71 Using the Linker with No Options 72 What If We Force main() to Be the Entry Point? 72 What If We Provide the Missing _start() Function? 73 Adding Code to Terminate the Program Execution 73 Why Terminating the Program Works 75 System and Wrapper Functions 75 Back to the Linker: Searching for Command-Line Arguments 77 Static and Dynamic Linking 79 Shared Libraries: GOT 82 A Simple Test Program 82 Where Are the Global Symbols? 83 How Global Variables Are Addressed 85 The Global Offset Table 87 The Relocation Constant 87 Section Attributes: Sharing Library Code 89 Searching for a Ghost 90 Shared Libraries: PLT 92 Summary 99 Chapter 5: Stack Frames 100 Call Stacks 100 Stack Frames 102 Calling Conventions 103 Naming Conventions 104 Example: Calling a Fortran Function with a C Function 105 Example: Calling an Assembly Function with a C Function 106 Function Calls 108 The Test Program 109 Function getSP 111 Function getBP 111 Function Dump 112 Function f 2 112 Function f1 113 Function main 113 Test on Debian (64-bit) 113 Test on Debian (64-bit): Stack Frame of f2() 115 Test on Debian (64-bit): Stack Frame of f1() 116 Test on Debian (64-bit): Stack Frame of main() 117 Test on Debian (64-bit): Assembly Code 118 The Prologue of a Function 124 The Epilogue of a Function 125 Variations in Prologues and Epilogues 125 Optimization Issues 126 Speeding Up Execution 127 Stack Pointer Alignment—an Exception 128 Test on Debian (64-bit): Calling and Naming Conventions 128 Test on Debian (64-bit): Stack Frame Charts 130 Test on Slackware (32-bit) 132 Test on Slackware (32-bit): Stack Frame of f2() 133 Test on Slackware (32-bit): Stack Frame of f1() 133 Test on Slackware (32-bit): Stack Frame of main() 134 Test on Slackware (32-bit): Assembly Code 134 Test on Slackware (32-bit): Code Optimization 135 Code Debugging 136 Correcting the Code 137 Examining the Output Data 138 Final Notes 139 Test on Slackware (32-bit): Calling and Naming Conventions 140 Test on Slackware (32-bit): Stack Frame Charts 140 Test on Debian (32-bit) 141 Test on Fedora (32-bit) 147 Test on Fedora (32-bit): Stack Frame of f2() 149 Test on Fedora (32-bit): Stack Frame of f1() 149 Test on Fedora (32-bit): Stack Frame of main() 150 Test on Fedora (32-bit): Calling and Naming Conventions 150 Test on openSUSE (64-bit) 151 Test on openSUSE (64-bit): Stack Frame of f2() 153 Test on openSUSE (64-bit): Stack Frame of f1() 153 Test on openSUSE (64-bit): Stack Frame of main() 154 Test on openSUSE (64-bit): Code Optimization 155 Test on openSUSE (64-bit): Calling and Naming Conventions 156 Other Tests 156 Applications 156 Changing the Parameters and Return Address of main() 157 Infinite Recursion 160 How to Change a Function’s Return Address 163 Shellcodes 164 First Try: a Simple Test Program 164 Writing a Working Shellcode 165 Improving the Shellcode 166 Buffer Overflow Attacks 169 Summary 176 Index 177 This book teaches you exactly how program memory content and organization is vital for computer security, especially Unix-like operating systems. You will learn how it is manipulated to take control of a computer system, as well as the countermeasures that system designers set up to avoid this. Neither a guide for hackers nor an all-out theory book, this book is ideal for anyone studying computer security who wants to learn by doing. Using a practical approach, you will understand how stack frames relate to hardware and software theory and the various GNU/Linux distributions, before moving on to Base 2, 8 and 16 notations, executables and libraries. Lastly you will go in-depth to understand the intricacies of stack frames. A vital resource for all computer security students and enthusiasts, add Stack Frames: A Look Inside to your library today "This book teaches you exactly how proram memory content and organization is vital for computer security, especially Unix-like operating systems. You will learn how it is manipulated to take control of a computer system, as well as the countermeasures that system designers set up to avoid this. Neither a guide for hackers nor an all-out theory book, this book is ideal for anyone studying computer security who wants to learn by doing."-- Provided by publisher Front Matter....Pages i-xviii Hardware and Software....Pages 1-19 GNU/Linux Distributions....Pages 21-41 Base 2, 8, and 16 Notations....Pages 43-52 Executables and Libraries....Pages 53-87 Stack Frames....Pages 89-165 Back Matter....Pages 167-171
دانلود کتاب فریمهای پشته: نگاهی از درون