text
stringlengths
1
24.5M
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <boost/iostreams/device/mapped_file.hpp> #include <boost/program_options.hpp> #include <fstream> #include <iostream> #i...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "InjectDebug.h" #include <utility> #include "DexClass.h" #include "DexLoader.h" #include "DexOutput.h" #include "DexPo...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <vector> #include "ConfigFiles.h" #include "DexLoader.h" #include "DexStore.h" #include "IRList.h" #inclu...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <iostream> #include <sstream> #include <string> #include <vector> #include <sys/stat.h> // mkdir #include <boost/progr...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <iostream> #include "MethodProfiles.h" #include "RedexContext.h" int main(int argc, char* argv[]) { if (argc == 1 ||...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <boost/iostreams/categories.hpp> #include <boost/iostreams/operations.hpp> // NOLINT(facebook-unused-inclu...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "DexCommon.h" #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #inclu...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "DexAccess.h" #include "DexDefs.h" #include <stdint.h> using symdstr = uint32_t; // Offset into symtool s...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "Formatters.h" #include "DexEncoding.h" #include <iomanip> #include <ios> #include <sstream> struct type_to_string { ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "DexCommon.h" #include <stdint.h> #include <string> std::string format_map(ddump_data* rd); std::string f...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "ToolsCommon.h" #include <array> #include <boost/filesystem/operations.hpp> #include <boost/filesystem/path.hpp> #inclu...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "ConfigFiles.h" #include "DexStats.h" #include "DexStore.h" #include "RedexOptions.h" namespace redex { bool dir_is_wr...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <iostream> #include "PositionMap.h" int main(int argc, char** argv) { if (argc < 2) { std::cerr << "Usage: linem...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <boost/scope_exit.hpp> #include <fcntl.h> #include <iostream> #include <memory> #include <string> #include <sys/mman.h> ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <memory> #include <string> #include <utility> #include <vector> struct __attribute__((packed)) PositionItem { uint32_...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <boost/regex.hpp> #include <iostream> #include <string> #include "PositionMap.h" boost::regex trace_regex(R"/(((\s+at\...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <cstdio> #include <cstdlib> #include <getopt.h> // @donotremove #include <regex> #include "DexCommon.h" void print_usa...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "dex.h" #include "DexDefs.h" #include "DexEncoding.h" #include "DexOpcodeDefs.h" #include "OatmealUtil.h" #include "Quic...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "OatmealUtil.h" #include "memory-accounter.h" #include <cstring> #include <functional> #include <vector> ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ // Code for parsing and building OAT files for multiple android versions. See // OatFile::build and OatFile::parse, below. #if _...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "DexDefs.h" #include "OatmealUtil.h" #include <memory> #include <string> #include <utility> #include <vec...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #if __ANDROID__ #include <museum/5.0.0/bionic/libc/android/legacy_stdlib_inlines.h> #include <museum/5.0.0/bionic/libc/ctype.h> #...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "OatmealUtil.h" #include "dump-oat.h" #include <museum/5.0.0/bionic/libc/linux/elf.h> #include <string> ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "OatmealUtil.h" #include "dump-oat.h" #include "memory-accounter.h" #include "vdex.h" #include <getopt.h> #ifndef ANDR...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "memory-accounter.h" #include "OatmealUtil.h" #include <algorithm> #include <cstring> #include <vector> namespace { /...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "OatmealUtil.h" #include <memory> class MemoryAccounter; class MemoryAccounterScope { friend class Me...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "OatmealUtil.h" #include <cerrno> #include <cstring> #include <sys/stat.h> void write_buf(FileHandle& fh, ConstBuffer b...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "DexEncoding.h" #include "DexOpcodeDefs.h" #include "file-utils.h" #include <cstdio> #include <limits> #i...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "vdex.h" namespace { size_t size_of_checksums_section(const VdexFileHeader& header) { return sizeof(VdexChecksum) * ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "OatmealUtil.h" #include "dex.h" #include "memory-accounter.h" constexpr uint32_t kVdexMagicNum = 0x78656...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <gtest/gtest.h> #include <memory> #include "../OatmealUtil.h" TEST(OatmealUtil, empty) { EXPECT_EQ(1u, roundUpToPowe...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "MethodOverrideGraph.h" #include <fstream> #include "Creators.h" #include "Debug.h" #include "DexClass.h" #include "Re...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "Reachability.h" #include <fstream> #include "Creators.h" #include "Debug.h" #include "DexAnnotation.h" #include "DexC...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <json/reader.h> #include <json/value.h> #include <json/writer.h> #include <cstring> #include <ctime> #include <filesyst...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <boost/filesystem/operations.hpp> #include <boost/filesystem/path.hpp> #include <boost/program_options/options_descripti...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <array> #include <queue> #include <unordered_map> #include <vector> #include "ControlFlow.h" #include "IRCode.h" #inclu...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* Workflow: $ ./native/redex/redex.py -u <APK> $ buck run //native/redex:redex-tool -- dex-sql-dump \ --apkdir <APKDIR>...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "DexClass.h" #include "DexInstruction.h" #include "DexUtil.h" #include "JarLoader.h" #include "ProguardConfiguration.h" ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ // Workflow: // // $ redex-tool dump-s-exprs \ // --apkdir <APKDIR> --dexendir <DEXEN_DIR> \ // --jars <ANDROID_JAR> //...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "RedexTool.h" #include <iostream> #include <stdio.h> #include <string.h> #include "RedexContext.h" #include "Tool.h" #...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "DexCommon.h"
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <fstream> #include <iostream> #include "DexUtil.h" #include "ProguardMap.h" #include "Show.h" #include "Tool.h" #includ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <algorithm> #include <map> #include <string> #include <vector> #include "DeterministicContainers.h" #include "DexClass....
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "ControlFlow.h" #include "IRCode.h" #include "ScopedCFG.h" #include "Show.h" #include "Tool.h" #include "Walkers.h" nam...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "DexDebugInstruction.h" #include "DexEncoding.h" #include "Formatters.h" #include "PrintUtil.h" #include "RedexDump.h" #...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "PrintUtil.h" #include <cstdarg> #include <stdio.h> bool clean = false; bool raw = false; bool escape = false; void re...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <stdint.h> extern bool clean; extern bool raw; extern bool escape; void redump(const char* format, ...);...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "RedexDump.h" #include <getopt.h> #include <stdio.h> #include <stdlib.h> #include "Formatters.h" #include "PrintUtil.h"...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "DexCommon.h" void dump_strings(ddump_data* rd, bool print_headers); void dump_stringdata(ddump_data* rd,...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <boost/algorithm/string.hpp> #include <boost/filesystem/directory.hpp> #include <boost/filesystem/operations.hpp> #inclu...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <boost/program_options/options_description.hpp> #include <boost/program_options/parsers.hpp> #include <boo...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "ToolRegistry.h" #include "Tool.h" ToolRegistry& ToolRegistry::get() { static ToolRegistry registry; return registr...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <vector> class Tool; /** * Global registry of tools. Construction of a tool automatically registers *...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <iostream> #include <string> #include <vector> #include "DexClass.h" #include "DexLoader.h" #include "DexStore.h" #incl...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <boost/iostreams/device/mapped_file.hpp> #include <boost/none.hpp> #include <boost/optional/optional.hpp> #include <cstd...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "CommandProfiling.h" #if defined(__unix__) || defined(__APPLE__) #include <signal.h> #include <sys/wait.h> #include <un...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <boost/none.hpp> #include <boost/optional/optional.hpp> #include <string> #include <unistd.h> #include <utility> class ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <boost/filesystem/operations.hpp> #include <boost/filesystem/path.hpp> #include <fstream> #include <iostream> #include <...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "JemallocUtil.h" #include <iostream> #ifdef USE_JEMALLOC #include <jemalloc/jemalloc.h> #include <json/json.h> #includ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <cstdint> #include <cstdio> #include <functional> #include <string> namespace jemalloc_util { void enable_profiling();...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "DeterministicContainers.h" #include "DexClass.h" #include "MethodUtil.h" namespace kotlin_nullcheck_wrap...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** * Randomized malloc, for detecting memory-based non-determinisms in redex. * To use, build redex-all-malloc-dbg, and then r...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once namespace malloc_debug { // NOLINTNEXTLINE(misc-definitions-in-headers) void __attribute__((weak)) set_shutdown() ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <functional> #include <map> #include "Debug.h" #include "DeterministicContainers.h" /* * Collection typ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* * This implementation of SHA1 is taken from HHVM with minor style edits: * https://github.com/facebook/hhvm */ #include ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once /* * This implementation of SHA1 is taken from HHVM with minor style edits: * https://github.com/facebook/hhvm ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <cstring> #include <memory> #include <string> #include <unordered_set> #include <vector> inline std::stri...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <type_traits> namespace template_util { template <typename...> struct contains; template <typename T> s...
/**************************************************************************/ /* core_bind.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* core_bind.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* core_constants.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* core_constants.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* core_globals.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* core_string_names.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* doc_data.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* doc_data.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* register_core_types.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* register_core_types.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* typedefs.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* version.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* engine.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* engine.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* project_settings.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* project_settings.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* aes_context.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* aes_context.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* crypto.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* crypto.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* crypto_core.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* crypto_core.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* hashing_context.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* hashing_context.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* debugger_marshalls.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* debugger_marshalls.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* engine_debugger.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* engine_debugger.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* engine_profiler.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* engine_profiler.h */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* local_debugger.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
/**************************************************************************/ /* local_debugger.h */ /**************************************************************************/ /* This file is part of: */ /* ...