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

Unified Diff: courgette/disassembler_elf_32.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.cc ('k') | courgette/disassembler_elf_32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_elf_32.h
diff --git a/courgette/disassembler_elf_32.h b/courgette/disassembler_elf_32.h
index 6bcf1b888b80cd80f3529a3f3900d3f405bee630..f0961c0c7ab2e9e9c9e4e7c5ee3a22e315333e39 100644
--- a/courgette/disassembler_elf_32.h
+++ b/courgette/disassembler_elf_32.h
@@ -94,7 +94,7 @@ class DisassemblerElf32 : public Disassembler {
};
public:
- DisassemblerElf32(const void* start, size_t length);
+ DisassemblerElf32(const uint8_t* start, size_t length);
~DisassemblerElf32() override { }
@@ -121,6 +121,13 @@ class DisassemblerElf32 : public Disassembler {
}
protected:
+ // Returns 'true' if an valid executable is detected using only quick checks.
+ // Derived classes should inject |elf_em| corresponding to their architecture,
+ // which will be checked against the detected one.
+ static bool QuickDetect(const uint8_t* start,
+ size_t length,
+ e_machine_values elf_em);
+
bool UpdateLength();
// Misc Section Helpers
« no previous file with comments | « courgette/disassembler.cc ('k') | courgette/disassembler_elf_32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698