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

Unified Diff: courgette/disassembler_elf_32_arm.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_elf_32.cc ('k') | courgette/disassembler_elf_32_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_elf_32_arm.h
diff --git a/courgette/disassembler_elf_32_arm.h b/courgette/disassembler_elf_32_arm.h
index 83f5dc6a237b8dc6cdd098ca3906c750227684c5..24b8aa83c7002b642ddb543ff0cb6c81b31b1a34 100644
--- a/courgette/disassembler_elf_32_arm.h
+++ b/courgette/disassembler_elf_32_arm.h
@@ -28,6 +28,11 @@ enum ARM_RVA {
class DisassemblerElf32ARM : public DisassemblerElf32 {
public:
+ // Returns true if a valid executable is detected using only quick checks.
+ static bool QuickDetect(const uint8_t* start, size_t length) {
+ return DisassemblerElf32::QuickDetect(start, length, EM_ARM);
+ }
+
class TypedRVAARM : public TypedRVA {
public:
TypedRVAARM(ARM_RVA type, RVA rva) : TypedRVA(rva), type_(type) { }
@@ -47,7 +52,7 @@ class DisassemblerElf32ARM : public DisassemblerElf32 {
const uint8_t* arm_op_;
};
- DisassemblerElf32ARM(const void* start, size_t length);
+ DisassemblerElf32ARM(const uint8_t* start, size_t length);
~DisassemblerElf32ARM() override { }
« no previous file with comments | « courgette/disassembler_elf_32.cc ('k') | courgette/disassembler_elf_32_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698