Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(832)

Unified Diff: sandbox/win/src/service_resolver_64.cc

Issue 101203010: Add 64-bit support to browser blacklisting (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sandbox/win/src/service_resolver_64.cc
diff --git a/sandbox/win/src/service_resolver_64.cc b/sandbox/win/src/service_resolver_64.cc
index 473ddbc7f16d806f8b1d86fb245959c4ceb4d3d4..e70c31c713bf7cc8ffd2a14910126d22f73b5bf7 100644
--- a/sandbox/win/src/service_resolver_64.cc
+++ b/sandbox/win/src/service_resolver_64.cc
@@ -56,7 +56,7 @@ struct ServiceEntryW8 {
ULONG mov_r10_rcx_mov_eax; // = 4C 8B D1 B8
ULONG service_id;
USHORT syscall; // = 0F 05
- BYTE ret; // = C2
+ BYTE ret; // = C3
BYTE nop; // = 90
};
@@ -190,4 +190,28 @@ bool Win2kResolverThunk::IsFunctionAService(void* local_thunk) const {
return false;
}
+bool Win8ResolverThunk::IsFunctionAService(void* local_thunk) const {
robertshield 2014/01/07 18:30:47 The ServiceResolverThunk::IsFunctionAService metho
csharp 2014/01/07 20:43:07 Yes it does. I've removed the win8 specific code f
+ ServiceEntryW8 function_code;
+ SIZE_T read;
+ if (!::ReadProcessMemory(process_, target_, &function_code,
+ sizeof(function_code), &read))
+ return false;
+
+ if (sizeof(function_code) != read)
+ return false;
+
+ if (kMov1 != function_code.mov_1 || kMov2 != function_code.mov_2 ||
+ kMov3 != function_code.mov_3 ||
+ kMmovR10EcxMovEax != function_code.mov_r10_rcx_mov_eax ||
+ kSyscall != function_code.syscall ||
+ kRetNp != function_code.ret) {
+ return false;
+ }
+
+ // Save the verified code
+ memcpy(local_thunk, &function_code, sizeof(function_code));
+
+ return true;
+}
+
} // namespace sandbox

Powered by Google App Engine
This is Rietveld 408576698