小编Dis*_*ape的帖子

调用复制函数时访问冲突

这是一个将函数复制到堆上,将其设置为可执行文件并调用它的程序。

#include <iostream>
#include <iomanip>
#include <csignal>
#include <Windows.h>
using std::cout;

#define RET 0xC3

void printBytes(void* start, uintptr_t numBytes) {
    std::ios_base::fmtflags savedFlags(cout.flags());
    cout << std::hex << std::uppercase << std::setfill('0');

    bool lineComplete = false;
    for (unsigned int byte = 0; byte < numBytes; byte++) {
        lineComplete = byte % 4 == 3;
        cout << std::setw(2)
            << (int)*((uint8_t*)start + byte)
            << (lineComplete ? '\n' : ' ');
    }

    cout << (lineComplete ? "\n" : "\n\n");

    cout.flags(savedFlags);
}

uint8_t* findByte(void* start, uint8_t targetByte) …
Run Code Online (Sandbox Code Playgroud)

c++ windows assembly

-5
推荐指数
1
解决办法
78
查看次数

标签 统计

assembly ×1

c++ ×1

windows ×1