xref: /aosp_15_r20/external/zucchini/fuzzers/fuzz_utils.h (revision a03ca8b91e029cd15055c20c78c2e087c84792e4)
1 // Copyright 2019 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 COMPONENTS_ZUCCHINI_FUZZERS_FUZZ_UTILS_H_
6 #define COMPONENTS_ZUCCHINI_FUZZERS_FUZZ_UTILS_H_
7 
8 #include <stdint.h>
9 
10 #include <memory>
11 #include <vector>
12 
13 #include "components/zucchini/disassembler.h"
14 
15 namespace zucchini {
16 
17 // Helper function that uses |disassembler| to read all references from
18 // |mutable_data| and write them back.
19 void ReadAndWriteReferences(
20     std::unique_ptr<zucchini::Disassembler> disassembler,
21     std::vector<uint8_t>* mutable_data);
22 
23 }  // namespace zucchini
24 
25 #endif  // COMPONENTS_ZUCCHINI_FUZZERS_FUZZ_UTILS_H_
26