Download poc/circledump_direct_driver.cpp from AgentRen/circle-external-buffer-oob-poc: direct link, hf CLI and curl.
- Browser
- Download file 967 Bytes
-
https://huggingface.co/AgentRen/circle-external-buffer-oob-poc/resolve/main/poc/circledump_direct_driver.cpp
- Command line
-
hf download hf://AgentRen/circle-external-buffer-oob-poc/poc/circledump_direct_driver.cpp
-
curl -L -o circledump_direct_driver.cpp https://huggingface.co/AgentRen/circle-external-buffer-oob-poc/resolve/main/poc/circledump_direct_driver.cpp
967 Bytes
| namespace | |
| { | |
| std::vector<char> read_file(const std::string &path) | |
| { | |
| std::ifstream in(path, std::ios::binary | std::ios::ate); | |
| if (!in) | |
| throw std::runtime_error("failed to open input"); | |
| const auto size = in.tellg(); | |
| if (size < 0) | |
| throw std::runtime_error("failed to measure input"); | |
| std::vector<char> data(static_cast<size_t>(size)); | |
| in.seekg(0); | |
| in.read(data.data(), static_cast<std::streamsize>(data.size())); | |
| if (!in) | |
| throw std::runtime_error("failed to read input"); | |
| return data; | |
| } | |
| } // namespace | |
| int main(int argc, char **argv) | |
| { | |
| if (argc != 2) | |
| { | |
| std::cerr << "usage: " << argv[0] << " model.circle\n"; | |
| return 2; | |
| } | |
| auto raw = read_file(argv[1]); | |
| auto *model = circle::GetModel(raw.data()); | |
| circledump::ModelEx modelex{model, &raw}; | |
| std::cout << modelex << std::endl; | |
| return 0; | |
| } | |