|
|
|
@ -347,12 +347,30 @@ bool obf_gen_label(pobfuscator_t obf, pcode_link_t jmp, int32_t delta)
|
|
|
|
|
|
|
|
|
|
bool obf_allocate_group_buffers(pobfuscator_t obf, FnAllocateMem AllocMem)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
for (code_group_t& group : obf->groups)
|
|
|
|
|
{
|
|
|
|
|
group.base_address = (uint64_t)AllocMem(group.size_in_bytes);
|
|
|
|
|
if (!group.base_address)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool obf_copy_groups_into_buffers(pobfuscator_t obf, FnMemCopy MemCopy)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
for (uint32_t i = 0; i < obf->groups.size(); i)
|
|
|
|
|
{
|
|
|
|
|
pcode_group_t group = &obf->groups[i];
|
|
|
|
|
uint64_t cur_addr = group->base_address;
|
|
|
|
|
for (pcode_link_t t = group->start; t && t->group == i; t = t->next)
|
|
|
|
|
{
|
|
|
|
|
if (!(t->flags & CLFLAG_IS_LABEL))
|
|
|
|
|
{
|
|
|
|
|
MemCopy((void*)cur_addr, t->raw_data, t->raw_data_size);
|
|
|
|
|
cur_addr += t->raw_data_size;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#include <Windows.h>
|
|
|
|
|