C programs in (address) space and (run-)time. Systems Programming. C, assembler, and machine code. Where is my data and why do I have to know?

Size: px
Start display at page:

Download "C programs in (address) space and (run-)time. Systems Programming. C, assembler, and machine code. Where is my data and why do I have to know?"

Transcription

1 3 4 C programs in (address) space and (run-)time Systems Programming 02. C Programs in Space and Time Alexander Holupirek Database and Information Systems Group Department of Computer & Information Science University of Konstanz Summer Term 2008 Where is my data and why do I have to know? C is closely related to the machine. Before talking about pointers, storage allocation etc. some background knowledge about address space, (virtual) memory and its allocation during program execution comes in handy Knowledge about the memory layout of a program is quite helpful when debugging Knowledge about what is happening inside the machine on program execution is fundamental, to both, debugging programs and, in first place, writing clean code 1 C, assembler, and machine code 2 Repetition Computer Architecture Storage Classes From Source Code To Executable Code Construction of an Executable Relocation Process C-Quellcode int a, b; a = b * b; Intel ia32-assembler-quellcode mov 0x403030,%eax imul 0x403030,%eax mov %eax,0x Maschinenbefehle bzw. Prozessorinstruktionen ausführbarer Binärcode (hexadezimal dargestellt) 4012ee a1 4012ef f f f f3 0f 4012f4 af 4012f f f f f fa a3 4012fb fc fd fe 00 Adresse Inhalt (je 1 Byte)

2 7 8 C, assembler, and machine code Address Space C-Quellcode Ausführbarer Binärcode Assembler-Quellcode int a=4, b; int main(void) { if (a>5) b=1; else b=0; a liegt auf Adresse 0x b liegt auf Adresse 0x804958c Speicheradresse Speicherinhalt (=Maschinenbefehl) : 83 3d cmpl $0x5,0x b: 7e 0c jle d: c7 05 8c movl $0x1,0x804958c : : eb 0a jmp : c7 05 8c movl $0x0,0x804958c : : c9... Zahlenwerte in Binär- und Assemblercode sind alle hexadezimal zu verstehen Tiefstmögliche Adresse (»Speicherbeginn«) Startadresse des Datenblocks Letzte Byteadresse des Datenblocks Adresse des ersten Byte nach dem Datenblock Adressen einzelner Byte Höchstmögliche Adresse (»Speicherende«) Speicheradressen 0 0x x f 0x x x max. Speicherinhalte Datenblock 0x56 0xfc 16 Byte Größe des Datenblocks 5 6 Byte Ordering Alignment Rules Goal: Optimal Performance n Adressraum 0 max. Adr. Daten (4 Byte): Big-Endian-System Adr. n n+1 n+2 n+3 Inhalt d3 d2 d1 d0 MSB LSB d3 d2 d1 d0 MSB LSB Little-Endian-System Adr. n n+1 n+2 n+3 Inhalt Mit der Adresse n wird auf die 4 Byte großen Daten im Programm zugegriffen MSB = Most Significant Byte (höchstwertiges Byte) LSB = Least Significant Byte (niedrigstwertiges Byte) d0 d1 d2 d3 LSB MSB Determine the address locations for variables and instructions Great impact on compiler, assembler, linker tools Daten- Langwort (misaligned) Adressraum Adressen (hexadezimal) 0x35 0x36 0x37 0x38 Datenbus Adressoffsets (Byteadressen) +0 0x x x x37 0x38 0x39 0x3a 0x3b 1. Zugriff 2. Zugriff Langwortgrenzen auf dem Bus Langwortgrenzen (ohne Rest durch 4 teilbar) im Adressraum

3 Alignment Rules (cont.) For derived types 16 (constructed from the basic types) alignment rules apply to each single component: Repetition Computer Architecture struct artikel {char name[5]; int anzahl; double preis;; alignment(1) alignment(4) Storage Classes From Source Code To Executable Code Construction of an Executable Alignment rules may be influenced through compiler directives (-malign-int aligns variables on 32-bit boundaries producing code that runs somewhat faster on processors with 32-bit busses at the expense of memory) Relocation Process 16 arrays, functions, pointers, structures, unions (we will discuss them later) 9 10 Storage Classes Automatic Storage Class Placement of data in memory depends on storage class An object, such as a variable, is a location in storage, and its interpretation depends on two main attributes: its storage class and its type The storage class determines the lifetime of the storage associated with the identified object The types determines the meaning of the values found in the identified object. In C we have two storage classes: automatic and static Storage class specifiers (auto, extern, register, static) together with the context of an object s declaration, specify its storage class Automatic Objects auto and register give the declared objects automatic storage class, and may be used only within functions They are local to a block 17, discarded on exit from the block Declarations within a block create automatic objects if no storage class specification is mentioned or auto is used Initialization of automatic objects is performed each time the block is entered at the top (if a jump into the block is executed the initializations are not performed) Objects declared register are automatic, and are (if possible) stored in fast registers of the machine For register the address operator & is not allowed 17 aka compound statement, such as the body of a function 11 12

4 15 16 Static Storage Class Storage Class and Sections Static Objects May be local to a block or external to all blocks In both cases, they retain their values across exit from and reentry to functions and blocks Within a block, static objects are declared with static Objects declared outside of all blocks (at the same level as function definitions) are always static On the outer level, the keyword static makes them local to a particular translation unit (internal linkage) They are global to an entire program by omitting an explicit storage class, or by using extern (external linkage) Intermediate Summary A program executed does not only use storage for its instructions, but additionally needs space for, e.g., variables Variables may be temporary, dynamically allocated, or static (i.e., permanent in terms of storage allocation), initialized or uninitialized, declared as constant (const) and thus read-only Placement of data in memory depends on its storage class During the translation process the compiler uses sections to divide the address space into logical units Details vary with operating systems and compiler used Typical Program Organisation Program Sections A typical program divides naturally in sections Code machine instructions, should be unmodifiable, size is known after compilation, does not change (.text) Data static data initialized (.data) /uninitialized (.bbs) constant address in memory permanent life time dynamic data stack or heap storage space not known volatile life time.text.data.bss Adressraum PROM oder RAM schreibgeschützt RAM RAM PROM: Programmable Read Only Memory (im Betrieb nicht beschreibbarer Speicherbaustein) RAM: Random Access Memory (Speicher mit wahlfreiem Zugriff)

5 0Adressen 0Adressen Virtual Memory and Segments A Program in Memory Virtual Memory Whenever a process is created, the kernel provides a chunk of physical memory which can be located anywhere Through the magic of virtual memory (VM), the process believes it has all the memory on the computer Typically the VM space is laid out in a similar manner: static data dynamic data 0 Code, Konstanten initialisierte Daten nicht initialisierte Daten Heap aus ausführbarer Datei geladen bei Prozessstart bereitgestellt und mit 0 initialisiert (gelöscht) bei Prozessstart bereitgestellt, für dynamische Speicherallozierung, wächst dem Stapel entgegen Text Segment (.text) Initialized Data Segment (.data) Uninitialized Data Segment (.bss) Adressen Stack bei Prozessstart bereitgestellt, wächst zu tieferen Adressen (bzw. zu höheren Adr.; prozessorabhängig) The Stack The Heap Different Memory Layouts Memory Segments Programmstartadresse (A) Lösung auf PC (ia32) Stack Code, Konstanten initialisierte Daten nicht initialisierte Daten Heap (B) Stack umgekehrt wachsend Code, Konstanten initialisierte Daten nicht initialisierte Daten Stack Heap Text Segment The text segment contains the actual code (including constants) to be executed. It s usually sharable, so multiple instances of a program can share the text segment to lower memory requirements. This segment is usually marked read-only so a program can t modify its own instructions. Initialized Data Segment This segment contains global variables which are initialized by the programmer. Uninitialized Data Segment Also named.bss (block started by symbol) which was an operator used by an old assembler. This segment contains uninitialized global variables. All variables in this segment are initialized to 0 or NULL pointers before the program begins to execute.

6 23 24 Memory Segments (cont.) Variable Placement and Life Time (Code) int a; static int b; The Stack The stack is a collection of stack frames which we will discuss later. When a new frame needs to be added (as a result of a newly called function), the stack grows downward. The Heap Dynamic memory, where storage can be (de-)allocated via C s free(3)/malloc(3). The C library also gets dynamic memory for its own personal workspace from the heap as well. As more memory is requested on the fly, the heap grows upward. void func ( void ) { char c; static int d; int main ( void ) { int e; int *pi = ( int *) malloc ( sizeof ( int )); func (); func (); free (pi ); return (0); Variable Placement and Life Time (Code) Variable Placement and Life Time (Diagram) int a; /* Permanent life time */ static int b; /* dito, but reduced scope */ void func ( void ) { char c; /* only for the life time of func () */ /* but 2x; visible only in func () */ static int d; /* i m unique, exist once at a stable */ /* address, visible only in func () */ int main ( void ) { int e; /* life time of main () */ int *pi = ( int *) malloc ( sizeof ( int )); /* newborn */ func (); func (); free ( pi ); /* RIP, pi points to an invalid address */ return (0); PC(t=0) PC(t=x) Adresse 0 pi SP(t=x) SP(t=0) max. 1. Instruktion 2. Instruktion 3. Instruktion 4. Instruktion... a b d int c pi e Code Daten Halde (Heap) Stapel (Stack) t=0: Programmausführung wird gestartet, d.h., Ausführungsumgebung ist bereits initialisiert t=x: beliebiger Zeitpunkt während der Programmausführung

7 27 28 Variable Placement Repetition Computer Architecture Variables (outside a function) Globally declared variables go to the Uninitialized Data Segment if they are not initialized, to Initialized Data Segment otherwise. Necessary for the OS to decide if storage has to be loaded with initialization data from the executable binary. Variables (inside a function) Implicit assumption of auto, go to The Stack. Declared as static, see above. Constants (const) Text Segment Function Parameters Are pushed on The Stack or stored in registers. If pointers are passed, data is elsewhere. Storage Classes From Source Code To Executable Code Construction of an Executable Relocation Process From source code to executable code Translation steps using gcc(1) Translation Steps (multi-phase compilation) Compilation HLL source code to assembler source code Assembly Assembler source code to object code Linking Object code to executable code Quellcode C/C++ Eingabe- *.c/*.cc/*.cpp dateien Assembler-Quellcode *.s Objektdatei, Bibliotheksdatei *.o/*.a Compilers and assemblers create object files containing the generated binary code and data for a source file. Linkers combine multiple object files into one, loaders take object files and load them into memory. Goal: An executable binary file (a.out) From high-level language (HLL) source code to executable code, i.e., concrete processor instructions in combination with data. Präprozessor Compiler Assembler Binder Ausgabedateien *.i/*.ii *.s *.o a.out Vorverarbeiteter Assembler-Quellcode Objektdatei Ausführbare Datei C/C++-Quellcode (ungebunden) (= Objektdatei, ladbar)

8 31 32 File suffixes and their meaning Creation of an executable file For any given input file, the file name suffix determines what kind of compilation is done (see gcc(1)) for more details and suffixes: suffix compilation step.c C source code which must be preprocessed.i C source code which should not be preprocessed.h Header file to be turned into a precompiled header.s Assembler code.o An object file to be fed straight into linking Object/Library Files ld (Filename).c Kompilieren gcc (Filename).s Assemblieren gas (Filename).o = Operation = Kommando = Eingang oder Ausgang Binden a.out The C Preprocessor File Inclusion A control line of the form # include filename The C preprocessor performs... Inclusion of named files Macro Substitution Conditional Compilation causes the replacement of that line by the entire contents of the file filename. Note The characters in the name filename must not include > or \n, and the effect is undefined if it contains any of ",, \, or /*. Location The named file is searched for in a sequence of implementationdependent places (often starting in /usr/include).

9 35 36 Macro Substitution Macro Substitution (cont.) A control line of the form # define identifier token - sequence causes the preprocessor to replace subsequent instances of the identifier with the given sequence of tokens. Example # define EXIT_ FAILURE 1 # define EXIT_ SUCCESS 0 # define S_IRWXU /* RWX mask for owner */ # define S_IRUSR /* R for owner */ # define S_IWUSR /* W for owner */ # define S_IXUSR /* X for owner */ A control line of the form # define identifier ( identifier - list ) token - sequence where there is no space between the first identifier and the (, is a macro definition with parameters given by the identifier list. Example # define S_ISDIR ( m) (( m & ) == ) /* directory */ # define S_ISCHR ( m) (( m & ) == ) /* char sp. */ # define S_ISBLK ( m) (( m & ) == ) /* block sp.*/ # define S_ISREG ( m) (( m & ) == ) /* regular */ # define S_ISFIFO ( m) (( m & ) == ) /* fifo */ Macro Substitution (cont.) 33 Conditional Inclusion 34 A control line of the form # undef identifier causes the identifier s preprocessor definition to be forgotten. It is not erroneous to apply #undef to an unknown identifier. Example /* * Some header files may define an abs macro. * If defined, undef it to prevent a syntax error * and issue a warning. * # warning is a pragma ( implementation - dependent action ) */ # ifdef abs # undef abs # warning abs macro collides with abs () prototype, undefining # endif Parts of a program may be compiled conditionally Example # ifndef NULL # ifdef GNUG # define NULL null # else # define NULL 0L # endif # endif

10 39 40 Predefined Names Compilation Several identifiers are predefined, and expand to produce special information. They, and also the preprocessor expression operator defined, may not be undefined or redefined. evtl. temporäre Dateien Text LINE FILE DATE TIME STDC A decimal constant containing the current source line number A string literal containing the name of the file being compiled A string literal containing the data of compilation Mmm dd yyyy A string literal containing the data of compilation hh:mm:ss The constant 1. It is intended that this identifier be defined to be 1 only in standard-conforming implementations Text HLL-Quellcode Kompilation Compiler Assembler-Quellcode Text Übersetzungsliste mit Fehlermeldungen Assembly Linking evtl. temporäre Dateien Text Assembler- Quellcode Assemblierung Assembler Objektformat Maschinencode und Zusatzinformationen Text Übersetzungsliste mit Fehlermeldungen und Symboltabelle Objektformat Maschinencode und Zusatzinfo. Objektformat Maschinencode und Zusatzinfo. Bibliotheksobjektformat Maschinencode und Zusatzinfo. library search evtl. temporäre Dateien Binden Binder (Linker) Binärcode od. Objektformat Absoluter Code oder relozierbarer Code mit Zusatzinfo. Text Link Map (Adressraumbenutzung), Symbolliste

11 43 44 Program Section In Virtual Memory Repetition Computer Architecture Storage Classes 0 Nach Kompilation Sektion.text (Code): 0 Nach Bindung Adressraum From Source Code To Executable Code Construction of an Executable Relocation Process 0x x xffffffff Alle Sektionen sind im Adress- raum»absolut«platziert xx Sektion.data (init. Daten) 0 yy Jede Sektion beginnt bei Adr. 0, Sektionen sind»logische. Adressräume«des Compilers Linking an Executable Binary Relocation Records OBJ1 OBJ2 OBJ3.text1.text2.bss2.data1.text3.data3.bss3.bss1 Eingabedaten: ungebundene Objektdateien Bindung (linking).text: Code.data: initialisierte Variablen.bss: nicht initialisierte Variablen Once sections are placed subsequently, relocation can start Executable code contains embedded addresses Static data, function calls, jump targets On relocation those have to be changed inside the code Without a relocation table this is not possible OBJtotal.text1.text2.text3.data1.data3.bss1.bss2.bss3 Verarbeitungsresultat: ausführbare Datei (gebunden, reloziert) A relocation record holds the relative address of a symbol (name of a variable, a function etc.) Each object code (compiled seperately) starts at address 0 Linking them together involves centralization of sections relocation of adresses RELOCATION RECORDS FOR [. text ]: OFFSET TYPE VALUE a R_386_32 b R_386_32 a R_386_32 b

12 Source File: compile.c Analysis of Object Files (compile.o) int a = 1; /* Global variable, initialized ->. data */ int b; /* Global variable, uninitialized ->. bss */ int main ( void ) { static int c; /* Local, static variable ->. bss */ b = 5; c = b + a + 16; return c; Compile a relocatable object file cc -c compile.c (creates compile.o) Linking an executable binary (one-step compilation) cc compile.c -o compile $ file compile. o ELF 32 - bit LSB relocatable, Intel 80386, version 1, not stripped $ objdump -x compile. o compile. o: file format elf32 - i386 compile.o architecture : i386, flags 0 x : HAS_RELOC, HAS_SYMS start address 0 x Sections : Idx Name Size VMA LMA File off Algn 0. text a **2 CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE 1. data **2 CONTENTS, ALLOC, LOAD, DATA 2. bss **2 ALLOC 3. rodata **0 CONTENTS, ALLOC, LOAD, READONLY, DATA Object File: compile.o (cont.) SYMBOL TABLE : l df * ABS * compile. c l d. text l d. data l d. bss l O. bss c l d. rodata g O. data a g F. text a main O * COM * b RELOCATION RECORDS FOR [. text ]: OFFSET TYPE VALUE a R_386_32 b R_386_32 a R_386_32 b R_386_32. bss R_386_32. bss c R_386_32. rodata compile. o: file format elf32 - i386 Disassembly of section. text : <main >: 0: 55 push % ebp 1: 89 e5 mov % esp,% ebp 3: 83 ec 18 sub $0x18,% esp 6: 83 e4 f0 and $0xfffffff0,% esp 9: b mov $0x0,% eax e: 29 c4 sub % eax,% esp 10: a mov 0x0,% eax 15: e8 mov % eax,0 xffffffe8 (% ebp ) 18: c movl $0x5,0 x0 1f: : a mov 0x0,% eax 27: add 0x0,% eax 2d: 83 c0 10 add $0x10,% eax 30: a mov % eax,0 x0 35: a mov 0x0,% eax 3a: 8b 55 e8 mov 0 xffffffe8 (% ebp ),% edx 3d: 3b cmp 0x0,% edx 43: je 58 < main +0 x58 > 45: 83 ec 08 sub $0x8,% esp 48: ff 75 e8 pushl 0 xffffffe8 (% ebp ) 4b: push $0x0 50: e8 fc ff ff ff call 51 < main +0 x51 > 55: 83 c4 10 add $0x10,% esp 58: c9 leave 59: c3 ret 48 46

13 compile. o: file format elf32 - i386 Disassembly of section. text : <main >: int b; /* Global variable, uninitialized ->. bss */ int main ( void ) { 0: 55 push % ebp... 6 more lines... 15: e8 mov % eax,0 xffffffe8 (% ebp ) static int c; /* Local, static variable ->. bss */ b = 5; 18: c movl $0x5,0 x0 1f: c = b + a + 16; 22: a mov 0x0,% eax 27: add 0x0,% eax 2d: 83 c0 10 add $0x10,% eax 30: a mov % eax,0 x0 return c; 35: a mov 0x0,% eax more lines... Executable Binary File: compile compile : file format elf32 - i386 compile architecture : i386, flags 0 x : EXEC_P, HAS_SYMS, D_PAGED start address 0 x1c Sections : Idx Name Size VMA LMA File off Algn text c c **2 CONTENTS, ALLOC, LOAD, READONLY, CODE data c c **2 CONTENTS, ALLOC, LOAD, DATA bss c c **5 ALLOC SYMBOL TABLE : 3 c l O. bss c.0 3 c g O. bss b 1 c0005c0 g F. text a main 3 c g O. data a c0005c0 <main >: int b; /* Global variable, uninitialized ->. bss */ int main ( void ) { 1 c0005c0 : 55 push % ebp 1 c0005c1 : 89 e5 mov %esp,% ebp 1 c0005c3 : 83 ec 18 sub $0x18,% esp 1 c0005c6 : 83 e4 f0 and $0xfffffff0,% esp 1 c0005c9 : b mov $0x0,% eax 1 c0005ce : 29 c4 sub %eax,% esp 1 c0005d0 : a c mov 0 x3c003100,% eax 1 c0005d5 : e8 mov %eax,0 xffffffe8 (% ebp ) static int c; /* Local, static variable ->. bss */ Repetition Computer Architecture Storage Classes From Source Code To Executable Code b = 5; 1 c0005d8 : c c 05 movl $0x5,0 x3c c0005df : c = b + a + 16; 1 c0005e2 : a c mov 0 x3c001018,% eax 1 c0005e7 : c add 0 x3c003280,% eax 1 c0005ed : 83 c0 10 add $0x10,% eax 1 c0005f0 : a c mov % eax,0 x3c return c; 1 c0005f5 : a c mov 0 x3c003140,% eax 51 Construction of an Executable Relocation Process 52

14 55 Relocation Of An Assembler Instruction Relocation Of An Assembler Instruction (cont.) During the linking process relocated addresses are injected in the code, for example the assignment b = 5; Before relocation ( relocatable compile.o ): 18: c movl $0x5,0 x0 1 c0005d8 : c c 05 movl $0x5,0 x3c After relocation ( executable compile ): The proper address for b can be found in the symbol table. SYMBOL TABLE : ( compile ) 3 c g O. bss b The symbol table for compile yields 3c for variable b? How to find the right places in the machine code to perform the substitutions? Linker has relocation record (relative address) of b RELOCATION RECORDS FOR [. text ]: ( compile. o) a R_386_32 b Linker has absolute address of main from symbol table SYMBOL TABLE : ( compile ) 3 c g O. bss b 1 c0005c0 g F. text a main Relocation Of An Assembler Instruction (cont.) Putting it all together: RELOCATION RECORDS FOR [. text ]: ( compile. o) a R_386_32 b ( relative offset ) SYMBOL TABLE : ( compile ) 3 c g O. bss b ( abs. address of b) 1 c0005c0 g F. text a main ( abs. address of main ) Computing the address where substitution must be performed: 1 c0005c a = 1 c0005da 18: c movl $0x5,0 x0 1 c0005d8 : c c 05 movl $0x5,0 x3c003280

II. Systems Programming using C (Process Control Subsystem)

II. Systems Programming using C (Process Control Subsystem) II. Systems Programming using C (Process Control Subsystem) 129 Intended Schedule Date Lecture Hand out Submission 0 20.04. Introduction to Operating Systems Course registration 1 27.04. Systems Programming

More information

TIn 1: Lecture 3: Lernziele. Lecture 3 The Belly of the Architect. Basic internal components of the 8086. Pointers and data storage in memory

TIn 1: Lecture 3: Lernziele. Lecture 3 The Belly of the Architect. Basic internal components of the 8086. Pointers and data storage in memory Mitglied der Zürcher Fachhochschule TIn 1: Lecture 3 The Belly of the Architect. Lecture 3: Lernziele Basic internal components of the 8086 Pointers and data storage in memory Architektur 8086 Besteht

More information

Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com

Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com CSCI-UA.0201-003 Computer Systems Organization Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com Some slides adapted (and slightly modified)

More information

CS61: Systems Programing and Machine Organization

CS61: Systems Programing and Machine Organization CS61: Systems Programing and Machine Organization Fall 2009 Section Notes for Week 2 (September 14 th - 18 th ) Topics to be covered: I. Binary Basics II. Signed Numbers III. Architecture Overview IV.

More information

CS5460: Operating Systems

CS5460: Operating Systems CS5460: Operating Systems Lecture 13: Memory Management (Chapter 8) Where are we? Basic OS structure, HW/SW interface, interrupts, scheduling Concurrency Memory management Storage management Other topics

More information

For a 64-bit system. I - Presentation Of The Shellcode

For a 64-bit system. I - Presentation Of The Shellcode #How To Create Your Own Shellcode On Arch Linux? #Author : N3td3v!l #Contact-mail : 4nonymouse@usa.com #Website : Nopotm.ir #Spcial tnx to : C0nn3ct0r And All Honest Hackerz and Security Managers I - Presentation

More information

Simple C Programs. Goals for this Lecture. Help you learn about:

Simple C Programs. Goals for this Lecture. Help you learn about: Simple C Programs 1 Goals for this Lecture Help you learn about: Simple C programs Program structure Defining symbolic constants Detecting and reporting failure Functionality of the gcc command Preprocessor,

More information

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint) TN203 Porting a Program to Dynamic C Introduction Dynamic C has a number of improvements and differences compared to many other C compiler systems. This application note gives instructions and suggestions

More information

Software Vulnerabilities

Software Vulnerabilities Software Vulnerabilities -- stack overflow Code based security Code based security discusses typical vulnerabilities made by programmers that can be exploited by miscreants Implementing safe software in

More information

Chapter 13 - The Preprocessor

Chapter 13 - The Preprocessor Chapter 13 - The Preprocessor Outline 13.1 Introduction 13.2 The#include Preprocessor Directive 13.3 The#define Preprocessor Directive: Symbolic Constants 13.4 The#define Preprocessor Directive: Macros

More information

X86-64 Architecture Guide

X86-64 Architecture Guide X86-64 Architecture Guide For the code-generation project, we shall expose you to a simplified version of the x86-64 platform. Example Consider the following Decaf program: class Program { int foo(int

More information

CS:APP Chapter 4 Computer Architecture Instruction Set Architecture. CS:APP2e

CS:APP Chapter 4 Computer Architecture Instruction Set Architecture. CS:APP2e CS:APP Chapter 4 Computer Architecture Instruction Set Architecture CS:APP2e Instruction Set Architecture Assembly Language View Processor state Registers, memory, Instructions addl, pushl, ret, How instructions

More information

Object Oriented Software Design II

Object Oriented Software Design II Object Oriented Software Design II Introduction to C++ Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 20, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February

More information

Chapter 7D The Java Virtual Machine

Chapter 7D The Java Virtual Machine This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly

More information

Motorola 8- and 16-bit Embedded Application Binary Interface (M8/16EABI)

Motorola 8- and 16-bit Embedded Application Binary Interface (M8/16EABI) Motorola 8- and 16-bit Embedded Application Binary Interface (M8/16EABI) SYSTEM V APPLICATION BINARY INTERFACE Motorola M68HC05, M68HC08, M68HC11, M68HC12, and M68HC16 Processors Supplement Version 2.0

More information

The programming language C. sws1 1

The programming language C. sws1 1 The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

CS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 20: Stack Frames 7 March 08

CS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 20: Stack Frames 7 March 08 CS412/CS413 Introduction to Compilers Tim Teitelbaum Lecture 20: Stack Frames 7 March 08 CS 412/413 Spring 2008 Introduction to Compilers 1 Where We Are Source code if (b == 0) a = b; Low-level IR code

More information

Instruction Set Architecture

Instruction Set Architecture CS:APP Chapter 4 Computer Architecture Instruction Set Architecture Randal E. Bryant adapted by Jason Fritts http://csapp.cs.cmu.edu CS:APP2e Hardware Architecture - using Y86 ISA For learning aspects

More information

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C 1 An essential part of any embedded system design Programming 2 Programming in Assembly or HLL Processor and memory-sensitive

More information

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage

More information

Lecture 27 C and Assembly

Lecture 27 C and Assembly Ananda Gunawardena Lecture 27 C and Assembly This is a quick introduction to working with x86 assembly. Some of the instructions and register names must be check for latest commands and register names.

More information

Applying Clang Static Analyzer to Linux Kernel

Applying Clang Static Analyzer to Linux Kernel Applying Clang Static Analyzer to Linux Kernel 2012/6/7 FUJITSU COMPUTER TECHNOLOGIES LIMITED Hiroo MATSUMOTO 管 理 番 号 1154ka1 Copyright 2012 FUJITSU COMPUTER TECHNOLOGIES LIMITED Abstract Now there are

More information

Automating Mimicry Attacks Using Static Binary Analysis

Automating Mimicry Attacks Using Static Binary Analysis Automating Mimicry Attacks Using Static Binary Analysis Christopher Kruegel and Engin Kirda Technical University Vienna chris@auto.tuwien.ac.at, engin@infosys.tuwien.ac.at Darren Mutz, William Robertson,

More information

Off-by-One exploitation tutorial

Off-by-One exploitation tutorial Off-by-One exploitation tutorial By Saif El-Sherei www.elsherei.com Introduction: I decided to get a bit more into Linux exploitation, so I thought it would be nice if I document this as a good friend

More information

umps software development

umps software development Laboratorio di Sistemi Operativi Anno Accademico 2006-2007 Software Development with umps Part 2 Mauro Morsiani Software development with umps architecture: Assembly language development is cumbersome:

More information

Laboratorio di Sistemi Operativi Anno Accademico 2009-2010

Laboratorio di Sistemi Operativi Anno Accademico 2009-2010 Laboratorio di Sistemi Operativi Anno Accademico 2009-2010 Software Development with umps Part 2 Mauro Morsiani Copyright Permission is granted to copy, distribute and/or modify this document under the

More information

Buffer Overflows. Security 2011

Buffer Overflows. Security 2011 Buffer Overflows Security 2011 Memory Organiza;on Topics Kernel organizes memory in pages Typically 4k bytes Processes operate in a Virtual Memory Space Mapped to real 4k pages Could live in RAM or be

More information

Hacking Techniques & Intrusion Detection. Ali Al-Shemery arabnix [at] gmail

Hacking Techniques & Intrusion Detection. Ali Al-Shemery arabnix [at] gmail Hacking Techniques & Intrusion Detection Ali Al-Shemery arabnix [at] gmail All materials is licensed under a Creative Commons Share Alike license http://creativecommonsorg/licenses/by-sa/30/ # whoami Ali

More information

Embedded Software development Process and Tools: Lesson-4 Linking and Locating Software

Embedded Software development Process and Tools: Lesson-4 Linking and Locating Software Embedded Software development Process and Tools: Lesson-4 Linking and Locating Software 1 1. Linker 2 Linker Links the compiled codes of application software, object codes from library and OS kernel functions.

More information

Assembly Language: Function Calls" Jennifer Rexford!

Assembly Language: Function Calls Jennifer Rexford! Assembly Language: Function Calls" Jennifer Rexford! 1 Goals of this Lecture" Function call problems:! Calling and returning! Passing parameters! Storing local variables! Handling registers without interference!

More information

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T) Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating

More information

MPLAB TM C30 Managed PSV Pointers. Beta support included with MPLAB C30 V3.00

MPLAB TM C30 Managed PSV Pointers. Beta support included with MPLAB C30 V3.00 MPLAB TM C30 Managed PSV Pointers Beta support included with MPLAB C30 V3.00 Contents 1 Overview 2 1.1 Why Beta?.............................. 2 1.2 Other Sources of Reference..................... 2 2

More information

Lecture 10: Dynamic Memory Allocation 1: Into the jaws of malloc()

Lecture 10: Dynamic Memory Allocation 1: Into the jaws of malloc() CS61: Systems Programming and Machine Organization Harvard University, Fall 2009 Lecture 10: Dynamic Memory Allocation 1: Into the jaws of malloc() Prof. Matt Welsh October 6, 2009 Topics for today Dynamic

More information

Glossary of Object Oriented Terms

Glossary of Object Oriented Terms Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction

More information

Computer Organization and Architecture

Computer Organization and Architecture Computer Organization and Architecture Chapter 11 Instruction Sets: Addressing Modes and Formats Instruction Set Design One goal of instruction set design is to minimize instruction length Another goal

More information

1 The Java Virtual Machine

1 The Java Virtual Machine 1 The Java Virtual Machine About the Spec Format This document describes the Java virtual machine and the instruction set. In this introduction, each component of the machine is briefly described. This

More information

Next, the driver runs the C compiler (cc1), which translates main.i into an ASCII assembly language file main.s.

Next, the driver runs the C compiler (cc1), which translates main.i into an ASCII assembly language file main.s. Chapter 7 Linking Linking is the process of collecting and combining various pieces of code and data into a single file that can be loaded (copied) into memory and executed. Linking can be performed at

More information

Stack Allocation. Run-Time Data Structures. Static Structures

Stack Allocation. Run-Time Data Structures. Static Structures Run-Time Data Structures Stack Allocation Static Structures For static structures, a fixed address is used throughout execution. This is the oldest and simplest memory organization. In current compilers,

More information

Unix Security Technologies. Pete Markowsky <peterm[at] ccs.neu.edu>

Unix Security Technologies. Pete Markowsky <peterm[at] ccs.neu.edu> Unix Security Technologies Pete Markowsky What is this about? The goal of this CPU/SWS are: Introduce you to classic vulnerabilities Get you to understand security advisories Make

More information

Stack Overflows. Mitchell Adair

Stack Overflows. Mitchell Adair Stack Overflows Mitchell Adair Outline Why? What? There once was a VM Virtual Memory Registers Stack stack1, stack2, stack3 Resources Why? Real problem Real money Real recognition Still prevalent Very

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

More information

Operating System Overview. Otto J. Anshus

Operating System Overview. Otto J. Anshus Operating System Overview Otto J. Anshus A Typical Computer CPU... CPU Memory Chipset I/O bus ROM Keyboard Network A Typical Computer System CPU. CPU Memory Application(s) Operating System ROM OS Apps

More information

Operating Systems. Virtual Memory

Operating Systems. Virtual Memory Operating Systems Virtual Memory Virtual Memory Topics. Memory Hierarchy. Why Virtual Memory. Virtual Memory Issues. Virtual Memory Solutions. Locality of Reference. Virtual Memory with Segmentation. Page

More information

How To Write Portable Programs In C

How To Write Portable Programs In C Writing Portable Programs COS 217 1 Goals of Today s Class Writing portable programs in C Sources of heterogeneity Data types, evaluation order, byte order, char set, Reading period and final exam Important

More information

Machine-Level Programming II: Arithmetic & Control

Machine-Level Programming II: Arithmetic & Control Mellon Machine-Level Programming II: Arithmetic & Control 15-213 / 18-213: Introduction to Computer Systems 6 th Lecture, Jan 29, 2015 Instructors: Seth Copen Goldstein, Franz Franchetti, Greg Kesden 1

More information

Return-oriented programming without returns

Return-oriented programming without returns Faculty of Computer Science Institute for System Architecture, Operating Systems Group Return-oriented programming without urns S. Checkoway, L. Davi, A. Dmitrienko, A. Sadeghi, H. Shacham, M. Winandy

More information

C++ INTERVIEW QUESTIONS

C++ INTERVIEW QUESTIONS C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

More information

Keil C51 Cross Compiler

Keil C51 Cross Compiler Keil C51 Cross Compiler ANSI C Compiler Generates fast compact code for the 8051 and it s derivatives Advantages of C over Assembler Do not need to know the microcontroller instruction set Register allocation

More information

Intel P6 Systemprogrammering 2007 Föreläsning 5 P6/Linux Memory System

Intel P6 Systemprogrammering 2007 Föreläsning 5 P6/Linux Memory System Intel P6 Systemprogrammering 07 Föreläsning 5 P6/Linux ory System Topics P6 address translation Linux memory management Linux page fault handling memory mapping Internal Designation for Successor to Pentium

More information

Programming Embedded Systems

Programming Embedded Systems Programming Embedded Systems Lecture 13 Overview of memory management Monday Feb 27, 2012 Philipp Rümmer Uppsala University Philipp.Ruemmer@it.uu.se 1/32 Lecture outline Memory architecture of microcontrollers,

More information

OPERATING SYSTEMS MEMORY MANAGEMENT

OPERATING SYSTEMS MEMORY MANAGEMENT OPERATING SYSTEMS MEMORY MANAGEMENT Jerry Breecher 8: Memory Management 1 OPERATING SYSTEM Memory Management What Is In This Chapter? Just as processes share the CPU, they also share physical memory. This

More information

Illustration 1: Diagram of program function and data flow

Illustration 1: Diagram of program function and data flow The contract called for creation of a random access database of plumbing shops within the near perimeter of FIU Engineering school. The database features a rating number from 1-10 to offer a guideline

More information

How To Protect Your Computer From Being Copied On A Microsoft X86 Microsoft Microsoft System (X86) On A Linux System (Amd) On An X86 2.2.2 (Amd2) (X64) (Amd

How To Protect Your Computer From Being Copied On A Microsoft X86 Microsoft Microsoft System (X86) On A Linux System (Amd) On An X86 2.2.2 (Amd2) (X64) (Amd Integrating segmentation and paging protection for safe, efficient and transparent software extensions Tzi-cker Chiueh Ganesh Venkitachalam Prashant Pradhan Computer Science Department State University

More information

Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine

Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine 7 Objectives After completing this lab you will: know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine Introduction Branches and jumps provide ways to change

More information

Object Oriented Software Design II

Object Oriented Software Design II Object Oriented Software Design II C++ intro Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 26, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February 26,

More information

How To Use The C Preprocessor

How To Use The C Preprocessor Environnements et Outils de Développement Cours 3 The C build process Stefano Zacchiroli zack@pps.univ-paris-diderot.fr Laboratoire PPS, Université Paris Diderot - Paris 7 URL http://upsilon.cc/~zack/teaching/1112/ed6/

More information

Hotpatching and the Rise of Third-Party Patches

Hotpatching and the Rise of Third-Party Patches Hotpatching and the Rise of Third-Party Patches Alexander Sotirov asotirov@determina.com BlackHat USA 2006 Overview In the next one hour, we will cover: Third-party security patches _ recent developments

More information

Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings: 9.1-9.

Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings: 9.1-9. Code Generation I Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings: 9.1-9.7 Stack Machines A simple evaluation model No variables

More information

How Compilers Work. by Walter Bright. Digital Mars

How Compilers Work. by Walter Bright. Digital Mars How Compilers Work by Walter Bright Digital Mars Compilers I've Built D programming language C++ C Javascript Java A.B.E.L Compiler Compilers Regex Lex Yacc Spirit Do only the easiest part Not very customizable

More information

Software Development Environment

Software Development Environment Software Development Environment Zynq 14.2 Version This material exempt per Department of Commerce license exception TSU Objectives After completing this module, you will be able to: Understand the basic

More information

Visa Smart Debit/Credit Certificate Authority Public Keys

Visa Smart Debit/Credit Certificate Authority Public Keys CHIP AND NEW TECHNOLOGIES Visa Smart Debit/Credit Certificate Authority Public Keys Overview The EMV standard calls for the use of Public Key technology for offline authentication, for aspects of online

More information

Memory Systems. Static Random Access Memory (SRAM) Cell

Memory Systems. Static Random Access Memory (SRAM) Cell Memory Systems This chapter begins the discussion of memory systems from the implementation of a single bit. The architecture of memory chips is then constructed using arrays of bit implementations coupled

More information

Linux/UNIX System Programming. POSIX Shared Memory. Michael Kerrisk, man7.org c 2015. February 2015

Linux/UNIX System Programming. POSIX Shared Memory. Michael Kerrisk, man7.org c 2015. February 2015 Linux/UNIX System Programming POSIX Shared Memory Michael Kerrisk, man7.org c 2015 February 2015 Outline 22 POSIX Shared Memory 22-1 22.1 Overview 22-3 22.2 Creating and opening shared memory objects 22-10

More information

Programming Languages

Programming Languages Programming Languages In the beginning To use a computer, you needed to know how to program it. Today People no longer need to know how to program in order to use the computer. To see how this was accomplished,

More information

An Introduction to Assembly Programming with the ARM 32-bit Processor Family

An Introduction to Assembly Programming with the ARM 32-bit Processor Family An Introduction to Assembly Programming with the ARM 32-bit Processor Family G. Agosta Politecnico di Milano December 3, 2011 Contents 1 Introduction 1 1.1 Prerequisites............................. 2

More information

Leak Check Version 2.1 for Linux TM

Leak Check Version 2.1 for Linux TM Leak Check Version 2.1 for Linux TM User s Guide Including Leak Analyzer For x86 Servers Document Number DLC20-L-021-1 Copyright 2003-2009 Dynamic Memory Solutions LLC www.dynamic-memory.com Notices Information

More information

REpsych. : psycholigical warfare in reverse engineering. def con 2015 // domas

REpsych. : psycholigical warfare in reverse engineering. def con 2015 // domas REpsych : psycholigical warfare in reverse engineering { def con 2015 // domas Warning This serves no purpose Taking something apart to figure out how it works With software Interfacing Documentation Obsolescence

More information

3. USB FLASH DRIVE PREPARATION. Almost all current PC firmware permits booting from a USB drive, allowing the launch

3. USB FLASH DRIVE PREPARATION. Almost all current PC firmware permits booting from a USB drive, allowing the launch 3. USB FLASH DRIVE PREPARATION 3.1 INTRODUCTION Almost all current PC firmware permits booting from a USB drive, allowing the launch of an operating system from a bootable flash drive. Such a configuration

More information

The V8 JavaScript Engine

The V8 JavaScript Engine The V8 JavaScript Engine Design, Implementation, Testing and Benchmarking Mads Ager, Software Engineer Agenda Part 1: What is JavaScript? Part 2: V8 internals Part 3: V8 testing and benchmarking What is

More information

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Module No. # 01 Lecture No. # 39 System Security Welcome

More information

MIPS Assembly Code Layout

MIPS Assembly Code Layout Learning MIPS & SPIM MIPS assembly is a low-level programming language The best way to learn any programming language is to write code We will get you started by going through a few example programs and

More information

C Interview Questions

C Interview Questions http://techpreparation.com C Interview Questions And Answers 2008 V i s i t T e c h P r e p a r a t i o n. c o m f o r m o r e i n t e r v i e w q u e s t i o n s a n d a n s w e r s C Interview Questions

More information

Hardware and Software Requirements

Hardware and Software Requirements C Compiler Real-Time OS Simulator Training Evaluation Boards Installing and Using the Keil Monitor-51 Application Note 152 May 31, 2000, Munich, Germany by Keil Support, Keil Elektronik GmbH support.intl@keil.com

More information

Instruction Set Architecture (ISA)

Instruction Set Architecture (ISA) Instruction Set Architecture (ISA) * Instruction set architecture of a machine fills the semantic gap between the user and the machine. * ISA serves as the starting point for the design of a new machine

More information

Introduction. Compiler Design CSE 504. Overview. Programming problems are easier to solve in high-level languages

Introduction. Compiler Design CSE 504. Overview. Programming problems are easier to solve in high-level languages Introduction Compiler esign CSE 504 1 Overview 2 3 Phases of Translation ast modifled: Mon Jan 28 2013 at 17:19:57 EST Version: 1.5 23:45:54 2013/01/28 Compiled at 11:48 on 2015/01/28 Compiler esign Introduction

More information

Virtual Memory. How is it possible for each process to have contiguous addresses and so many of them? A System Using Virtual Addressing

Virtual Memory. How is it possible for each process to have contiguous addresses and so many of them? A System Using Virtual Addressing How is it possible for each process to have contiguous addresses and so many of them? Computer Systems Organization (Spring ) CSCI-UA, Section Instructor: Joanna Klukowska Teaching Assistants: Paige Connelly

More information

Chapter 13 Storage classes

Chapter 13 Storage classes Chapter 13 Storage classes 1. Storage classes 2. Storage Class auto 3. Storage Class extern 4. Storage Class static 5. Storage Class register 6. Global and Local Variables 7. Nested Blocks with the Same

More information

M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 1. Introduction 6.004 Computation Structures β Documentation This handout is

More information

C Compiler Targeting the Java Virtual Machine

C Compiler Targeting the Java Virtual Machine C Compiler Targeting the Java Virtual Machine Jack Pien Senior Honors Thesis (Advisor: Javed A. Aslam) Dartmouth College Computer Science Technical Report PCS-TR98-334 May 30, 1998 Abstract One of the

More information

Faculty of Engineering Student Number:

Faculty of Engineering Student Number: Philadelphia University Student Name: Faculty of Engineering Student Number: Dept. of Computer Engineering Final Exam, First Semester: 2012/2013 Course Title: Microprocessors Date: 17/01//2013 Course No:

More information

Compilers. Introduction to Compilers. Lecture 1. Spring term. Mick O Donnell: michael.odonnell@uam.es Alfonso Ortega: alfonso.ortega@uam.

Compilers. Introduction to Compilers. Lecture 1. Spring term. Mick O Donnell: michael.odonnell@uam.es Alfonso Ortega: alfonso.ortega@uam. Compilers Spring term Mick O Donnell: michael.odonnell@uam.es Alfonso Ortega: alfonso.ortega@uam.es Lecture 1 to Compilers 1 Topic 1: What is a Compiler? 3 What is a Compiler? A compiler is a computer

More information

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

KITES TECHNOLOGY COURSE MODULE (C, C++, DS) KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL

More information

Programming languages C

Programming languages C INTERNATIONAL STANDARD ISO/IEC 9899:1999 TECHNICAL CORRIGENDUM 2 Published 2004-11-15 INTERNATIONAL ORGANIZATION FOR STANDARDIZATION МЕЖДУНАРОДНАЯ ОРГАНИЗАЦИЯ ПО СТАНДАРТИЗАЦИИ ORGANISATION INTERNATIONALE

More information

Introduction. Application Security. Reasons For Reverse Engineering. This lecture. Java Byte Code

Introduction. Application Security. Reasons For Reverse Engineering. This lecture. Java Byte Code Introduction Application Security Tom Chothia Computer Security, Lecture 16 Compiled code is really just data which can be edit and inspected. By examining low level code protections can be removed and

More information

Practical taint analysis for protecting buggy binaries

Practical taint analysis for protecting buggy binaries Practical taint analysis for protecting buggy binaries So your exploit beats ASLR/DEP? I don't care Erik Bosman Traditional Stack Smashing buf[16] GET / HTTP/1.100baseretnarg1arg2 Traditional

More information

CHAPTER 6 TASK MANAGEMENT

CHAPTER 6 TASK MANAGEMENT CHAPTER 6 TASK MANAGEMENT This chapter describes the IA-32 architecture s task management facilities. These facilities are only available when the processor is running in protected mode. 6.1. TASK MANAGEMENT

More information

How to make the computer understand? Lecture 15: Putting it all together. Example (Output assembly code) Example (input program) Anatomy of a Computer

How to make the computer understand? Lecture 15: Putting it all together. Example (Output assembly code) Example (input program) Anatomy of a Computer How to make the computer understand? Fall 2005 Lecture 15: Putting it all together From parsing to code generation Write a program using a programming language Microprocessors talk in assembly language

More information

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ Answer the following 1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ 2) Which data structure is needed to convert infix notations to postfix notations? Stack 3) The

More information

A Tiny Guide to Programming in 32-bit x86 Assembly Language

A Tiny Guide to Programming in 32-bit x86 Assembly Language CS308, Spring 1999 A Tiny Guide to Programming in 32-bit x86 Assembly Language by Adam Ferrari, ferrari@virginia.edu (with changes by Alan Batson, batson@virginia.edu and Mike Lack, mnl3j@virginia.edu)

More information

Programing the Microprocessor in C Microprocessor System Design and Interfacing ECE 362

Programing the Microprocessor in C Microprocessor System Design and Interfacing ECE 362 PURDUE UNIVERSITY Programing the Microprocessor in C Microprocessor System Design and Interfacing ECE 362 Course Staff 1/31/2012 1 Introduction This tutorial is made to help the student use C language

More information

Chapter 4 Processor Architecture

Chapter 4 Processor Architecture Chapter 4 Processor Architecture Modern microprocessors are among the most complex systems ever created by humans. A single silicon chip, roughly the size of a fingernail, can contain a complete high-performance

More information

How To Understand How A Process Works In Unix (Shell) (Shell Shell) (Program) (Unix) (For A Non-Program) And (Shell).Orgode) (Powerpoint) (Permanent) (Processes

How To Understand How A Process Works In Unix (Shell) (Shell Shell) (Program) (Unix) (For A Non-Program) And (Shell).Orgode) (Powerpoint) (Permanent) (Processes Content Introduction and History File I/O The File System Shell Programming Standard Unix Files and Configuration Processes Programs are instruction sets stored on a permanent medium (e.g. harddisc). Processes

More information

OPERATING SYSTEM - MEMORY MANAGEMENT

OPERATING SYSTEM - MEMORY MANAGEMENT OPERATING SYSTEM - MEMORY MANAGEMENT http://www.tutorialspoint.com/operating_system/os_memory_management.htm Copyright tutorialspoint.com Memory management is the functionality of an operating system which

More information

Fast Arithmetic Coding (FastAC) Implementations

Fast Arithmetic Coding (FastAC) Implementations Fast Arithmetic Coding (FastAC) Implementations Amir Said 1 Introduction This document describes our fast implementations of arithmetic coding, which achieve optimal compression and higher throughput by

More information

CSC 2405: Computer Systems II

CSC 2405: Computer Systems II CSC 2405: Computer Systems II Spring 2013 (TR 8:30-9:45 in G86) Mirela Damian http://www.csc.villanova.edu/~mdamian/csc2405/ Introductions Mirela Damian Room 167A in the Mendel Science Building mirela.damian@villanova.edu

More information

Title: Bugger The Debugger - Pre Interaction Debugger Code Execution

Title: Bugger The Debugger - Pre Interaction Debugger Code Execution White Paper Title: Bugger The Debugger Pre Interaction Debugger Code Execution Prepared by: Brett Moore Network Intrusion Specialist, CTO SecurityAssessment.com Date: April 2005 Abstract The use of debuggers

More information

Language Processing Systems

Language Processing Systems Language Processing Systems Evaluation Active sheets 10 % Exercise reports 30 % Midterm Exam 20 % Final Exam 40 % Contact Send e-mail to hamada@u-aizu.ac.jp Course materials at www.u-aizu.ac.jp/~hamada/education.html

More information