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

Side by Side Diff: courgette/program_detector.h

Issue 1629703002: [Courgette] Refactor: Manage AssemblyProgram and EncodedProgram with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix courgette_fuzzer in libfuzzer. Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « courgette/patcher_x86_32.h ('k') | courgette/program_detector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COURGETTE_PROGRAM_DETECTOR_H_
6 #define COURGETTE_PROGRAM_DETECTOR_H_
7
8 #include <stddef.h>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "courgette/courgette.h"
12
13 namespace courgette {
14
15 class AssemblyProgram;
16
17 // Detects the type of an executable file, and it's length. The length may be
18 // slightly smaller than some executables (like ELF), but will include all bytes
19 // the courgette algorithm has special benefit for.
20 // On success:
21 // Fills in |type| and |detected_length|, and returns C_OK.
22 // On failure:
23 // Fills in |type| with UNKNOWN, |detected_length| with 0, and returns
24 // C_INPUT_NOT_RECOGNIZED.
25 Status DetectExecutableType(const void* buffer,
26 size_t length,
27 ExecutableType* type,
28 size_t* detected_length);
29
30 // Attempts to detect the type of executable, and parse it with the appropriate
31 // tools.
32 // On success:
33 // Parses the executable into a new AssemblyProgram in |*output|, and returns
34 // C_OK.
35 // On failure:
36 // Returns an error status and assigns |*output| to null.
37 Status ParseDetectedExecutable(const void* buffer,
38 size_t length,
39 scoped_ptr<AssemblyProgram>* output);
40
41 } // namespace courgette
42
43 #endif // COURGETTE_PROGRAM_DETECTOR_H_
OLDNEW
« no previous file with comments | « courgette/patcher_x86_32.h ('k') | courgette/program_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698