We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem with the build : d568885
void test_uc_mem_map() { uc_engine *uc; uc_err err = uc_open(UC_ARCH_X86, UC_MODE_64, &uc); if (err != UC_ERR_OK) { throw std::runtime_error("Failed to initialize Unicorn engine: " + std::string(uc_strerror(err))); } constexpr uint64_t start_address = 0x100000; constexpr size_t map_size = 0x1000; uint8_t test_data[map_size] = {0x90}; // crash // !tcg_op_supported_x86_64() C // !tcg_set_frame_x86_64() C // !tcg_prologue_init_x86_64() C // !tcg_exec_init_x86_64() C // !machine_initialize() C // !uc_hook_del() C // !uc_mem_map() C err = uc_mem_map(uc, start_address, map_size, UC_PROT_ALL); if (err != UC_ERR_OK) { uc_close(uc); throw std::runtime_error("Failed to map memory: " + std::string(uc_strerror(err))); } std::cout << "Memory mapped successfully at address: 0x" << std::hex << start_address << "\n"; err = uc_mem_write(uc, start_address, test_data, map_size); if (err != UC_ERR_OK) { uc_close(uc); throw std::runtime_error("Failed to write to memory: " + std::string(uc_strerror(err))); } std::cout << "Memory written successfully.\n"; uint8_t read_data[map_size] = {0}; err = uc_mem_read(uc, start_address, read_data, map_size); if (err != UC_ERR_OK) { uc_close(uc); throw std::runtime_error("Failed to read memory: " + std::string(uc_strerror(err))); } for (size_t i = 0; i < map_size; i++) { if (read_data[i] != test_data[i]) { uc_close(uc); throw std::runtime_error("Memory validation failed at offset: " + std::to_string(i)); } } std::cout << "Memory validation succeeded.\n"; uc_close(uc); std::cout << "Unicorn engine closed.\n"; }
The text was updated successfully, but these errors were encountered:
Probably #1841
Sorry, something went wrong.
Closing as no activity.
No branches or pull requests
problem with the build : d568885
The text was updated successfully, but these errors were encountered: