diff options
Diffstat (limited to 'sandbox/src/resolver_64.cc')
-rw-r--r-- | sandbox/src/resolver_64.cc | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/sandbox/src/resolver_64.cc b/sandbox/src/resolver_64.cc index 4c736c2..96d039b 100644 --- a/sandbox/src/resolver_64.cc +++ b/sandbox/src/resolver_64.cc @@ -4,7 +4,6 @@ #include "sandbox/src/resolver.h" -#include "base/pe_image.h" #include "sandbox/src/sandbox_nt_util.h" namespace { @@ -44,37 +43,6 @@ struct InternalThunk { namespace sandbox { -NTSTATUS ResolverThunk::Init(const void* target_module, - const void* interceptor_module, - const char* target_name, - const char* interceptor_name, - const void* interceptor_entry_point, - void* thunk_storage, - size_t storage_bytes) { - if (NULL == thunk_storage || 0 == storage_bytes || - NULL == target_module || NULL == target_name) - return STATUS_INVALID_PARAMETER; - - if (storage_bytes < GetThunkSize()) - return STATUS_BUFFER_TOO_SMALL; - - NTSTATUS ret = STATUS_SUCCESS; - if (NULL == interceptor_entry_point) { - ret = ResolveInterceptor(interceptor_module, interceptor_name, - &interceptor_entry_point); - if (!NT_SUCCESS(ret)) - return ret; - } - - ret = ResolveTarget(target_module, target_name, &target_); - if (!NT_SUCCESS(ret)) - return ret; - - interceptor_ = interceptor_entry_point; - - return ret; -} - size_t ResolverThunk::GetInternalThunkSize() const { return sizeof(InternalThunk); } @@ -91,25 +59,6 @@ bool ResolverThunk::SetInternalThunk(void* storage, size_t storage_bytes, return true; } -NTSTATUS ResolverThunk::ResolveInterceptor(const void* interceptor_module, - const char* interceptor_name, - const void** address) { - DCHECK_NT(address); - if (!interceptor_module) - return STATUS_INVALID_PARAMETER; - - PEImage pe(interceptor_module); - if (!pe.VerifyMagic()) - return STATUS_INVALID_IMAGE_FORMAT; - - *address = pe.GetProcAddress(interceptor_name); - - if (!(*address)) - return STATUS_PROCEDURE_NOT_FOUND; - - return STATUS_SUCCESS; -} - NTSTATUS ResolverThunk::ResolveTarget(const void* module, const char* function_name, void** address) { |