mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-03-06 14:00:22 +00:00
Fixed bad memory management in reIterNext occasionally causing junk returns
This commit is contained in:
parent
b4bbf80dcb
commit
ee256dfe16
2 changed files with 7 additions and 1 deletions
|
|
@ -485,5 +485,8 @@ const char* reIterNext(Linker::SimObject* obj, S32 argc, const char* argv[])
|
|||
std::string currentResult = (*currentMatchIter).str();
|
||||
++currentMatchIter;
|
||||
|
||||
return currentResult.data();
|
||||
char* result = Con::getReturnBuffer(currentResult.size() + 1);
|
||||
memcpy(result, currentResult.data(), currentResult.size() + 1);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -408,6 +408,7 @@ __declspec(naked) void updateMoveHook()
|
|||
// Init WSA
|
||||
WSADATA wsadata;
|
||||
WSAStartup(0x0202, &wsadata);
|
||||
|
||||
Con::addMethodS(NULL,"dumpHex",&conDumpHex,"dumpHex(addr,size,spaces)",4,5);
|
||||
Con::addMethodS(NULL,"dumpDec",&conDumpUInt,"dumpDec(addr)",2,3);
|
||||
Con::addMethodS(NULL,"dumpFloat",&conDumpFloat,"dumpFloat(addr)",2,3);
|
||||
|
|
@ -482,7 +483,9 @@ __declspec(naked) void updateMoveHook()
|
|||
char dbclient[3]="\x90\x90";
|
||||
char gboaonadd[8]="FF\x25\xAA\xAA\xAA\xAA";
|
||||
//memPatch("42e05f",
|
||||
#ifdef MECH_MOVE_CODE
|
||||
*((unsigned int*)(mechcode+1))=(unsigned int)&updatemovehookptr;
|
||||
#endif
|
||||
*((unsigned int*)(dbpack+1))=(unsigned int)&DBpackData;
|
||||
*((unsigned int*)(dbunpack+1))=(unsigned int)&DBunpackData;
|
||||
*((unsigned int*)(gboaonadd+2))=(unsigned int)&gboaptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue