1*a03ca8b9SKrzysztof Kosiński // Copyright 2019 The Chromium Authors. All rights reserved. 2*a03ca8b9SKrzysztof Kosiński // Use of this source code is governed by a BSD-style license that can be 3*a03ca8b9SKrzysztof Kosiński // found in the LICENSE file. 4*a03ca8b9SKrzysztof Kosiński 5*a03ca8b9SKrzysztof Kosiński #ifndef COMPONENTS_ZUCCHINI_FUZZERS_FUZZ_UTILS_H_ 6*a03ca8b9SKrzysztof Kosiński #define COMPONENTS_ZUCCHINI_FUZZERS_FUZZ_UTILS_H_ 7*a03ca8b9SKrzysztof Kosiński 8*a03ca8b9SKrzysztof Kosiński #include <stdint.h> 9*a03ca8b9SKrzysztof Kosiński 10*a03ca8b9SKrzysztof Kosiński #include <memory> 11*a03ca8b9SKrzysztof Kosiński #include <vector> 12*a03ca8b9SKrzysztof Kosiński 13*a03ca8b9SKrzysztof Kosiński #include "components/zucchini/disassembler.h" 14*a03ca8b9SKrzysztof Kosiński 15*a03ca8b9SKrzysztof Kosiński namespace zucchini { 16*a03ca8b9SKrzysztof Kosiński 17*a03ca8b9SKrzysztof Kosiński // Helper function that uses |disassembler| to read all references from 18*a03ca8b9SKrzysztof Kosiński // |mutable_data| and write them back. 19*a03ca8b9SKrzysztof Kosiński void ReadAndWriteReferences( 20*a03ca8b9SKrzysztof Kosiński std::unique_ptr<zucchini::Disassembler> disassembler, 21*a03ca8b9SKrzysztof Kosiński std::vector<uint8_t>* mutable_data); 22*a03ca8b9SKrzysztof Kosiński 23*a03ca8b9SKrzysztof Kosiński } // namespace zucchini 24*a03ca8b9SKrzysztof Kosiński 25*a03ca8b9SKrzysztof Kosiński #endif // COMPONENTS_ZUCCHINI_FUZZERS_FUZZ_UTILS_H_ 26