Visual C++ appends 0xCC (int3) bytes at the end of functions

前端 未结 3 1342
小蘑菇
小蘑菇 2021-01-25 11:05

This is my first time around, and I really hope you guys can help me, as I have ran out of ideas by now.

I have searched for an answer for a couple of hours now, and cou

3条回答
  •  执念已碎
    2021-01-25 11:30

    The extra bytes are inserted by the compiler to create a memory alignment, so you can't discard it, since you are using the next function as a marker.

    On the other hand, since you are writing the injected code in assembly anyway, you can just as well write the code, compile it, and then put the binary form in a byte array. That's how I would do this, because then you have the exact length.

提交回复
热议问题