security/sandbox/win/src/Wow64.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
michael@0 2 // Use of this source code is governed by a BSD-style license that can be
michael@0 3 // found in the LICENSE file.
michael@0 4
michael@0 5 #ifndef SANDBOX_SRC_WOW64_H__
michael@0 6 #define SANDBOX_SRC_WOW64_H__
michael@0 7
michael@0 8 #include <windows.h>
michael@0 9
michael@0 10 #include "base/basictypes.h"
michael@0 11 #include "sandbox/win/src/sandbox_types.h"
michael@0 12
michael@0 13 namespace sandbox {
michael@0 14
michael@0 15 class TargetProcess;
michael@0 16
michael@0 17 // This class wraps the code needed to interact with the Windows On Windows
michael@0 18 // subsystem on 64 bit OSes, from the point of view of interceptions.
michael@0 19 class Wow64 {
michael@0 20 public:
michael@0 21 Wow64(TargetProcess* child, HMODULE ntdll)
michael@0 22 : child_(child), ntdll_(ntdll), dll_load_(NULL), continue_load_(NULL) {}
michael@0 23 ~Wow64();
michael@0 24
michael@0 25 // Waits for the 32 bit DLL to get loaded on the child process. This function
michael@0 26 // will return immediately if not running under WOW, or launch the helper
michael@0 27 // process and wait until ntdll is ready.
michael@0 28 bool WaitForNtdll();
michael@0 29
michael@0 30 private:
michael@0 31 // Runs the WOW helper process, passing the address of a buffer allocated on
michael@0 32 // the child (one page).
michael@0 33 bool RunWowHelper(void* buffer);
michael@0 34
michael@0 35 // This method receives "notifications" whenever a DLL is mapped on the child.
michael@0 36 bool DllMapped();
michael@0 37
michael@0 38 // Returns true if ntdll.dll is mapped on the child.
michael@0 39 bool NtdllPresent();
michael@0 40
michael@0 41 TargetProcess* child_; // Child process.
michael@0 42 HMODULE ntdll_; // ntdll on the parent.
michael@0 43 HANDLE dll_load_; // Event that is signaled on dll load.
michael@0 44 HANDLE continue_load_; // Event to signal to continue execution on the child.
michael@0 45 DISALLOW_IMPLICIT_CONSTRUCTORS(Wow64);
michael@0 46 };
michael@0 47
michael@0 48 } // namespace sandbox
michael@0 49
michael@0 50 #endif // SANDBOX_SRC_WOW64_H__

mercurial