; ; BrowseSmartTemplateLayer::addPrefabMenuItem from 0x53e9c8 to 0x53ebf2 (554 bytes) ; ; 2 xrefs: ; > BrowseSmartTemplateLayer::init @ 0x53ff8e ; > BrowseSmartTemplateLayer::init @ 0x53fff4 ; ; 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 ; PUSH.W {R4-R11,LR} ; +0x0, 0x53e9c8 MOV R8, R1 ; +0x4, 0x53e9cc LDR R5, =(__stack_chk_guard_ptr - 0x53E9DC) ; +0x6, 0x53e9ce MOV R10, R2 ; +0x8, 0x53e9d0 VPUSH {D8} ; +0xa, 0x53e9d2 MOV R7, R0 ; +0xe, 0x53e9d6 ADD R5, PC; __stack_chk_guard_ptr ; +0x10, 0x53e9d8 LDR R5, [R5]; __stack_chk_guard ; +0x12, 0x53e9da ADD.W R9, R8, #4 ; +0x14, 0x53e9dc LDR R3, [R5] ; +0x18, 0x53e9e0 SUB SP, SP, #0x54 ; +0x1a, 0x53e9e2 ADD R4, SP, #0x54+var_24 ; +0x1c, 0x53e9e4 STR R3, [SP,#0x54+var_8] ; +0x1e, 0x53e9e6 BL _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x20, 0x53e9e8 MOV R1, R0 ; +0x24, 0x53e9ec ADD R0, SP, #0x54+var_44; this ; +0x26, 0x53e9ee BL _ZN7cocos2d10CCDirector10getWinSizeEv; cocos2d::CCDirector::getWinSize(void) ; +0x28, 0x53e9f0 VMOV.F32 S14, #0.5 ; +0x2c, 0x53e9f4 VLDR S13, [SP,#0x54+var_40] ; +0x30, 0x53e9f8 MOV R0, R4; this ; +0x34, 0x53e9fc LDR.W R6, [R7,#0x1B8] ; +0x36, 0x53e9fe VLDR S15, =140.0 ; +0x3a, 0x53ea02 VMLA.F32 S15, S13, S14 ; +0x3e, 0x53ea06 VLDR S13, [SP,#0x54+var_44] ; +0x42, 0x53ea0a VMUL.F32 S14, S13, S14 ; +0x46, 0x53ea0e VMOV R1, S14; float ; +0x4a, 0x53ea12 VLDR S14, =50.0 ; +0x4e, 0x53ea16 VSUB.F32 S15, S15, S14 ; +0x52, 0x53ea1a VMOV R2, S15; float ; +0x56, 0x53ea1e BL _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x5a, 0x53ea22 ADD R3, SP, #0x54+var_3C ; +0x5e, 0x53ea26 MOV R1, R6; cocos2d::CCPoint * ; +0x60, 0x53ea28 MOV R2, R4 ; +0x62, 0x53ea2a MOV R0, R3; this ; +0x64, 0x53ea2c STR R3, [SP,#0x54+var_4C] ; +0x66, 0x53ea2e BL _ZN7cocos2d6CCNode18convertToNodeSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const&) ; +0x68, 0x53ea30 MOV R0, R4 ; +0x6c, 0x53ea34 MOV R1, R9 ; +0x6e, 0x53ea36 BL sub_775C20 ; +0x70, 0x53ea38 MOV R0, R4 ; +0x74, 0x53ea3c STR R5, [SP,#0x54+var_48] ; +0x76, 0x53ea3e BL _ZN19GJSmartBlockPreview6createESs; GJSmartBlockPreview::create(std::string) ; +0x78, 0x53ea40 MOV R6, R0 ; +0x7c, 0x53ea44 MOV R0, R4 ; +0x7e, 0x53ea46 BL sub_774008 ; +0x80, 0x53ea48 MOV R1, R8; SmartPrefabResult * ; +0x84, 0x53ea4c MOV R0, R4; this ; +0x86, 0x53ea4e BL _ZN17SmartPrefabResultC2ERKS_; SmartPrefabResult::SmartPrefabResult(SmartPrefabResult const&) ; +0x88, 0x53ea50 VMOV.F32 S15, #1.0 ; +0x8c, 0x53ea54 LDR.W R3, [R8,#0xC] ; +0x90, 0x53ea58 MOV R0, R6 ; +0x94, 0x53ea5c MOV R1, R4 ; +0x96, 0x53ea5e CMP R3, #0 ; +0x98, 0x53ea60 VMOV.F32 S14, #0.5 ; +0x9a, 0x53ea62 ITE LE ; +0x9e, 0x53ea66 VMOVLE R2, S15 ; +0xa0, 0x53ea68 VMOVGT R2, S14 ; +0xa4, 0x53ea6c BL _ZN19GJSmartBlockPreview16addTemplateGuideE17SmartPrefabResultf; GJSmartBlockPreview::addTemplateGuide(SmartPrefabResult,float) ; +0xa8, 0x53ea70 MOV R0, R4; this ; +0xac, 0x53ea74 ADD R5, SP, #0x54+var_2C ; +0xae, 0x53ea76 BL _ZN17SmartPrefabResultD2Ev; SmartPrefabResult::~SmartPrefabResult() ; +0xb0, 0x53ea78 LDR.W R3, [R8,#0xC] ; +0xb4, 0x53ea7c CMP R3, #0 ; +0xb8, 0x53ea80 BLE loc_53EAE6 ; +0xba, 0x53ea82 LDR.W R11, [R7,#0x1F0] ; +0xbc, 0x53ea84 MOV R1, R9 ; +0xc0, 0x53ea88 MOV R0, R4 ; +0xc2, 0x53ea8a BL sub_775C20 ; +0xc4, 0x53ea8c MOV R1, R4 ; +0xc8, 0x53ea90 MOV R0, R11 ; +0xca, 0x53ea92 BL _ZN15GJSmartTemplate15getRandomPrefabESs; GJSmartTemplate::getRandomPrefab(std::string) ; +0xcc, 0x53ea94 MOV R11, R0 ; +0xd0, 0x53ea98 MOV R0, R4 ; +0xd2, 0x53ea9a BL sub_774008 ; +0xd4, 0x53ea9c CMP.W R11, #0 ; +0xd8, 0x53eaa0 BEQ loc_53EAE6 ; +0xdc, 0x53eaa4 MOV R1, R9 ; +0xde, 0x53eaa6 MOV R0, R5 ; +0xe0, 0x53eaa8 BL sub_775C20 ; +0xe2, 0x53eaaa MOV R0, R4 ; +0xe6, 0x53eaae ADD.W R1, R11, #0x38 ; '8' ; +0xe8, 0x53eab0 BL sub_775C20 ; +0xec, 0x53eab4 BL _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xf0, 0x53eab8 MOV R3, R0 ; +0xf4, 0x53eabc MOV R1, R5 ; +0xf6, 0x53eabe MOV R0, R6 ; +0xf8, 0x53eac0 MOV R2, R4 ; +0xfa, 0x53eac2 LDR.W R3, [R3,#0x170] ; +0xfc, 0x53eac4 BL _ZN19GJSmartBlockPreview10addPreviewESsSsP16LevelEditorLayer; GJSmartBlockPreview::addPreview(std::string,std::string,LevelEditorLayer *) ; +0x100, 0x53eac8 MOV R0, R4 ; +0x104, 0x53eacc BL sub_774008 ; +0x106, 0x53eace MOV R0, R5 ; +0x10a, 0x53ead2 BL sub_774008 ; +0x10c, 0x53ead4 LDR.W R1, [R8,#0xC]; int ; +0x110, 0x53ead8 CMP R1, #1 ; +0x114, 0x53eadc BLE loc_53EAE6 ; +0x116, 0x53eade MOV R0, R6; this ; +0x118, 0x53eae0 BL _ZN19GJSmartBlockPreview8addCountEi; GJSmartBlockPreview::addCount(int) ; +0x11a, 0x53eae2 LDR R3, [R6] ; +0x11e, 0x53eae6 MOV R0, R6 ; +0x120, 0x53eae8 MOV.W R1, #0x3F000000 ; +0x122, 0x53eaea LDR R3, [R3,#0x50] ; +0x126, 0x53eaee BLX R3 ; +0x128, 0x53eaf0 LDR R3, =(_ZN24BrowseSmartTemplateLayer16onTemplateObjectEPN7cocos2d8CCObjectE_ptr - 0x53EAFC) ; +0x12a, 0x53eaf2 MOV R2, R7 ; +0x12c, 0x53eaf4 MOVS R1, #0 ; +0x12e, 0x53eaf6 ADD R3, PC; _ZN24BrowseSmartTemplateLayer16onTemplateObjectEPN7cocos2d8CCObjectE_ptr ; +0x130, 0x53eaf8 LDR R3, [R3]; BrowseSmartTemplateLayer::onTemplateObject(cocos2d::CCObject *) ; +0x132, 0x53eafa STR R1, [SP,#0x54+var_54] ; +0x134, 0x53eafc MOV R0, R6 ; +0x136, 0x53eafe STR R3, [SP,#0x54+var_24] ; +0x138, 0x53eb00 STR R1, [SP,#0x54+var_20] ; +0x13a, 0x53eb02 BL _ZN21CCMenuItemSpriteExtra6createEPN7cocos2d6CCNodeES2_PNS0_8CCObjectEMS3_FvS4_E; CCMenuItemSpriteExtra::create(cocos2d::CCNode *,cocos2d::CCNode *,cocos2d::CCObject *,void (cocos2d::CCObject::*)(cocos2d::CCObject *)) ; +0x13c, 0x53eb04 ADD R6, SP, #0x54+var_34 ; +0x140, 0x53eb08 MOV R4, R0 ; +0x142, 0x53eb0a LDR.W R0, [R7,#0x1B8] ; +0x144, 0x53eb0c MOV R1, R4 ; +0x148, 0x53eb10 LDR R3, [R0] ; +0x14a, 0x53eb12 LDR.W R3, [R3,#0xDC] ; +0x14c, 0x53eb14 BLX R3 ; +0x150, 0x53eb18 MOVS R1, #0x1C ; +0x152, 0x53eb1a MOV R0, R10 ; +0x154, 0x53eb1c BLX __aeabi_idiv ; +0x156, 0x53eb1e VMOV S15, R0 ; +0x15a, 0x53eb22 VCVT.F32.S32 S15, S15 ; +0x15e, 0x53eb26 VMOV R0, S15; x ; +0x162, 0x53eb2a BLX floorf ; +0x166, 0x53eb2e MOVS R3, #0x1C ; +0x16a, 0x53eb32 MOVS R1, #7 ; +0x16c, 0x53eb34 VMOV S15, R0 ; +0x16e, 0x53eb36 VCVT.S32.F32 S15, S15 ; +0x172, 0x53eb3a VMOV R8, S15 ; +0x176, 0x53eb3e MLS R10, R3, R8, R10 ; +0x17a, 0x53eb42 LDR R3, [R4] ; +0x17e, 0x53eb46 LDR.W R9, [R3,#0x5C] ; +0x180, 0x53eb48 MOV R0, R10 ; +0x184, 0x53eb4c BLX __aeabi_idiv ; +0x186, 0x53eb4e VMOV S15, R0 ; +0x18a, 0x53eb52 VCVT.F32.S32 S15, S15 ; +0x18e, 0x53eb56 VMOV R0, S15; x ; +0x192, 0x53eb5a BLX floorf ; +0x196, 0x53eb5e MOVS R1, #7 ; +0x19a, 0x53eb62 VMOV S16, R0 ; +0x19c, 0x53eb64 MOV R0, R10 ; +0x1a0, 0x53eb68 BLX __aeabi_idivmod ; +0x1a2, 0x53eb6a VLDR S14, =60.0 ; +0x1a6, 0x53eb6e MOV R0, R6; this ; +0x1aa, 0x53eb72 VMOV S15, R1 ; +0x1ac, 0x53eb74 VCVT.F32.S32 S13, S15 ; +0x1b0, 0x53eb78 VLDR S15, =210.0 ; +0x1b4, 0x53eb7c VNMLS.F32 S15, S13, S14 ; +0x1b8, 0x53eb80 VMOV.F32 S14, #30.0 ; +0x1bc, 0x53eb84 VADD.F32 S15, S15, S14 ; +0x1c0, 0x53eb88 VMOV R1, S15; float ; +0x1c4, 0x53eb8c VLDR S15, =-60.0 ; +0x1c8, 0x53eb90 VMUL.F32 S15, S16, S15 ; +0x1cc, 0x53eb94 VMOV R2, S15; float ; +0x1d0, 0x53eb98 BL _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x1d4, 0x53eb9c MOV R2, R6 ; +0x1d8, 0x53eba0 MOV R0, R5 ; +0x1da, 0x53eba2 LDR R1, [SP,#0x54+var_4C] ; +0x1dc, 0x53eba4 BL _ZNK7cocos2d7CCPointplERKS0_; cocos2d::CCPoint::operator+(cocos2d::CCPoint const&) ; +0x1de, 0x53eba6 MOV R0, R4 ; +0x1e2, 0x53ebaa MOV R1, R5 ; +0x1e4, 0x53ebac BLX R9 ; +0x1e6, 0x53ebae MOV R2, R8; int ; +0x1e8, 0x53ebb0 MOV R0, R7; this ; +0x1ea, 0x53ebb2 MOV R1, R4; cocos2d::CCObject * ; +0x1ec, 0x53ebb4 BL _ZN24BrowseSmartTemplateLayer15addObjectToPageEPN7cocos2d8CCObjectEi; BrowseSmartTemplateLayer::addObjectToPage(cocos2d::CCObject *,int) ; +0x1ee, 0x53ebb6 LDR R3, [SP,#0x54+var_48] ; +0x1f2, 0x53ebba LDR R2, [SP,#0x54+var_8] ; +0x1f4, 0x53ebbc LDR R3, [R3] ; +0x1f6, 0x53ebbe CMP R2, R3 ; +0x1f8, 0x53ebc0 BEQ loc_53EBE8 ; +0x1fa, 0x53ebc2 BLX __stack_chk_fail ; +0x1fc, 0x53ebc4 B loc_53EBD4 ; +0x200, 0x53ebc8 MOV R0, R4; this ; +0x202, 0x53ebca BL _ZN17SmartPrefabResultD2Ev; SmartPrefabResult::~SmartPrefabResult() ; +0x204, 0x53ebcc BL __cxa_end_cleanup ; +0x208, 0x53ebd0 MOV R0, R4 ; +0x20c, 0x53ebd4 BL sub_774008 ; +0x20e, 0x53ebd6 B loc_53EBD0 ; +0x212, 0x53ebda MOV R0, R4 ; +0x214, 0x53ebdc BL sub_774008 ; +0x216, 0x53ebde B loc_53EBE4 ; +0x21a, 0x53ebe2 MOV R0, R5 ; +0x21c, 0x53ebe4 B loc_53EBD6 ; +0x21e, 0x53ebe6 ADD SP, SP, #0x54 ; 'T' ; +0x220, 0x53ebe8 VPOP {D8} ; +0x222, 0x53ebea POP.W {R4-R11,PC} ; +0x226, 0x53ebee