1 / 45

Introductions Name Where from Something non-academic What's the point of this class?

Introductions Name Where from Something non-academic What's the point of this class? Not history, but not all cutting edge Awesome! We get to learn a lot! Bummer – we have to learn a lot . Class webpage Syllabus use of moodle email . Labs When due Partners How independent

denna
Download Presentation

Introductions Name Where from Something non-academic What's the point of this class?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introductions • Name • Where from • Something non-academic • What's the point of this class? • Not history, but not all cutting edge • Awesome! We get to learn a lot! • Bummer – we have to learn a lot. • Class webpage • Syllabus • use of moodle • email

  2. Labs • When due • Partners • How independent • Learning C • vs. Projects – may have more than in past • Reading • Our textbook • Before/after lecture • Questions at beginning of class • Active Learning

  3. C • Why is C special / different / awesome / horrible? • How does the hello world code turn into a program? • Source program (human) -> preprocessor • modified source program (human) -> compiler • assembly program (assembly) -> assembler • relocatable object programs (binary) -> linker • executable object program (binary)

  4. printf.o Pre- processor (cpp) Compiler (cc1) Assembler (as) Linker (ld) hello.c hello.i hello.s hello.o hello Source program (text) Assembly program (text) Modified source program (text) Relocatable object programs (binary) Executable object program (binary)

  5. printf.o Pre- processor (cpp) Compiler (cc1) Assembler (as) Linker (ld) hello.c hello.i hello.s hello.o hello Source program (text) Assembly program (text) Modified source program (text) Relocatable object programs (binary) Executable object program (binary) g++ helloWorld.c -ohelloWorld ./helloWorld

  6. How does the hello world program execute? • disk  memory  register • display device

  7. Memory hierarchy • Virtual addresses, heap/stack, files

  8. Linux What is it? How it fits into the class….

  9. Woo! • Done with chapter 1! • Only about 8 chapters to go!

  10. Overflow • Number

  11. Overflow • Number • Buffer • Smashing the stack for fun and profit • Phrak 49 • Generally from strcpy(), strcat(), and sprintf() • Overflow fixed size buffer with machine code

  12. Bits

  13. Bits • 101 • 5 in binary • 5 if it’s an integer • +∞ if float • 0x101 = 65 in dec • A if it’s hex referring to ASCII

  14. Bits + Context • Integer • Float • Character • Program instruction • Memory Address • Bytes • Trivia: Nibble/Nybble

  15. Background: Hexadecimal • 0xA4 • 10100100 (binary) • 164 (decimal)

  16. Take out some paper… • Convert 0x173A4C to binary • Convert 11 1100 1010 1101 1011 00112 to hex • Convert 7AF16 to base-10 • Convert 6010 to base-16 • Convert 60010 to base-16

  17. Linux ps command? • http://www.cheatengine.org/

  18. Data Sizes

  19. Byte Ordering • Big Endian: Sun, PPC, ARM, PDP-10 • Most significant byte has highest address • Little Endian: x86, x86-64, VAX, PDP-11 • Least significant byte has lowest address

  20. Blame George Bool & Claude Shannon • And • Or • Not • Xor

  21. `

  22. Lab: give masking example • Lab: Tmin: smallest signed int

  23. Unsigned Signed (typically)

  24. Example program from lab1: ishow.c

  25. http://www.example.com/name%20with%20spaces/http://www.asciitable.com/http://www.example.com/name%20with%20spaces/http://www.asciitable.com/

  26. Ways of representing negatives?

  27. The Sacrificial Bit

  28. Max/Min Values (Assume using 32 bit architecture) • unsigned short int • Min • Max • signed short int • Max • Min

  29. = X x +16

More Related