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

Unified Diff: courgette/disassembler_win32_x64.h

Issue 2055343002: Courgette: Add static method QuickDetect() to optimize program detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 4 years, 5 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
« no previous file with comments | « courgette/disassembler_win32.cc ('k') | courgette/disassembler_win32_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_win32_x64.h
diff --git a/courgette/disassembler_win32_x64.h b/courgette/disassembler_win32_x64.h
index 5d8b4c2943f5456bd6c5719413ed23ceaa2b6189..8a0f6f8c7ecd5fa5dfaba5fc7d0c3a406bd91128 100644
--- a/courgette/disassembler_win32_x64.h
+++ b/courgette/disassembler_win32_x64.h
@@ -19,7 +19,13 @@ class AssemblyProgram;
class DisassemblerWin32X64 : public DisassemblerWin32 {
public:
- DisassemblerWin32X64(const void* start, size_t length);
+ // Returns true if a valid executable is detected using only quick checks.
+ static bool QuickDetect(const uint8_t* start, size_t length) {
+ return DisassemblerWin32::QuickDetect(start, length,
+ kImageNtOptionalHdr64Magic);
+ }
+
+ DisassemblerWin32X64(const uint8_t* start, size_t length);
~DisassemblerWin32X64() override = default;
// Disassembler interfaces.
« no previous file with comments | « courgette/disassembler_win32.cc ('k') | courgette/disassembler_win32_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698