120 likes | 304 Views
Win32 syscall emulator based on OpenSolaris branded zone. Chimera project team: Vizovitin Nicolay Sizov Mikhail Kolbin Dmitry Khlebnikov Sergey. Tutor: Irtegov D.V. Outline. Idea behind the project Sources and the goal How system call emulation works
E N D
Win32 syscall emulator based on OpenSolaris branded zone Chimera project team: Vizovitin Nicolay Sizov Mikhail Kolbin Dmitry Khlebnikov Sergey Tutor: Irtegov D.V.
Outline • Idea behind the project • Sources and the goal • How system call emulation works • Project status: progress and plans • Q&A
The idea… …is to mix OpenSolaris and Windows
Why OpenSolaris? • Open source • Zones & Containers • BrandZ infrastructure – support for non-native kernel personalities • Numerous interesting kernel features (e.g. DTrace)
The chimera parts • OpenSolaris sources (ON) • Windows Research Kernel (WRK) – some kernel parts of Windows 2003 SP1 • Other open-source projects like Wine and ReactOS
Our goal Create new win brand, that supports execution of Windows applications on top of OpenSolaris kernel
System call emulation: global zone Global zone (native) Solaris process { … open(); … } userland kernel Solaris kernel Syscall handler if (process is branded) brand_syscall_handler(); else rval = do_native_syscall(); return to userspace; Native ‘open’ implementation open() { … return (fd); }
System call emulation: win zone Windows zone Win brand support library win_NtCreateFile(args) { fd = open(win2sol(args)); if (fd < 0) return (sol2win(errno)); else return (fd); } Windows process { … NtCreateFile(); … } userland kernel Solaris kernel Windows brand module Syscall handler if (process is branded) brand_syscall_handler(); else rval = do_native_syscall(); return to userspace; win_syscall() { trampoline to userland; } Native ‘open’ implementation open() { … return (fd); }
Project progress • Set of scripts for convenient brand testing • Dynamic memory allocation is now available in brand support library • Arbitrary calls to libraries from brand support library is safe now (first of all to libc.so) • Partially implemented PE loader • Emulation code for several syscalls
Current project status • Extensive documentation of WRK sources • Learned to build ON and WRK • Created basic win zone • win brand kernel module • win brand support library • zone configuration files • support for system calls via sysenter • Number of test programs • Partial PE loader implementation • Some system calls implemented
Plans on project development • Finish PE loader implementation • Emulation code for other Windows system calls • Create minimal Windows environment in the zone • Allowing other technics for entering the kernel (int 2e, syscall)