وبلاگ بلیان

Reverse Engineering for Beginners

معرفی کتاب «Reverse Engineering for Beginners» نوشتهٔ Dennis Yurichev، منتشرشده توسط نشر 0. این کتاب در 91 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است. «Reverse Engineering for Beginners» در دستهٔ بدون دسته‌بندی قرار دارد.

A short introduction to the CPU......Page 21 Numeral Systems......Page 22 Converting From One Radix To Another......Page 23 x86......Page 25 Empty Functions in Practice......Page 26 ARM......Page 27 x86......Page 28 x86-64......Page 34 ARM......Page 38 MIPS......Page 44 Conclusion......Page 48 Returning Values: redux......Page 49 Why does the stack grow backwards?......Page 50 What is the stack used for?......Page 51 Noise in stack......Page 57 Almost empty function......Page 62 x86......Page 63 ARM......Page 74 MIPS......Page 80 Conclusion......Page 86 Simple example......Page 87 The classic mistake......Page 96 Global variables......Page 97 scanf()......Page 106 Worth noting: global vs. local variables......Page 117 x86......Page 118 x64......Page 120 ARM......Page 123 MIPS......Page 126 Attempt to use the result of a function returning void......Page 127 What if we do not use the function result?......Page 128 Returning a structure......Page 129 Returning values......Page 130 Swap input values......Page 139 GOTO operator......Page 140 Dead code......Page 143 Simple example......Page 144 Calculating absolute value......Page 161 Ternary conditional operator......Page 163 Getting minimal and maximal values......Page 166 Conclusion......Page 170 Software cracking......Page 172 Small number of cases......Page 174 A lot of cases......Page 187 When there are several case statements in one block......Page 199 Fall-through......Page 203 Simple example......Page 204 Memory blocks copying routine......Page 215 Condition check......Page 218 Conclusion......Page 219 Exercises......Page 220 strlen()......Page 221 Multiplication......Page 232 Division......Page 237 x86......Page 238 Simple example......Page 239 Passing floating point numbers via arguments......Page 249 Comparison example......Page 251 Exercises......Page 285 Simple example......Page 286 Buffer overflow......Page 293 Buffer overflow protection methods......Page 301 One more word about arrays......Page 304 Array of pointers to strings......Page 305 Multidimensional arrays......Page 312 Pack of strings as a two-dimensional array......Page 319 Example: a bug in Angband......Page 323 Specific bit checking......Page 325 Setting and clearing specific bits......Page 329 Setting and clearing specific bits: FPU example......Page 338 Counting bits set to 1......Page 342 Conclusion......Page 357 Linear congruential generator......Page 359 x86......Page 360 32-bit ARM......Page 361 MIPS......Page 362 MSVC: SYSTEMTIME example......Page 364 Let's allocate space for a structure using malloc()......Page 368 UNIX: struct tm......Page 369 Fields packing in structure......Page 379 Nested structures......Page 386 Bit fields in a structure......Page 389 The classic struct bug......Page 396 Pseudo-random number generator example......Page 397 Calculating machine epsilon......Page 400 FSCALE instruction replacement......Page 402 Fast square root calculation......Page 403 Pointers to functions......Page 404 MSVC......Page 405 GCC......Page 411 Returning of 64-bit value......Page 415 Arguments passing, addition, subtraction......Page 416 Multiplication, division......Page 419 Shifting right......Page 423 Converting 32-bit value into 64-bit one......Page 424 LARGE_INTEGER structure case......Page 425 Vectorization......Page 428 SIMD strlen() implementation......Page 438 x86-64......Page 441 Simple example......Page 448 Passing floating point number via arguments......Page 456 Comparison example......Page 457 Calculating machine epsilon: x64 and SIMD......Page 458 Summary......Page 459 Addressing modes......Page 460 Loading a constant into a register......Page 461 Relocs in ARM64......Page 463 Loading a 32-bit constant into register......Page 464 Further reading about MIPS......Page 466 Nibble AKA nybble......Page 467 Byte......Page 468 Word......Page 469 Address register......Page 470 Numbers......Page 471 Signed number representations......Page 472 Couple of additions about two's complement form......Page 474 Integer overflow......Page 475 KOI-8R Cyrillic encoding......Page 477 ZX Spectrum ROM text strings......Page 478 XOR swap algorithm......Page 481 XOR linked list......Page 482 Zobrist hashing / tabulation hashing......Page 483 Endianness......Page 484 Bi-endian......Page 485 Data dependencies......Page 486 How do one-way functions work?......Page 487 Double negation......Page 488 const correctness......Page 489 Overlapping const strings......Page 490 Temperature converting......Page 491 Integer values......Page 492 Floating-point values......Page 494 Example #1......Page 496 Example #2......Page 499 Summary......Page 502 CRC32 calculation example......Page 503 Network address calculation example......Page 505 form_IP()......Page 507 print_as_IP()......Page 509 form_netmask() and set_bit()......Page 510 Three iterators......Page 511 Two iterators......Page 512 Intel C++ 2011 case......Page 514 Duff's device......Page 515 Division using multiplication......Page 517 x86......Page 518 ARM......Page 519 MIPS......Page 520 Simple example......Page 521 A slightly advanced example......Page 524 Inline functions......Page 527 Strings and memory functions......Page 528 C99 restrict......Page 536 Optimizing GCC 4.9.1 x64......Page 538 Computing arithmetic mean......Page 539 vprintf() function case......Page 543 Format string exploit......Page 544 Strings trimming......Page 545 x64: Optimizing MSVC 2013......Page 546 x64: Non-optimizing GCC 4.9.1......Page 548 x64: Optimizing GCC 4.9.1......Page 549 ARM64: Non-optimizing GCC (Linaro) 4.9......Page 550 ARM: Optimizing Keil 6/2013 (ARM mode)......Page 551 ARM: Optimizing Keil 6/2013 (Thumb mode)......Page 552 MIPS......Page 553 x64......Page 554 ARM......Page 556 Using bit operations......Page 557 Text strings......Page 558 Executable code......Page 559 Virtual machine / pseudo-code......Page 560 Classes......Page 561 ostream......Page 577 References......Page 578 STL......Page 579 Memory......Page 612 Arrays started at 1......Page 613 Working with addresses instead of pointers......Page 616 Pointers abuse in Windows kernel......Page 619 Null pointers......Page 624 Array as function argument......Page 628 Pointer to a function......Page 629 Pointer to a function: copy protection......Page 630 Pointer as object identificator......Page 631 Oracle RDBMS and a simple garbage collector for C/C++......Page 632 Weird loop optimization......Page 633 Another loop optimization......Page 634 Sometimes a C structure can be used instead of array......Page 636 Unsized array in C structure......Page 637 Version of C structure......Page 638 High-score file in "Block out" game and primitive serialization......Page 640 memmove() and memcpy()......Page 644 Anti-debugging trick......Page 645 setjmp/longjmp......Page 646 Accessing arguments/local variables of caller......Page 648 Returning string......Page 650 OpenMP......Page 651 MSVC......Page 653 GCC......Page 655 Another heisenbug......Page 657 The case of forgotten return......Page 658 Homework: more about function pointers and unions......Page 662 Example #2......Page 663 Example #3......Page 664 Example #4......Page 665 Example #5......Page 667 Example #6......Page 671 Returning a value......Page 674 Simple calculating functions......Page 679 JVM memory model......Page 682 Simple function calling......Page 683 Calling beep()......Page 684 Linear congruential PRNG......Page 685 Conditional jumps......Page 686 Passing arguments......Page 688 Bitfields......Page 689 Loops......Page 691 switch()......Page 692 Arrays......Page 693 Strings......Page 702 Exceptions......Page 704 Classes......Page 707 Simple patching......Page 709 Summary......Page 714 Microsoft Visual C++......Page 715 Watcom, OpenWatcom......Page 716 Borland......Page 717 Communication with the outer world (win32)......Page 718 tracer: Intercepting all functions in specific module......Page 719 Text strings......Page 720 Finding strings in binary......Page 724 Error/debug messages......Page 725 Calls to assert()......Page 726 Magic numbers......Page 727 Finding the right instructions......Page 729 Hand-written assembly code......Page 731 Using magic numbers while tracing......Page 732 Some binary file patterns......Page 733 Memory "snapshots" comparing......Page 740 Incorrectly disassembled code......Page 742 Crash on purpose......Page 747 stdcall......Page 748 fastcall......Page 749 thiscall......Page 750 x86-64......Page 751 Return values of float and double type......Page 753 Taking a pointer to function argument......Page 754 Thread Local Storage......Page 756 Linear congruential generator revisited......Page 757 System calls (syscall-s)......Page 761 Position-independent code......Page 762 LD_PRELOAD hack in Linux......Page 765 CRT (win32)......Page 767 Win32 PE......Page 771 Windows SEH......Page 779 Windows NT: Critical section......Page 802 Disassemblers......Page 804 System calls tracing......Page 805 Calculators......Page 806 Do You Think Something Is Missing Here?......Page 807 Task manager practical joke (Windows Vista)......Page 808 Using LEA to load values......Page 811 Color Lines game practical joke......Page 813 Minesweeper (Windows XP)......Page 816 Finding grid automatically......Page 821 Hacking Windows clock......Page 822 Example #1: MacOS Classic and PowerPC......Page 829 Example #2: SCO OpenServer......Page 836 Example #3: MS-DOS......Page 846 Base64 and entropy......Page 851 Is data compressed?......Page 853 Is data encrypted?......Page 854 CryptoPP......Page 855 Cipher Feedback mode......Page 857 Structure of the buffer......Page 859 Noise at the end......Page 861 Overclocking Cointerra Bitcoin miner......Page 862 Breaking simple executable cryptor......Page 867 About SAP client network traffic compression......Page 872 SAP 6.0 password checking functions......Page 883 V$VERSION table in the Oracle RDBMS......Page 887 X$KSMLRU table in Oracle RDBMS......Page 894 V$TIMER table in Oracle RDBMS......Page 896 EICAR test file......Page 900 10 PRINT CHR$(205.5+RND(1)); : GOTO 10......Page 901 Mandelbrot set......Page 904 Other examples......Page 914 Simplest ever XOR encryption......Page 915 Norton Guide: simplest possible 1-byte XOR encryption......Page 917 Simplest possible 4-byte XOR encryption......Page 920 Simple encryption using XOR mask......Page 924 Simple encryption using XOR mask, case II......Page 931 Homework......Page 936 Analyzing entropy in Mathematica......Page 937 Tools......Page 946 Entropy of various files......Page 947 Millenium game save file......Page 949 fortune program indexing file......Page 956 Hacking......Page 960 Oracle RDBMS: .SYM-files......Page 961 Oracle RDBMS: .MSB-files......Page 971 Further reading......Page 978 Using PIN DBI for XOR interception......Page 979 Intercepting all rand() calls......Page 982 Replacing rand() calls with our function......Page 983 Peeking into placement of mines......Page 984 Why ``instrumentation''?......Page 986 x86 code......Page 987 Compiler intrinsic......Page 988 MSVC 6.0......Page 989 Itanium......Page 990 8086 memory model......Page 992 Profile-guided optimization......Page 993 Bugs......Page 994 Odd peculiarities......Page 996 Silence......Page 998 Comma......Page 999 Summary......Page 1000 C/C++......Page 1001 Programming in general......Page 1002 Cryptography......Page 1003 Communities......Page 1004 Afterword......Page 1005 Questions?......Page 1006 Appendix......Page 1007 General purpose registers......Page 1008 FPU registers......Page 1012 Debugging registers......Page 1014 Instructions......Page 1015 npad......Page 1027 32-bit ARM (AArch32)......Page 1029 Instructions......Page 1030 Registers......Page 1031 IDA......Page 1032 GCC......Page 1033 GDB......Page 1034 Acronyms Used......Page 1035 Glossary......Page 1041 Index......Page 1043
دانلود کتاب Reverse Engineering for Beginners