Hacking in C 2020 the C Programming Language Thom Wiggers

Hacking in C 2020 the C Programming Language Thom Wiggers

Hacking in C 2020 The C programming language Thom Wiggers 1 Table of Contents Introduction Undefined behaviour Abstracting away from bytes in memory Integer representations 2 Table of Contents Introduction Undefined behaviour Abstracting away from bytes in memory Integer representations 3 – Another predecessor is B. • Not one of the first programming languages: ALGOL for example is older. • Closely tied to the development of the Unix operating system • Unix and Linux are mostly written in C • Compilers are widely available for many, many, many platforms • Still in development: latest release of standard is C18. Popular versions are C99 and C11. • Many compilers implement extensions, leading to versions such as gnu18, gnu11. • Default version in GCC gnu11 The C programming language • Invented by Dennis Ritchie in 1972–1973 4 – Another predecessor is B. • Closely tied to the development of the Unix operating system • Unix and Linux are mostly written in C • Compilers are widely available for many, many, many platforms • Still in development: latest release of standard is C18. Popular versions are C99 and C11. • Many compilers implement extensions, leading to versions such as gnu18, gnu11. • Default version in GCC gnu11 The C programming language • Invented by Dennis Ritchie in 1972–1973 • Not one of the first programming languages: ALGOL for example is older. 4 • Closely tied to the development of the Unix operating system • Unix and Linux are mostly written in C • Compilers are widely available for many, many, many platforms • Still in development: latest release of standard is C18. Popular versions are C99 and C11. • Many compilers implement extensions, leading to versions such as gnu18, gnu11. • Default version in GCC gnu11 The C programming language • Invented by Dennis Ritchie in 1972–1973 • Not one of the first programming languages: ALGOL for example is older. – Another predecessor is B. 4 • Unix and Linux are mostly written in C • Compilers are widely available for many, many, many platforms • Still in development: latest release of standard is C18. Popular versions are C99 and C11. • Many compilers implement extensions, leading to versions such as gnu18, gnu11. • Default version in GCC gnu11 The C programming language • Invented by Dennis Ritchie in 1972–1973 • Not one of the first programming languages: ALGOL for example is older. – Another predecessor is B. • Closely tied to the development of the Unix operating system 4 • Compilers are widely available for many, many, many platforms • Still in development: latest release of standard is C18. Popular versions are C99 and C11. • Many compilers implement extensions, leading to versions such as gnu18, gnu11. • Default version in GCC gnu11 The C programming language • Invented by Dennis Ritchie in 1972–1973 • Not one of the first programming languages: ALGOL for example is older. – Another predecessor is B. • Closely tied to the development of the Unix operating system • Unix and Linux are mostly written in C 4 • Still in development: latest release of standard is C18. Popular versions are C99 and C11. • Many compilers implement extensions, leading to versions such as gnu18, gnu11. • Default version in GCC gnu11 The C programming language • Invented by Dennis Ritchie in 1972–1973 • Not one of the first programming languages: ALGOL for example is older. – Another predecessor is B. • Closely tied to the development of the Unix operating system • Unix and Linux are mostly written in C • Compilers are widely available for many, many, many platforms 4 • Many compilers implement extensions, leading to versions such as gnu18, gnu11. • Default version in GCC gnu11 The C programming language • Invented by Dennis Ritchie in 1972–1973 • Not one of the first programming languages: ALGOL for example is older. – Another predecessor is B. • Closely tied to the development of the Unix operating system • Unix and Linux are mostly written in C • Compilers are widely available for many, many, many platforms • Still in development: latest release of standard is C18. Popular versions are C99 and C11. 4 • Default version in GCC gnu11 The C programming language • Invented by Dennis Ritchie in 1972–1973 • Not one of the first programming languages: ALGOL for example is older. – Another predecessor is B. • Closely tied to the development of the Unix operating system • Unix and Linux are mostly written in C • Compilers are widely available for many, many, many platforms • Still in development: latest release of standard is C18. Popular versions are C99 and C11. • Many compilers implement extensions, leading to versions such as gnu18, gnu11. 4 The C programming language • Invented by Dennis Ritchie in 1972–1973 • Not one of the first programming languages: ALGOL for example is older. – Another predecessor is B. • Closely tied to the development of the Unix operating system • Unix and Linux are mostly written in C • Compilers are widely available for many, many, many platforms • Still in development: latest release of standard is C18. Popular versions are C99 and C11. • Many compilers implement extensions, leading to versions such as gnu18, gnu11. • Default version in GCC gnu11 4 – Almost no abstraction – Full control – No types, no bounds checking: everything is just bytes to the CPU – Direct access to CPU and memory – Choice of instructions, register allocation left to programmer – Need to do everything from scratch for different CPUs – If a microarchitecture is released with new features, may need to re-implement parts of the code • Unix is an operating system: main job is managing hardware • C was used to replace the assembly code and implement new sofware for Unix • Writing code in assembly: Programming for hardware • Initially C was co-developed with Unix 5 – Almost no abstraction – Full control – No types, no bounds checking: everything is just bytes to the CPU – Direct access to CPU and memory – Choice of instructions, register allocation left to programmer – Need to do everything from scratch for different CPUs – If a microarchitecture is released with new features, may need to re-implement parts of the code • C was used to replace the assembly code and implement new sofware for Unix • Writing code in assembly: Programming for hardware • Initially C was co-developed with Unix • Unix is an operating system: main job is managing hardware 5 – Almost no abstraction – Full control – No types, no bounds checking: everything is just bytes to the CPU – Direct access to CPU and memory – Choice of instructions, register allocation left to programmer – Need to do everything from scratch for different CPUs – If a microarchitecture is released with new features, may need to re-implement parts of the code • Writing code in assembly: Programming for hardware • Initially C was co-developed with Unix • Unix is an operating system: main job is managing hardware • C was used to replace the assembly code and implement new sofware for Unix 5 – Almost no abstraction – Full control – No types, no bounds checking: everything is just bytes to the CPU – Direct access to CPU and memory – Choice of instructions, register allocation left to programmer – Need to do everything from scratch for different CPUs – If a microarchitecture is released with new features, may need to re-implement parts of the code Programming for hardware • Initially C was co-developed with Unix • Unix is an operating system: main job is managing hardware • C was used to replace the assembly code and implement new sofware for Unix • Writing code in assembly: 5 – Full control – No types, no bounds checking: everything is just bytes to the CPU – Direct access to CPU and memory – Choice of instructions, register allocation left to programmer – Need to do everything from scratch for different CPUs – If a microarchitecture is released with new features, may need to re-implement parts of the code Programming for hardware • Initially C was co-developed with Unix • Unix is an operating system: main job is managing hardware • C was used to replace the assembly code and implement new sofware for Unix • Writing code in assembly: – Almost no abstraction 5 – No types, no bounds checking: everything is just bytes to the CPU – Direct access to CPU and memory – Choice of instructions, register allocation left to programmer – Need to do everything from scratch for different CPUs – If a microarchitecture is released with new features, may need to re-implement parts of the code Programming for hardware • Initially C was co-developed with Unix • Unix is an operating system: main job is managing hardware • C was used to replace the assembly code and implement new sofware for Unix • Writing code in assembly: – Almost no abstraction – Full control 5 – Direct access to CPU and memory – Choice of instructions, register allocation left to programmer – Need to do everything from scratch for different CPUs – If a microarchitecture is released with new features, may need to re-implement parts of the code Programming for hardware • Initially C was co-developed with Unix • Unix is an operating system: main job is managing hardware • C was used to replace the assembly code and implement new sofware for Unix • Writing code in assembly: – Almost no abstraction – Full control – No types, no bounds checking: everything is just bytes to the CPU 5 – Choice of instructions, register allocation left to programmer – Need to do everything from scratch for different CPUs – If a microarchitecture is released with new features, may need to re-implement parts of the code Programming for hardware • Initially

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    159 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us