#include "classes.h" // 00a9f2b0 void LobbyLocalhost::read_welcome_message(void *data) { uint uVar1; int tagCompare; void *pvVar2; undefined **local_40; void *externalSize; undefined4 local_38; void *bufferBegin; void *bufferEnd; int bufferCapacityEnd; void *externalData; int bufferPos; uint position; uint bufferStart; undefined **innerStream; char local_14 [4]; void *local_10; undefined1 *puStack_c; undefined4 local_8; local_8 = 0xffffffff; puStack_c = &LAB_00b14e3d; local_10 = ExceptionList; uVar1 = __security_cookie ^ GHIDRA_UINT((local_14 + 0x10)); ExceptionList = &local_10; strncpy(this,"lhwm",4); bufferBegin = (void *)0x0; bufferCapacityEnd = 0; local_38 = 0xff; externalSize = (void *)0xff; externalData = data; bufferStart = 0; position = 0; bufferPos = 0; bufferEnd = (void *)0x0; local_40 = KAGE::Filesys::BufferedStream::vftable; innerStream = KAGE::Filesys::BufferedStream::vftable; local_8 = 0; memory_stream_read(&innerStream,local_14,4,1); tagCompare = strncmp(local_14,"lhwm",4); if (tagCompare != 0) { KAGE_LogMessage(0x10,GHIDRA_CAST("Invalid localhost welcome message\n")); } data = (void *)0x0; if ((code *)innerStream[5] == memory_stream_read) { memory_stream_read(&innerStream,&data,4,1); } else { (*(code *)innerStream[5])(&data,4,1,uVar1); } pvVar2 = bufferBegin; if (externalData != (void *)0x0) { pvVar2 = externalData; } *GHIDRA_CAST((GHIDRA_CAST(this) + 8)) = GHIDRA_INT(pvVar2) + position; position = position + GHIDRA_INT(data) * 8; *(void **)(GHIDRA_CAST(this) + 4) = data; data = (void *)(GHIDRA_INT(bufferEnd) - GHIDRA_INT(bufferBegin)); if (externalData != (void *)0x0) { data = externalSize; } if ((position < bufferStart) || (data < (void *)(position - bufferStart))) { (GHIDRA_CAST((&local_40)))->KAGE::Filesys::BufferedStream::rebuffer(); } bufferPos = position - bufferStart; data = (void *)0x0; if ((code *)innerStream[5] == memory_stream_read) { memory_stream_read(&innerStream,&data,4,1); } else { (*(code *)innerStream[5])(&data); } *(void **)(GHIDRA_CAST(this) + 0xc) = data; innerStream = KAGE::Filesys::StreamBase::vftable; local_40 = KAGE::Filesys::BufferedStreamBase::vftable; externalSize = (void *)0x0; local_38 = 0; bufferEnd = bufferBegin; externalData = (void *)0x0; bufferPos = 0; position = 0; bufferStart = 0; if (bufferBegin != (void *)0x0) { uVar1 = bufferCapacityEnd - GHIDRA_INT(bufferBegin); pvVar2 = bufferBegin; if (0xfff < uVar1) { pvVar2 = *(void **)(GHIDRA_CAST(bufferBegin) + -4); uVar1 = uVar1 + 0x23; if (0x1f < GHIDRA_UINT((GHIDRA_INT(bufferBegin) + (-4 - GHIDRA_INT(pvVar2))))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pvVar2,uVar1); } ExceptionList = local_10; return; }