Commit 469d7602 authored by SR_team's avatar SR_team 💬

Calc code size

parent e6d3e3ac
......@@ -450,13 +450,12 @@ namespace SRHook {
void alloc() {
// FIXME: Не обрабатывается ошибка нехватки памяти
if ( code == nullptr ) {
codeAllocated = 256;
codeAllocated = 257 + size;
code = Allocator::alloc<uint8_t>( codeAllocated );
} else {
codeAllocated *= 2;
code = Allocator::realloc<uint8_t>( code, codeAllocated );
}
code[codeAllocated - 1] = 0xCC; // int3
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment