MCPcopy Create free account
hub / github.com/RischardV/emoji-shellcoding / load_seq

Function load_seq

block/block.cpp:253–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251static std::map<Bytes, Instruction> instructions;
252
253static void load_seq(void)
254{
255 std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
256 const char *seq_file = "build/seq.txt";
257 std::ifstream file(seq_file);
258 if (!file) {
259 std::cerr << "Could not open file '" << seq_file << "'" << std::endl;
260 exit(1);
261 }
262
263 std::string line;
264 while (std::getline(file, line)) {
265 //std::cerr << "XXX:" << line << "##" << std::endl;
266 std::string hex = line.substr(0, line.find(" "));
267 sequences.insert(std::pair<Bytes, Sequence>(hex_to_bytes(hex), Sequence(hex)));
268 }
269
270 std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
271
272 std::cerr << "Loaded " << sequences.size() << " sequences in "
273 << std::chrono::duration_cast<std::chrono::microseconds>(end - begin).count() << "µs" << std::endl;
274}
275
276static void load_instr(bool use_64)
277{

Callers 1

mainFunction · 0.85

Calls 3

hex_to_bytesFunction · 0.85
SequenceClass · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected