Files
isaac-port/generated-src/online_chat.cpp
T
shweetandClaude Opus 5.5 3ce74c6e2d Reconstruction layout: generated-src/ (generated) and src/ (curated), CMake, the first takeover: RNG
The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function
defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body.
src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read
from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT,
from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra).
structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:10:23 -05:00

584 lines
20 KiB
C++

#include "classes.h"
// 0091d2b0
void OnlineChat::render(Vector *position, byte isInputLine, byte isCursorVisible, float alpha)
{
int iVar1;
KColor color;
KColor color_00;
uint uVar2;
Entity_Player *player;
int iVar3;
byte *lastLine;
void *this_00;
int iVar4;
undefined4 uVar5;
undefined4 extraout_ECX;
int unused;
Font *drawFont;
float lineHeight;
float fVar6;
float fVar7;
undefined1 cursorQuad [44];
float local_f4;
float local_e0;
float local_cc;
float local_b8;
undefined4 local_b0;
undefined4 local_ac;
undefined4 local_a8;
undefined4 local_a4;
undefined4 local_a0;
undefined4 local_9c;
undefined4 local_98;
int textColorUnk;
undefined4 textBlue;
undefined4 textGreen;
undefined4 textRed;
undefined4 local_84;
undefined4 local_80;
undefined4 local_7c;
undefined4 local_78;
undefined4 local_74;
undefined4 local_70;
undefined4 local_6c;
undefined4 local_68;
uint local_64;
undefined4 local_60;
undefined4 local_5c;
KColor local_58;
float offsetY;
float offsetX;
Vector local_3c;
Vector local_34;
float messageOffsetX;
Font *font;
float alphaLocal;
Vector local_20 [2];
void *local_10;
undefined1 *puStack_c;
float local_8;
float fontScale;
local_8 = -NAN;
puStack_c = &LAB_00b0a3ae;
local_10 = ExceptionList;
ExceptionList = &local_10;
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 8));
drawFont = *GHIDRA_CAST<Font **>((*GHIDRA_CAST<int *>(this) + 0x5d8));
font = drawFont;
alphaLocal = alpha;
if (iVar4 == 0) {
LAB_0091d341:
sprintf(&DAT_00c93010,&s_empty);
}
else {
local_20[0].y = *GHIDRA_CAST<float *>((iVar4 + 8));
iVar3 = *GHIDRA_CAST<int *>((iVar4 + 0xc));
if (*GHIDRA_CAST<int *>((iVar4 + 8)) == 0 && iVar3 == 0) goto LAB_0091d341;
uVar2 = __ftoui3(__security_cookie ^ GHIDRA_UINT(&local_20[3].y));
user_profile_format_display_name(CONCAT44(iVar3,local_20[0].y),drawFont,uVar2);
sprintf(&DAT_00c93010,&DAT_00b6d198);
}
g_graphicsManager_blendMode[1] = 1;
g_graphicsManager_blendMode[0] = 0;
if (((byte)g_graphicsManager_flags & 4) == 0) {
g_graphicsManager_blendMode[1] = 6;
}
g_graphicsManager_blendMode[2] = 7;
g_graphicsManager_blendMode[3] = 1;
g_graphicsManager_blendMode[4] = 7;
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 8));
iVar3 = *GHIDRA_CAST<int *>(this);
if (iVar4 == 0) {
local_20[0].y = 0.0;
local_20[0].x = 0.0;
}
else {
local_20[0].x = *GHIDRA_CAST<float *>((iVar4 + 8));
local_20[0].y = *GHIDRA_CAST<float *>((iVar4 + 0xc));
}
if (((*GHIDRA_CAST<char *>((iVar3 + 0x5f0)) == '\0') ||
(player = PlayerManager::get_player_by_user_id
(GHIDRA_CAST<PlayerManager *>(&g_manager->_netplayManager),GHIDRA_CAST<ulonglong *>(local_20)),
player == GHIDRA_CAST<Entity_Player *>(0x0))) ||
(player = GHIDRA_CAST<Entity_Player *>(FUN_004253d0()), player == GHIDRA_CAST<Entity_Player *>(0x0))) {
local_58._red = *GHIDRA_CAST<float *>((iVar3 + 0x5dc));
local_58._unk = *GHIDRA_CAST<int *>((iVar3 + 0x5ec));
local_58._green = *GHIDRA_CAST<float *>((iVar3 + 0x5e0));
local_58._blue = *GHIDRA_CAST<float *>((iVar3 + 0x5e4));
}
else {
(GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity_Familiar *>(&g_game->_playerManager))))->Entity_Familiar::GetPlayerSlot(&local_58,player);
iVar3 = *GHIDRA_CAST<int *>(this);
}
drawFont = font;
local_58._alpha = alphaLocal * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x28));
textColorUnk = *GHIDRA_CAST<int *>((iVar3 + 0x5ec));
textRed = *GHIDRA_CAST<undefined4 *>((iVar3 + 0x5dc));
textGreen = *GHIDRA_CAST<undefined4 *>((iVar3 + 0x5e0));
textBlue = *GHIDRA_CAST<undefined4 *>((iVar3 + 0x5e4));
alphaLocal = local_58._alpha;
iVar3 = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(&DAT_00c93010,-1);
iVar4 = *GHIDRA_CAST<int *>(this);
local_3c.x = *GHIDRA_CAST<float *>((iVar4 + 0x5f4));
offsetX = local_3c.x * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1c));
offsetY = local_3c.x * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x20));
messageOffsetX =
local_3c.x * *GHIDRA_CAST<float *>((iVar4 + 0x610)) +
(float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) * local_3c.x;
lineHeight = local_3c.x * *GHIDRA_CAST<float *>((iVar4 + 0x608));
local_3c.y = local_3c.x;
local_20[0].y = local_3c.x;
if (isInputLine == 0) {
uVar5 = 0xffff;
local_34.y = (float)((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10))) / 0xc - 1);
if (GHIDRA_INT(local_34.y) < 0) {
fVar6 = position->y;
}
else {
_isInputLine = GHIDRA_INT(local_34.y) * 0xc;
do {
fVar6 = local_34.y;
FormattedText::FormattedText
(-GHIDRA_UINT((GHIDRA_UINT(local_34.y) <
GHIDRA_UINT(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10))) / 0xc)))) &
_isInputLine + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10)),uVar5);
local_7c = 0;
local_78 = 0xffff;
local_74 = 0;
local_70 = 0x3f800000;
local_6c = 0xffffffff;
local_68 = 0;
local_64 = 0;
local_8 = 5.60519e-45;
color_00._green = (float)textGreen;
color_00._red = (float)textRed;
color_00._blue = (float)textBlue;
color_00._alpha = alphaLocal;
color_00._unk = textColorUnk;
Font::render_glyph_quads
(font,&local_a4,(position->x - offsetX) + messageOffsetX,
(position->y - offsetY) + 0.0,local_20[0].y,local_20[0].y,color_00,&local_7c);
local_8 = -NAN;
std::vector<12byte>::clear();
std::vector<12byte>::_Tidy();
local_34.y = (float)(GHIDRA_INT(fVar6) - 1);
fVar6 = position->y - lineHeight;
_isInputLine = _isInputLine + -0xc;
position->y = fVar6;
uVar5 = extraout_ECX;
} while (-1 < GHIDRA_INT(local_34.y));
drawFont = font;
}
local_7c = 0;
local_78 = 0xffff;
local_74 = 0;
local_70 = 0x3f800000;
local_6c = 0xffffffff;
local_68 = 0;
local_64 = 0;
local_8 = 7.00649e-45;
local_20[0].y = (fVar6 - offsetY) + lineHeight;
local_20[0].x = (position->x - offsetX) + 0.0;
(GHIDRA_CAST<Font *>((drawFont)))->Font::DrawString(&DAT_00c93010,local_20,&local_3c,&local_58,&local_7c);
}
else {
local_b0 = 0;
local_ac = 0xffff;
local_a8 = 0;
local_a4 = 0x3f800000;
local_a0 = 0xffffffff;
local_9c = 0;
local_98 = 0;
local_8 = 0.0;
local_34.x = position->x - offsetX;
local_34.y = position->y - offsetY;
(GHIDRA_CAST<Font *>((drawFont)))->Font::DrawString(&DAT_00c93010,&local_34,&local_3c,&local_58,&local_b0);
local_8 = -NAN;
local_34.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x10));
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14)) - GHIDRA_INT(local_34.y);
_isInputLine = 0;
if (0 < iVar4 / 0xc) {
local_3c.y = 0.0;
do {
FormattedText::FormattedText
(-GHIDRA_UINT((_isInputLine <
GHIDRA_UINT(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14)) - GHIDRA_INT(local_34.y)) / 0xc)))) &
GHIDRA_INT(local_3c.y) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10)),iVar4);
local_60 = 0;
local_5c = 0xffff;
local_58._red = 0.0;
local_58._green = 1.0;
local_58._blue = -NAN;
local_58._alpha = 0.0;
local_58._unk = 0;
local_8 = 2.8026e-45;
color._green = (float)textGreen;
color._red = (float)textRed;
color._blue = (float)textBlue;
color._alpha = alphaLocal;
color._unk = textColorUnk;
Font::render_glyph_quads
(drawFont,&local_a4,(position->x - offsetX) + messageOffsetX,
(position->y - offsetY) + 0.0,local_20[0].y,local_20[0].y,color,&local_60);
local_8 = -NAN;
std::vector<12byte>::clear();
std::vector<12byte>::_Tidy();
_isInputLine = _isInputLine + 1;
local_3c.y = (float)(GHIDRA_INT(local_3c.y) + 0xc);
position->y = lineHeight + position->y;
local_34.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x10));
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14)) - GHIDRA_INT(local_34.y);
} while (GHIDRA_INT(_isInputLine) < iVar4 / 0xc);
goto LAB_0091d913;
}
}
local_8 = -NAN;
LAB_0091d913:
if (isCursorVisible != 0) {
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14));
iVar3 = (iVar4 - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10))) / 0xc;
if (iVar3 == 0) {
fVar6 = 0.0;
}
else {
uVar2 = iVar3 - 1;
if (uVar2 < GHIDRA_UINT(((iVar4 - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10))) / 0xc))) {
lastLine = *GHIDRA_CAST<byte **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10)) + 4 + uVar2 * 0xc));
}
else {
lastLine = GHIDRA_CAST<byte *>(0x0);
}
iVar3 = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(lastLine,-1);
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14));
fVar6 = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]);
}
iVar4 = iVar4 - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10));
iVar3 = *GHIDRA_CAST<int *>(this);
fVar7 = 0.0;
fontScale = *GHIDRA_CAST<float *>((iVar3 + 0x5f4));
iVar1 = iVar4 >> 0x1f;
fVar6 = messageOffsetX + position->x + fVar6 * fontScale;
if (iVar4 / 0xc + iVar1 == iVar1) {
fVar6 = fVar6 - 1.0;
lineHeight = 0.0;
}
else {
fVar6 = fVar6 + 1.0;
}
local_58._red = *GHIDRA_CAST<float *>((iVar3 + 0x5dc));
local_58._green = *GHIDRA_CAST<float *>((iVar3 + 0x5e0));
local_58._blue = *GHIDRA_CAST<float *>((iVar3 + 0x5e4));
local_58._alpha = *GHIDRA_CAST<float *>((iVar3 + 0x5e8));
local_58._unk = *GHIDRA_CAST<int *>((iVar3 + 0x5ec));
lineHeight = position->y - lineHeight;
render_quad_set_uniform_color
(cursorQuad,fVar6,fontScale * 9.0 + lineHeight,fontScale * 6.0 + fVar6,
fontScale * 11.0 + lineHeight,&local_58);
if ((local_f4 + local_e0 + local_cc + local_b8) * 0.25 != fVar7) {
shader_push(GHIDRA_CAST<byte *>("KAGE_ColorShader"));
local_74 = 0;
local_84 = 0;
local_78 = 0;
local_80 = 0;
local_6c = 0x3f800000;
local_7c = 0x3f800000;
local_68 = 0x3f800000;
local_70 = 0x3f800000;
local_64 = local_64 & 0xffffff00;
this_00 = kage_graphics_flush((void *)0x0);
render_quad_draw(this_00,&local_84,cursorQuad,1,unused);
FUN_00a14200();
}
}
ExceptionList = local_10;
return;
}
// 0091db20
void OnlineChat::destructor()
{
int *memberMap;
uint uVar1;
int *in_ECX;
void *local_10;
undefined1 *puStack_c;
undefined4 uStack_8;
uStack_8 = 0xffffffff;
puStack_c = &LAB_00af0a50;
local_10 = ExceptionList;
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
ExceptionList = &local_10;
(GHIDRA_CAST<LobbyList *>((in_ECX)))->LobbyList::clear();
memberMap = in_ECX + 0x188;
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
(memberMap,(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)memberMap,
*(_Tree_node<unsigned_int,void*> **)(in_ECX[0x188] + 4));
operator_delete((void *)*memberMap,0x20);
std::vector<12byte>::clear(uVar1);
std::vector<12byte>::_Tidy();
in_ECX[10] = GHIDRA_INT(KAGE)::System::UserProfileBase::vftable;
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((in_ECX + 3)))))->std::string::_Tidy_deallocate();
std::map<u64_LobbyListEntry>::_Erase_tree(in_ECX,*GHIDRA_CAST<undefined4 *>((*in_ECX + 4)));
operator_delete((void *)*in_ECX,0x48);
ExceptionList = local_10;
return;
}
// 0091e650
void OnlineChat::render_all(Vector *pos, byte isFocused)
{
Vector *pVVar1;
undefined3 in_stack_00000009;
Vector linePos;
float alpha;
pVVar1 = pos;
if (isFocused == 0) {
alpha = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x54));
if (alpha <= 0.0) {
return;
}
}
else {
alpha = 1.0;
}
if (*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 8)) != 0) {
linePos.x = pos->x + 0.0;
linePos.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x608)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x5f4)) + pos->y;
render((void *)(GHIDRA_INT(this) + 0x24),&linePos,1,(byte)(*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 8)) / 0x19) & 1,alpha);
}
linePos.x = pVVar1->x;
linePos.y = pVVar1->y;
pos = *GHIDRA_CAST<Vector **>(this);
if (pos != GHIDRA_CAST<Vector *>(pos->x)) {
do {
_isFocused = pos;
(GHIDRA_CAST<std::_Tree_iterator *>((&isFocused)))->std::_Tree_iterator::operator_decrement();
render(_isFocused + 3,&linePos,0,0,alpha);
(GHIDRA_CAST<std::_Tree_iterator *>((&pos)))->std::_Tree_iterator::operator_decrement();
} while (pos != GHIDRA_CAST<Vector *>(**(int **))this);
}
return;
}
// 0091e7c0
void OnlineChat::broadcast_message(std_string *text)
{
char isLastRef;
uint uVar1;
int *steamUtils;
undefined4 *puVar2;
void *data;
void *messageRefCount;
undefined **stream;
void *local_60;
undefined4 local_5c;
void *streamBuffer;
void *local_54;
void *streamHeapBuffer;
undefined4 local_48;
undefined4 local_44;
undefined4 local_40;
undefined **streamWriter;
undefined1 local_38 [4];
int *messageRefCountPtr;
undefined4 senderId;
uint local_2c [2];
uint textLength;
undefined1 *puStack_20;
void *local_1c;
undefined1 *puStack_18;
uint local_14;
Manager *manager;
puStack_20 = GHIDRA_CAST<undefined1 *>((local_2c + 10));
local_14 = 0xffffffff;
puStack_18 = &LAB_00b0a485;
local_1c = ExceptionList;
uVar1 = __security_cookie ^ GHIDRA_UINT((local_2c + 7));
ExceptionList = &local_1c;
apply_roll_command(text);
textLength = text->_size;
(GHIDRA_CAST<KAGE::Filesys::BufferedStream *>((&stream)))->KAGE::Filesys::BufferedStream::BufferedStream(0);
local_14 = 0;
steamUtils = GHIDRA_CAST<int *>(SteamInternal_ContextInit(&PTR_FUN_00c5c4ec,uVar1));
if (*steamUtils == 0) {
senderId = 1;
}
else {
puVar2 = GHIDRA_CAST<undefined4 *>(SteamInternal_ContextInit(&PTR_FUN_00c5c4ec,uVar1));
senderId = (**(code **)(*GHIDRA_CAST<int *>(*puVar2) + 0xc))();
}
local_2c[0] = 0;
(*(code *)streamWriter[7])(&senderId,8,1);
uVar1 = textLength;
local_2c[0] = textLength & 0xffff;
(*(code *)streamWriter[7])(local_2c,2,1);
if (0xf < text->_capacity) {
text = *GHIDRA_CAST<std_string **>(text->_buf);
}
buffered_stream_write(&streamWriter,text,1,uVar1);
data = streamBuffer;
if (streamHeapBuffer != (void *)0x0) {
data = streamHeapBuffer;
}
if (g_multiplayerService == (void *)0x0) {
KAGE_LogMessage(0x10,(byte *)
"Attempting to create a message when there is no multiplayer service\n");
}
messageRefCount = (void *)0xa;
NetConnection::send_message(g_multiplayerService,local_38,1,data,GHIDRA_UINT(local_60),10);
manager = g_manager;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
FUN_008ef1d0(local_38);
(GHIDRA_CAST<NetplayManager *>((&manager->_netplayManager)))->NetplayManager::send_message(0x11,local_60,messageRefCount);
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2);
if (messageRefCountPtr != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*messageRefCountPtr + 0xc))();
if ((isLastRef != '\0') && (g_multiplayerRelease != (void *)0x0)) {
(*g_multiplayerRelease)(local_38);
}
}
streamWriter = KAGE::Filesys::StreamBase::vftable;
stream = KAGE::Filesys::BufferedStreamBase::vftable;
local_60 = (void *)0x0;
local_5c = 0;
local_54 = streamBuffer;
streamHeapBuffer = (void *)0x0;
local_48 = 0;
local_44 = 0;
local_40 = 0;
FUN_007dcd30();
ExceptionList = local_1c;
return;
}
// 0091ee00
byte OnlineChat::is_key_repeating(int keyCode)
{
int *piVar1;
char isKeyActive;
int temp_5f0b48a020;
temp_5f0b48a020 = keyCode;
isKeyActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a20730,&keyCode,0,0);
if (isKeyActive == '\0') {
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + temp_5f0b48a020 * 4 + 0x68)) = 0;
}
else {
piVar1 = GHIDRA_CAST<int *>((GHIDRA_INT(this) + temp_5f0b48a020 * 4 + 0x68));
*piVar1 = *piVar1 + 1;
}
keyCode = temp_5f0b48a020;
isKeyActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&keyCode,0,0);
if ((isKeyActive == '\0') &&
((temp_5f0b48a020 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + temp_5f0b48a020 * 4 + 0x68)), temp_5f0b48a020 < 0x1e ||
(temp_5f0b48a020 % 3 != 0)))) {
return 0;
}
return 1;
}
// 0091f5d0
void OnlineChat::apply_roll_command(std_string *message)
{
byte isMatch;
std_string *text;
byte *******lowerEnd;
int lowerChar;
byte *******pppppppbVar1;
int iVar2;
byte *******lowerEnd;
uint capacity;
uint size;
byte *******command [4];
uint commandSize;
uint commandCapacity;
uint local_18;
void *local_10;
undefined1 *puStack_c;
byte ******local_8;
local_8 = GHIDRA_CAST<byte ******>(0xffffffff);
puStack_c = &LAB_00b0a59d;
local_10 = ExceptionList;
local_18 = __security_cookie ^ GHIDRA_UINT((command + 0xb));
if (message->_size == 0) {
return;
}
text = message;
if (0xf < message->_capacity) {
text = *GHIDRA_CAST<std_string **>(message->_buf);
}
if (text->_buf[0] != '/') {
return;
}
ExceptionList = &local_10;
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(command))))->std::string::string(message);
local_8 = GHIDRA_CAST<byte ******>(0x0);
pppppppbVar1 = GHIDRA_CAST<byte *******>(command);
if (0xf < commandCapacity) {
pppppppbVar1 = command[0];
}
lowerEnd = GHIDRA_CAST<byte *******>((GHIDRA_INT(pppppppbVar1) + commandSize));
lowerEnd = GHIDRA_CAST<byte *******>(command);
if (0xf < commandCapacity) {
lowerEnd = command[0];
}
if (lowerEnd != lowerEnd) {
iVar2 = GHIDRA_INT(pppppppbVar1) - GHIDRA_INT(lowerEnd);
do {
lowerChar = tolower(GHIDRA_INT((char)*GHIDRA_CAST<byte *>(lowerEnd)));
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(lowerEnd) + iVar2)) = (byte)lowerChar;
lowerEnd = GHIDRA_CAST<byte *******>((GHIDRA_INT(lowerEnd) + 1));
} while (lowerEnd != lowerEnd);
}
capacity = commandCapacity;
pppppppbVar1 = command[0];
lowerEnd = GHIDRA_CAST<byte *******>(command);
if (0xf < commandCapacity) {
lowerEnd = command[0];
}
isMatch = str_eq(GHIDRA_CAST<byte *>(lowerEnd),commandSize,&DAT_00b79ecc,3);
if (isMatch == 0) {
lowerEnd = GHIDRA_CAST<byte *******>(command);
if (0xf < capacity) {
lowerEnd = pppppppbVar1;
}
isMatch = str_eq(GHIDRA_CAST<byte *>(lowerEnd),commandSize,&DAT_00b79eac,4);
if (isMatch == 0) goto LAB_0091f723;
iVar2 = rand();
(GHIDRA_CAST<std::string *>((message->_buf)))->std::string::assign(GHIDRA_CAST<byte *>("Rolled a D20! Result = "),0x17);
(GHIDRA_CAST<std::string *>((message->_buf)))->std::string::push_back((char)(iVar2 % 0x14) + 1);
iVar2 = iVar2 % 0x14 + 0x1c;
}
else {
iVar2 = rand();
(GHIDRA_CAST<std::string *>((message->_buf)))->std::string::assign(GHIDRA_CAST<byte *>("Rolled a D6! Result = "),0x16);
(GHIDRA_CAST<std::string *>((message->_buf)))->std::string::push_back((char)(iVar2 % 6) + 1);
iVar2 = iVar2 % 6 + 0x16;
}
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x92c)))) = iVar2;
capacity = commandCapacity;
pppppppbVar1 = command[0];
LAB_0091f723:
if (0xf < capacity) {
size = capacity + 1;
lowerEnd = pppppppbVar1;
if (0xfff < size) {
lowerEnd = GHIDRA_CAST<byte *******>(pppppppbVar1[-1]);
size = capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(pppppppbVar1) + (-4 - GHIDRA_INT(lowerEnd))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(lowerEnd,size);
}
ExceptionList = local_10;
return;
}