//
// sub_D15E14 from 0xd15e14 to 0xd15ed4 (192 bytes)
//
// 134 xrefs:
// > PlatformToolbox::spriteFromSavedFile @ 0x4ed040
// > GameToolbox::saveStringToFile @ 0x582c5c
// > sub_583094 @ 0x583108
// > GameToolbox::pointsToString @ 0x587a30
// > LevelCell::loadCustomLevelCell @ 0x61006c
// > OptionsCell::loadFromObject @ 0x615f10
// > LevelEditorLayer::getLevelString @ 0x679040
// > LevelEditorLayer::getLevelString @ 0x6791d8
// > EditorUI::copyObjectsDetailed @ 0x6902c0
// > EditorUI::copyObjects @ 0x6c4444
// > LevelSearchLayer::onPasteClipboard @ 0x6ceac8
// > GameLevelManager::getNextLevelName @ 0x6f0a20
// > GameLevelManager::getNextLevelName @ 0x6f0a68
// > GameLevelManager::writeSpecialFilters @ 0x6f50d4
// > GameLevelManager::writeSpecialFilters @ 0x6f5144
// > GameLevelManager::writeSpecialFilters @ 0x6f5258
// > GameLevelManager::onGetGauntletsCompleted @ 0x70e014
// > GJLevelList::showListInfo @ 0x719524
// > GJLevelList::showListInfo @ 0x719594
// > GJLevelList::showListInfo @ 0x7195fc
// > GJLevelList::showListInfo @ 0x71966c
// > GameLevelManager::createNewLevelList @ 0x71aed0
// > GameLevelManager::downloadLevel @ 0x71e288
// > GameLevelManager::rateStars @ 0x71edec
// > GameLevelManager::getLevelLeaderboard @ 0x720e9c
// > GameLevelManager::getLevelLeaderboard @ 0x720f5c
// > GameLevelManager::uploadComment @ 0x72457c
// > GameLevelManager::likeItem @ 0x728ddc
// > GameLevelManager::uploadLevelList @ 0x72d538
// > GameLevelManager::updateUserScore @ 0x737614
// > GameLevelManager::updateUserScore @ 0x737674
// > GameLevelManager::updateUserScore @ 0x7376b8
// > GameLevelManager::updateUserScore @ 0x7376fc
// > GameLevelManager::updateUserScore @ 0x737764
// > GameLevelManager::updateUserScore @ 0x7377c4
// > GameLevelManager::updateUserScore @ 0x737808
// > GameLevelManager::updateUserScore @ 0x73784c
// > GameLevelManager::updateUserScore @ 0x737be0
// > ColorSelectPopup::colorToHex @ 0x740228
// > CustomSongWidget::updateSongInfo @ 0x745034
// > CustomSongWidget::updateMultiAssetInfo @ 0x746d84
// > CustomSongWidget::updateMultiAssetInfo @ 0x746e14
// > CustomSongWidget::updateMultiAssetInfo @ 0x746fc0
// > CustomSongWidget::updateMultiAssetInfo @ 0x747038
// > StartPosObject::getSaveString @ 0x777ee0
// > formatTags @ 0x7dea00
// > InfoLayer::onLevelInfo @ 0x7e1814
// > ShareCommentLayer::init @ 0x7e7870
// > MusicDownloadManager::downloadCustomSong @ 0x82bb74
// > MusicDownloadManager::downloadSFX @ 0x82c720
// > MusicDownloadManager::pathForSFX @ 0x82f1b0
// > MusicDownloadManager::pathForSong @ 0x82f9a8
// > SongInfoObject::getArtistNames @ 0x8336e8
// > SongInfoObject::getTagsString @ 0x833f3c
// > CustomizeObjectLayer::updateKerningLabel @ 0x840204
// > GJBaseGameLayer::getRecordString @ 0x891ff8
// > FriendRequestPopup::init @ 0x8cd678
// > GJMessagePopup::init @ 0x8ce67c
// > GJWriteMessagePopup::init @ 0x8cfe2c
// > GJMessagePopup::onReply @ 0x8d0f18
// > ProfilePage::onSocialPage @ 0x8f8938
// > ProfilePage::onSocialPage @ 0x8f89a8
// > ProfilePage::onSocialPage @ 0x8f8a18
// > ProfilePage::onSocialPage @ 0x8f8ac4
// > ProfilePage::onSocialPage @ 0x8f8b34
// > GJMultiplayerManager::uploadComment @ 0x983c54
// > prefabKeyFromBinary @ 0x9d06c0
// > getItemVarName @ 0xa49228
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa499d4
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa49a28
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa49bcc
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa49c48
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa49c88
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa49cbc
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa49d28
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa49d5c
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa49d8c
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa49ddc
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0xa4c248
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0xa4c298
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0xa4c2cc
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0xa4c34c
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0xa4c398
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0xa4c3e8
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0xa4c424
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0xa4c53c
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0xa4c5c8
// > SFXBrowser::setupList @ 0xa5da14
// > UploadListPopup::listUploadFailed @ 0xa73e90
// > AudioAssetsBrowser::onInfo @ 0xa8ebf4
// > AudioAssetsBrowser::onInfo @ 0xa8ec60
// > AudioAssetsBrowser::onInfo @ 0xa8ed10
// > AudioAssetsBrowser::onInfo @ 0xa8ed7c
// > AudioAssetsBrowser::onInfo @ 0xa8ee34
// > AudioAssetsBrowser::onInfo @ 0xa8efd8
// > AudioAssetsBrowser::onInfo @ 0xa8f018
// > AudioAssetsBrowser::onInfo @ 0xa8f058
// > cocos2d::extension::WebSocket::init @ 0xaadf74
// > cocos2d::CCPrettyPrinter::visit @ 0xad4ed4
// > cocos2d::CCPrettyPrinter::visit @ 0xad4fd0
// > cocos2d::CCPrettyPrinter::visit @ 0xad507c
// > cocos2d::CCPrettyPrinter::visit @ 0xad5200
// > cocos2d::CCPrettyPrinter::visit @ 0xad52d0
// > cocos2d::CCPrettyPrinter::visit @ 0xad53a0
// > cocos2d::CCPrettyPrinter::visit @ 0xad54fc
// > cocos2d::CCPrettyPrinter::visit @ 0xad5600
// > cocos2d::CCPrettyPrinter::visit @ 0xad56e0
// > cocos2d::CCParticleSystem::initWithDictionary @ 0xb0092c
// > cocos2d::CCParticleSystem::initWithDictionary @ 0xb01588
// > cocos2d::CCFileUtils::getFullPathForDirectoryAndFilename @ 0xb04334
// > cocos2d::CCFileUtils::addSuffix @ 0xb04474
// > cocos2d::CCFileUtils::fullPathFromRelativeFile @ 0xb050fc
// > cocos2d::CCFileUtils::getPathForFilename @ 0xb053a0
// > cocos2d::CCFileUtils::getPathForFilename @ 0xb053ac
// > cocos2d::CCFileUtils::setSearchPaths @ 0xb06510
// > cocos2d::CCFileUtils::addSearchPath @ 0xb0684c
// > cocos2d::CCFileUtils::removeSearchPath @ 0xb098a4
// > cocos2d::CCFileUtilsAndroid::getWritablePath @ 0xb0b194
// > cocos2d::CCUserDefault::initXMLFilePath @ 0xb1f778
// > cocos2d::CCTextFieldTTF::insertText @ 0xb3010c
// > cocos2d::CCTMXMapInfo::textHandler @ 0xb3b8dc
// > cocos2d::CCTMXMapInfo::startElement @ 0xb3c69c
// > cocos2d::CCTMXMapInfo::startElement @ 0xb3cc48
// > cocos2d::CCTMXMapInfo::startElement @ 0xb3ce68
// > cocos2d::CCTMXMapInfo::startElement @ 0xb3d308
// > FileOperation::getFilePath @ 0xb414e0
// > xml_string_writer::write @ 0xb4bf9c
// > pugi::xml_node::path @ 0xb55fcc
// > sub_CDE33C @ 0xcde71c
// > sub_CDE8E0 @ 0xcdecc0
// > sub_D15ED4 @ 0xd15ed4
// > sub_D18F98 @ 0xd18fec
// > sub_D1902C @ 0xd1906c
// > sub_D199C0 @ 0xd19a54
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int **__fastcall sub_D15E14(int **a1, _BYTE **a2)
{
_BYTE *v3; // x1
size_t v5; // x20
int *v6; // x3
__int64 v7; // x2
size_t v8; // x22
int *v9; // x1
v3 = *a2;
v5 = *((_QWORD *)v3 - 3);
if ( v5 )
{
v6 = *a1;
v7 = *((_QWORD *)*a1 - 3);
v8 = v7 + v5;
if ( v7 + v5 > *((_QWORD *)*a1 - 2) || *(v6 - 2) > 0 )
{
sub_D15888((_BYTE **)a1, v7 + v5);
v6 = *a1;
v3 = *a2;
v7 = *((_QWORD *)*a1 - 3);
}
if ( v5 == 1 )
*((_BYTE *)v6 + v7) = *v3;
else
memcpy((char *)v6 + v7, v3, v5);
v9 = *a1;
if ( *a1 - 6 != (int *)&qword_124B6B0 )
{
*(v9 - 2) = 0;
*((_QWORD *)v9 - 3) = v8;
*((_BYTE *)v9 + v8) = 0;
}
}
return a1;
}