security/sandbox/win/src/eat_resolver.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/sandbox/win/src/eat_resolver.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +// Copyright (c) 2010 The Chromium Authors. All rights reserved.
     1.5 +// Use of this source code is governed by a BSD-style license that can be
     1.6 +// found in the LICENSE file.
     1.7 +
     1.8 +#ifndef SANDBOX_SRC_EAT_RESOLVER_H__
     1.9 +#define SANDBOX_SRC_EAT_RESOLVER_H__
    1.10 +
    1.11 +#include "base/basictypes.h"
    1.12 +#include "sandbox/win/src/nt_internals.h"
    1.13 +#include "sandbox/win/src/resolver.h"
    1.14 +
    1.15 +namespace sandbox {
    1.16 +
    1.17 +// This is the concrete resolver used to perform exports table interceptions.
    1.18 +class EatResolverThunk : public ResolverThunk {
    1.19 + public:
    1.20 +  EatResolverThunk() : eat_entry_(NULL) {}
    1.21 +  virtual ~EatResolverThunk() {}
    1.22 +
    1.23 +  // Implementation of Resolver::Setup.
    1.24 +  virtual NTSTATUS Setup(const void* target_module,
    1.25 +                         const void* interceptor_module,
    1.26 +                         const char* target_name,
    1.27 +                         const char* interceptor_name,
    1.28 +                         const void* interceptor_entry_point,
    1.29 +                         void* thunk_storage,
    1.30 +                         size_t storage_bytes,
    1.31 +                         size_t* storage_used);
    1.32 +
    1.33 +  // Implementation of Resolver::ResolveTarget.
    1.34 +  virtual NTSTATUS ResolveTarget(const void* module,
    1.35 +                                 const char* function_name,
    1.36 +                                 void** address);
    1.37 +
    1.38 +  // Implementation of Resolver::GetThunkSize.
    1.39 +  virtual size_t GetThunkSize() const;
    1.40 +
    1.41 + private:
    1.42 +  // The entry to patch.
    1.43 +  DWORD* eat_entry_;
    1.44 +
    1.45 +  DISALLOW_COPY_AND_ASSIGN(EatResolverThunk);
    1.46 +};
    1.47 +
    1.48 +}  // namespace sandbox
    1.49 +
    1.50 +
    1.51 +#endif  // SANDBOX_SRC_EAT_RESOLVER_H__

mercurial