Вопрос Protobuf allocation causes crash

  • Автор темы Автор темы Cyroc
  • Дата начала Дата начала
Начинающий
Начинающий
Статус
Оффлайн
Регистрация
16 Мар 2025
Сообщения
3
Реакции
0
I am trying to create and allocate the interps for an input entry:
Код:
Expand Collapse Copy
CSGOInterpolationInfoPB_CL* clInterp = CreateInterpMessageCl(cmd->csgoUserCmd.mutable_input_history()->Mutable(i));
 
// make interps if needed
if (!entry->has_cl_interp()) {
    entry->set_allocated_cl_interp(clInterp);
}

Код:
Expand Collapse Copy
CSGOInterpolationInfoPB_CL* CreateInterpMessageCl(CSGOInputHistoryEntryPB* entry) {
    QWORD* v35 = (QWORD*)(*(QWORD*)((uintptr_t)entry + 8) & 0xFFFFFFFFFFFFFFFCuLL);
    if ((*(BYTE*)((uintptr_t)entry + 8) & 1) != 0)
        v35 = (QWORD*)*v35;
    auto func = (CSGOInterpolationInfoPB_CL * (__fastcall*)(QWORD*))addr;
    return func(v35);
}

However I get this error in the debugger:
2qRrcIG.png

Another error was related to the heap being corrupted.
It appears all of this is happening after the allocate function tries to delete the old interp.

Do you know what could be causing this to happen or how to solve it?
 
More information on this:
1.Other errors happen with both AddAllocated and CopyFrom if used(seems like trying to add anything to the repeatedptrfields causes crashing)
2. Manually mapping the dll causes crash on injection
3. Before it crashes it manages to run those functions successfully like 2-3 times, rarely 10 times(when using loadlib)
4 . Protobuf lib version is 3.21.8 and protobufs are compiled using it
5. Even creating the messages through protobuf lib instead of calling game functions doesn't change anything
 
welcome to rebuild game allocation, changing operator new to memalloc alloc, and delete operator to mem alloc free
 
Назад
Сверху Снизу