diff --git a/Extension/swgshooks.cpp b/Extension/swgshooks.cpp index 003284b..f516e66 100644 --- a/Extension/swgshooks.cpp +++ b/Extension/swgshooks.cpp @@ -84,7 +84,9 @@ EBeginAuthSessionResult SteamWorksGSHooks::BeginAuthSession(const void *pAuthTic { if (this->pOBAS->GetFunctionCount() != 0) { - this->pOBAS->PushArray(pAuthTicket, cbAuthTicket); + char *pszAuthTicket = reinterpret_cast(const_cast(pAuthTicket)); + + this->pOBAS->PushStringEx(pszAuthTicket, cbAuthTicket, SM_PARAM_STRING_BINARY | SM_PARAM_STRING_COPY, 0); this->pOBAS->PushCell(cbAuthTicket); this->pOBAS->PushCell(steamID.GetAccountID()); this->pOBAS->Execute(NULL); diff --git a/Extension/swhttprequest.cpp b/Extension/swhttprequest.cpp index 2315b78..3392f5f 100644 --- a/Extension/swhttprequest.cpp +++ b/Extension/swhttprequest.cpp @@ -588,8 +588,7 @@ static cell_t sm_GetHTTPResponseBodyCallback(IPluginContext *pContext, const cel return 0; } - size_t celllen = ((size / sizeof(cell_t)) + 1); - cell_t *pBuffer = new cell_t[celllen+1]; + char *pBuffer = new char[size+1]; if (pHTTP->GetHTTPResponseBodyData(pRequest->request, reinterpret_cast(pBuffer), size) == false) { @@ -597,10 +596,10 @@ static cell_t sm_GetHTTPResponseBodyCallback(IPluginContext *pContext, const cel return 0; } - pBuffer[celllen] = '\0'; /* Incase users do something bad; we want to protect userspace; kind of. */ - pFunction->PushArray(pBuffer, celllen); /* Strings do a copy... it's really bad :( */ + pBuffer[size] = '\0'; /* Incase users do something bad; we want to protect userspace; kind of. */ + pFunction->PushStringEx(pBuffer, size, SM_PARAM_STRING_BINARY | SM_PARAM_STRING_COPY, 0); pFunction->PushCell(params[3]); - pFunction->PushCell(celllen); + pFunction->PushCell(size); pFunction->Execute(NULL); delete [] pBuffer;