Windows workshop 2010 Understanding Software Dependencies in Windows Roland Yap School of Computing National University of Singapore Singapore

Slides:



Advertisements
Similar presentations
Introduction to the Windows XP Architecture
Advertisements

Device Drivers Witawas Srisa-an Embedded Systems Design and Implementation.
Memory Protection: Kernel and User Address Spaces  Background  Address binding  How memory protection is achieved.
Operating System Security : David Phillips A Study of Windows Rootkits.
Windows 2000 System Architecture (continued) Computing Department, Lancaster University, UK.
LINUX-WINDOWS INTERACTION. One software allowing interaction between Linux and Windows is WINE. Wine allows Linux users to load Windows programs while.
计算机系 信息处理实验室 Leture1 concepts and tools 2005 Spring 陈香兰.
The Path to Multi-core Tools Paul Petersen. Multi-coreToolsThePathTo 2 Outline Motivation Where are we now What is easy to do next What is missing.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Processes CSCI 444/544 Operating Systems Fall 2008.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
Process Management. External View of the OS Hardware fork() CreateProcess() CreateThread() close() CloseHandle() sleep() semctl() signal() SetWaitableTimer()
Active X Microsoft’s Answer to Dynamic Content Reference: Using Active X by Brian Farrar QUE
1 CE6130 現代作業系統核心 Modern Operating System Kernels 許 富 皓.
Chapter 6 - Implementing Processes, Threads and Resources Kris Hansen Shelby Davis Jeffery Brass 3/7/05 & 3/9/05 Kris Hansen Shelby Davis Jeffery Brass.
LabVIEW: Tips & Tricks Ihor Korolov March 2011.
Ch 11 Managing System Reliability and Availability 1.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
Input/Output Controller (IOC) Overview Andrew Johnson Computer Scientist, AES Controls Group.
Visual Basic: An Object Oriented Approach 12 – Creating and using ActiveX objects.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 11 Case Study 2: Windows Vista Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
How To Fix Common Computer Errors m.
Microsoft.NET Vs Sun JAVA
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
Threading Models in Visual Basic Language Student Name: Danyu Xu Student ID:98044.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
‘Tirgul’ # 7 Enterprise Development Using Visual Basic 6.0 Autumn 2002 Tirgul #7.
Component 4: Introduction to Information and Computer Science Unit 4: Application and System Software Lecture 3 This material was developed by Oregon Health.
Linking and Loading Linker collects procedures and links them together object modules into one executable program. Why isn't everything written as just.
April 2000Dr Milan Simic1 Network Operating Systems Windows NT.
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
Quasi-Static Binary Analysis Hassen Saidi. Quasi-Static Analysis in VERNIER Node level: –Quasi-static analysis is a detector of malicious and bad behavior.
1 Confidential Enterprise Solutions Group Process and Threads.
Windows Memory Architecture 井民全製作. A Process ’ s Virtual Address Space Every Process has its own private virtual address 32-bits processes  4 GB address.
Chapter 9Basic Troubleshooting Techniques  9.1General Troubleshooting Techniques 9.1General Troubleshooting Techniques 9.1General Troubleshooting Techniques.
© 2004, D. J. Foreman 1 Implementing Processes and Threads.
Writing a Run Time DLL The application loads the DLL using LoadLibrary() or LoadLibraryEx(). The standard search sequence is used by the operating system.
CSE 451: Operating Systems Winter 2011 Linking, Loading and Process Startup Mark Zbikowski Gary Kimura.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
Department of Computer Science and Software Engineering
2 Processor(s)Main MemoryDevices Process, Thread & Resource Manager Memory Manager Device Manager File Manager.
Chapter Eleven Windows XP Professional Application Support.
Win32 Programming Lesson 19: Introduction to DLLs.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
CITA 171 Section 1 DOS/Windows Introduction. DOS Disk operating system (DOS) –Term most often associated with MS-DOS –Single-tasking operating system.
© ExplorNet’s Centers for Quality Teaching and Learning 1 Describe applications and services. Objective Course Weight 5%
Beyond Application Profiling to System Aware Analysis Elena Laskavaia, QNX Bill Graham, QNX.
Introduction to Operating Systems Concepts
Computer System Structures
Chapter 4 – Thread Concepts
CrossOver and Wine Jeremy White CEO, Codeweavers, Inc.
Chapter 3: Windows7 Part 5.
Chapter 4 – Thread Concepts
Unit OS4: Scheduling and Dispatch
CO6025 Advanced Programming
Threads and Locks.
Operating System Concepts
Chapter 3: Windows7 Part 5.
Windows Internals Brown-Bag Seminar Chapter 1 – Concepts and Tools
Chapter 4: Threads.
Lecture Topics: 11/1 General Operating System Concepts Processes
CSE 451: Operating Systems Winter 2010 Module 16 Linking, Loading and Process Startup Mark Zbikowski Gary Kimura 1.
CSE 451: Operating Systems Winter 2009 Module 16 Linking, Loading and Process Startup Mark Zbikowski Gary Kimura 1.
Implementing Processes, Threads, and Resources
Outline Operating System Organization Operating System Examples
CSC 497/583 Advanced Topics in Computer Security
Following Malware Execution in IDA
Dynamic Binary Translators and Instrumenters
Week 5 Computers are like Old Testament gods; lots of rules and no mercy. Joseph Campbell.
Presentation transcript:

Windows workshop 2010 Understanding Software Dependencies in Windows Roland Yap School of Computing National University of Singapore Singapore

Motivation Software is complex with a ecosystem of dependencies –Installation can cause other S/W to fail (e.g overwriting old library versions) –Uninstallation can cause S/W to fail (e.g removing critical shared libraries) Interactions and dependencies between software are difficult to understand We explore visualization as a tool for understanding software dependencies –See Y. Wu, R.H.C. Yap and R. Ramnath, Comprehending Module Dependencies and Sharing, ICSE 2010, to appear Note: Dave’s talk – what is an application?

Examples of dependencies (1) Binaries used by notepad –c:\windows\apppatch\acgenral.dll –c:\windows\system32\avgrsstx.dll –c:\windows\system32\imm32.dll –c:\windows\system32\lpk.dll –c:\windows\system32\msacm32.dll –c:\windows\system32\msctf.dll –c:\windows\system32\msctfime.ime –c:\windows\system32\shimeng.dll –c:\windows\system32\usp10.dll –c:\windows\system32\uxtheme.dll –c:\windows\system32\winmm.dll –c:\windows\system32\winspool.drv –c:\windows\winsxs\x86_microsoft.windows.common- controls_6595b64144ccf1df_ _x-ww_35d4ce83\comctl32.dll

Examples of dependencies (2) Simple boot (only Windows installed) –DLLs: 154 –EXEs: 10 –Drivers: 1 –Ime: 1 Typical boot (Windows + applications) –DLLs: 274 –EXEs: 15 –Telephony/Modem: 6 –Drivers: 3 –ActiveX: 2 –Ime: 1

What are binaries? EXE (executables) are considered binaries Other binary types are DLL (dynamic linked libraries), OCX (ActiveX controls), SYS (drivers) and CPL (control panel applets), …

Visualization Objectives Visualizing binaries used by a particular executable Visualize any commonalities between binaries Visualize dependencies between binaries

Visualization (1) Basic dependency graph Graph is too dense

Revisiting processes (1) Process creation: Broken into many native calls. Very different from UNIX’s fork+execve The user space Win32 API CreateProcess() 1.Open the EXE file (ZwCreateFile) 2.Create process object (ZwCreateProcess) 3.Create thread object (ZwCreateThread) 4.Notify Windows subsystem (csrss) 5.Start the initial thread (ZwResumeThread) Note: Recall Dave’s talk – NT native system calls

Revisiting processes (2) Binary loading: broken into many native calls Similar to UNIX: dlopen = open + mmap +… The user space Win32 API LoadLibrary() 1.Open the binary (ZwCreateFile) 2.Create a Section object (ZwCreateSection) 3.Map the binary to VM (ZwMapViewOfSection) 4.Dynamic linking, relocation…

Binary Dependency Visualization Two types of nodes: EXE, DLL + etc Three types of directed edges 1.EXE X launches another EXE Y 2.EXE X load a DLL Y 3.A function in binary X calls a function in binary Y How are binaries shared among programs? –EXE Dependency Graph –Only Type 1 and 2 edge –Group DLLs by loader How binaries interact? –DLL Dependency Graph –Only Type 2 and 3 edge –Group DLLs manually by functionality or software vendor

Visualization (1) Basic dependency graph Graph is too dense

A more usable Visualization: EXE Dependency Graph Grouped dependency graph

Collecting binary dependency information EXE X launches another EXE Y –Use the kernel PsSetCreateProcessNotifyRoutine() API EXE X load a DLL Y –Use the kernel PsSetLoadImageNotifyRoutine() API A function in binary X calls a function in binary Y –Instrument code execution

Comparing Microsoft Word and Open Office Writer

DLL Dependency Graph: actual binary usage Some definitions: –An EXE-DLL dependency in a DLL Dependency Graph is when there is has a control transfer from code in executable x to code in DLL y. We say that x has an EXE-DLL dependency on y. –A DLL-DLL dependency in a DLL Dependency Graph is when there is has a control transfer from code in DLL x to code in DLL y. We say that x has a DLL-DLL dependency on y

Visualizing binaries executed (1) Generate call tree, call graph, DLL dependency graph PIN tool to collect execution trace –Trace include call, return, thread, context, system call events –Call and return records stack pointer, PC and target address. Not trivial to maintain call stack by tracking call and return –Non-return function (long jump) –Thread, fiber –Context –Kernel callback

Visualizing binaries executed Call graph is large. Group functions to images => DLL dependency graph. DLL dependency graph is still large. Group DLLs by properties: –By functionality: graphics, audio, network… –By vendor: microsoft, adobe… –By path: C:\windows\system32\*.dll, D:\vmware\*.dll…

Grouping by functionality wget: DLL dependency without grouping

Grouping by functionality wget: DLL dependency with grouping

Examples of grouping By functionality (GIMP)

Examples of grouping By software vendor (GIMP)

Boot trace Most common dlls e.g kernel32, gdi32 Svchost using a lot of dlls

Conclusion Actual software dependencies quite complex in Windows 2 effective visualizations: –EXE Dependency Graphs: commonality between binaries –DLL Dependency Graphs: actual binary usage