Skip to content

Commit b7b14b3

Browse files
authored
Merge pull request #452 from NotAndreh/appownershipticket
Implementation of Steam_AppTicket::GetAppOwnershipTicketData
2 parents 95d96de + a10ebbc commit b7b14b3

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

dll/appticket.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,32 @@ Steam_AppTicket::Steam_AppTicket(class Settings *settings) :
259259

260260
uint32 Steam_AppTicket::GetAppOwnershipTicketData( uint32 nAppID, void *pvBuffer, uint32 cbBufferLength, uint32 *piAppId, uint32 *piSteamId, uint32 *piSignature, uint32 *pcbSignature )
261261
{
262-
PRINT_DEBUG("TODO %u, %p, %u, %p, %p, %p, %p", nAppID, pvBuffer, cbBufferLength, piAppId, piSteamId, piSignature, pcbSignature);
262+
PRINT_DEBUG("%u, %p, %u, %p, %p, %p, %p", nAppID, pvBuffer, cbBufferLength, piAppId, piSteamId, piSignature, pcbSignature);
263263
std::lock_guard<std::recursive_mutex> lock(global_mutex);
264264

265+
if (pvBuffer != nullptr && cbBufferLength >= 24) {
266+
*reinterpret_cast<uint32_t*>(pvBuffer) = nAppID;
267+
*reinterpret_cast<uint64_t*>(reinterpret_cast<uintptr_t>(pvBuffer) + 8) = settings->get_current_steam_id().ConvertToUint64();
268+
*reinterpret_cast<uint32_t*>(reinterpret_cast<uintptr_t>(pvBuffer) + 16) = 0;
269+
270+
if (piAppId != nullptr) {
271+
*piAppId = 0;
272+
}
273+
274+
if (piSteamId != nullptr) {
275+
*piSteamId = 8;
276+
}
277+
278+
if (piSignature != nullptr) {
279+
*piSignature = 16;
280+
}
281+
282+
if (pcbSignature != nullptr) {
283+
*pcbSignature = 8;
284+
}
285+
286+
return 24;
287+
}
288+
265289
return 0;
266290
}

0 commit comments

Comments
 (0)