le crypteur build maintenant

This commit is contained in:
2023-02-10 18:15:37 +01:00
parent 2b4e2bc775
commit ebf35030d3
6 changed files with 66106 additions and 25 deletions

View File

@@ -7,9 +7,8 @@
#include <filesystem>
#include <inttypes.h>
#include <Zydis/Zydis.h>
#include <Zycore/LibC.h>
#include <Zycore/API/Memory.h>
#define ZYDIS_STATIC_BUILD
#include <Zydis.h>
#include "random.hpp"
#include "utils.hpp"
@@ -220,20 +219,19 @@ int main(int argc, char* argv[]) {
if (changed) {
printf(" Instruction %s changed\n", buffer);
// Encode the instruction back to raw bytes.
uint8_t new_bytes[ZYDIS_MAX_INSTRUCTION_LENGTH];
ZyanUSize new_instr_length = sizeof(new_bytes);
ZydisEncoderEncodeInstruction(&enc_req, new_bytes, &new_instr_length);
// Decode and print the new instruction. We re-use the old buffers.
ZydisDecoderDecodeFull(&decoder, new_bytes, new_instr_length, &instruction,
operands);
ZydisFormatterFormatInstruction(&formatter, &instruction, operands,
instruction.operand_count_visible, buffer, sizeof(buffer), 0, NULL);
printf(" New instruction: %s\n", buffer);
}
// Encode the instruction back to raw bytes.
uint8_t new_bytes[ZYDIS_MAX_INSTRUCTION_LENGTH];
ZyanUSize new_instr_length = sizeof(new_bytes);
ZydisEncoderEncodeInstruction(&enc_req, new_bytes, &new_instr_length);
// Decode and print the new instruction. We re-use the old buffers.
ZydisDecoderDecodeFull(&decoder, new_bytes, new_instr_length, &instruction,
operands);
ZydisFormatterFormatInstruction(&formatter, &instruction, operands,
instruction.operand_count_visible, buffer, sizeof(buffer), 0, NULL);
printf(" New instruction: %s\n", buffer);
offset += instruction.length;
runtime_address += instruction.length;
}