diff options
Diffstat (limited to 'sandbox/src/resolver_64.cc')
-rw-r--r-- | sandbox/src/resolver_64.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sandbox/src/resolver_64.cc b/sandbox/src/resolver_64.cc index c0accc7..4c736c2 100644 --- a/sandbox/src/resolver_64.cc +++ b/sandbox/src/resolver_64.cc @@ -94,12 +94,26 @@ bool ResolverThunk::SetInternalThunk(void* storage, size_t storage_bytes, NTSTATUS ResolverThunk::ResolveInterceptor(const void* interceptor_module, const char* interceptor_name, const void** address) { - return STATUS_NOT_IMPLEMENTED; + 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) { + // We don't support sidestep & co. return STATUS_NOT_IMPLEMENTED; } |