· 4 years ago · Mar 22, 2021, 10:22 PM
1
2void systemImageNamed:withConfiguration:allowPrivate:
3 (undefined8 param_1,undefined8 param_2,undefined8 imageName,undefined8 config?,
4 ulong allowPrivate)
5
6{
7 int iVar1;
8 undefined8 uVar2;
9 undefined8 obj_completedConfig;
10 undefined8 imgCacheKey;
11 long lVar5;
12 long cachedImage;
13 undefined8 retval;
14 undefined8 uVar8;
15 undefined4 uStack112;
16 undefined8 uStack108;
17 long lStack88;
18
19 lStack88 = *(long *)__got::___stack_chk_guard;
20 imageSystemName = __stubs::_objc_retain(imageName);
21 // do some config stuff
22 +[UIImageConfiguration__completeConfiguration:fromConfiguration:](&_OBJC_CLASS_$_UIImageConfiguration);
23 obj_completedConfig = __stubs::_objc_retainAutoreleasedReturnValue();
24 // get image cache key for imageSystemName, pass allowPrivate and the config completed above
25 __stubs::_objc_msgSend(&_OBJC_CLASS_$__UIImageCacheKey,s_keyWithSystemName:private:config:,imageSystemName,allowPrivate,obj_completedConfig);
26 imgCacheKey = __stubs::_objc_retainAutoreleasedReturnValue();
27 __stubs::_os_unfair_lock_lock(&DAT_1d59b3c58);
28 if (cacheMapTableDat == 0) {
29 // get "cache"
30 __stubs::_objc_msgSend(&_OBJC_CLASS_$_NSMapTable,s_mapTableWithKeyOptions:valueOpti_1d541d21c,0,5);
31 cacheMapTable? = __stubs::_objc_retainAutoreleasedReturnValue();
32 cacheMapTableDat = cacheMapTable?;
33 }
34 // get cached image
35 __stubs::_objc_msgSend(cacheMapTableDat,s_objectForKey:_1d53ef1fe,imgCacheKey);
36 cachedImage = __stubs::_objc_retainAutoreleasedReturnValue();
37 __stubs::_os_unfair_lock_unlock(&DAT_1d59b3c58);
38 if (cachedImage == 0) { // if there is no cached image
39 __UIKitCoreGlyphsManager(); // create UIKitCoreGlyphsManager
40 uiKitCoreGlyphsManager = __stubs::_objc_retainAutoreleasedReturnValue();
41 // get image from manager
42 __stubs::_objc_msgSend(uiKitCoreGlyphsManager,s_imageNamed:configuration:_1d54655d3,imageSystemName,obj_completedConfig);
43 cachedImage = __stubs::_objc_retainAutoreleasedReturnValue();
44 __stubs::_objc_release(uiKitCoreGlyphsManager);
45 if (cachedImage == 0) { // check if img is null
46 if ((allowPrivate & 1) == 0) { // check if private is disallowed
47 if (DAT_1d59b3cb8 != -1) {
48 // do stuff
49 __stubs::_dispatch_once(&DAT_1d59b3cb8,&___block_literal_global.346);
50 }
51 if (DAT_1d59b3c52 == 0) {
52 cachedImage = 0;
53 goto RET_LABEL;
54 }
55 }
56 if (DAT_1d59b3ca8 != -1) {
57 __stubs::_dispatch_once(&DAT_1d59b3ca8,&___block_literal_global.304);
58 }
59 __stubs::_objc_retainAutoreleaseReturnValue(DAT_1d59b3ca0);
60 uiKitCoreGlyphsManager_? = __stubs::_objc_retainAutoreleasedReturnValue();
61 // try to get image from manager
62 __stubs::_objc_msgSend(uiKitCoreGlyphsManager_?, imageNamed:configuration:,imageSystemName,obj_completedConfig);
63 cachedImage = __stubs::_objc_retainAutoreleasedReturnValue();
64 if ((cachedImage == 0) || ((DAT_1d59b3c52 & 1) == 0)) {
65 __stubs::_objc_release(uiKitCoreGlyphsManager);
66 if (cachedImage == 0) goto RET_LABEL;
67 }
68 else {
69 iVar1 = __stubs::_os_variant_has_internal_diagnostics("com.apple.UIKit");
70 if (iVar1 == 0) {
71 if (DAT_1d59b3cc0 == 0) {
72 lVar5 = ___UILogCategoryGetNode("Assert",&_g_UILogCategories,___UILogCategoryNewNode);
73 DAT_1d59b3cc0 = lVar5 + -0x10;
74 }
75 uVar8 = *(undefined8 *)(DAT_1d59b3cc0 + 8);
76 iVar1 = __stubs::_os_log_type_enabled(uVar8,0x10);
77 if (iVar1 != 0) {
78 uStack112 = 0x8400102;
79 uStack108 = uVar2;
80 __stubs::__os_log_impl
81 (&mach_header_18218a000,uVar8,0x10,
82
83 "Allowed API access to private symbol `%@`. You should use+_systemImageNamed: for this."
84 ,&uStack112,0xc);
85 }
86 }
87 else {
88 ___UIFaultDebugAssertLog();
89 uVar8 = __stubs::_objc_retainAutoreleasedReturnValue();
90 iVar1 = __stubs::_os_log_type_enabled(uVar8,0x11);
91 if (iVar1 != 0) {
92 uStack112 = 0x8400102;
93 uStack108 = uVar2;
94 __stubs::__os_log_fault_impl
95 (&mach_header_18218a000,uVar8,0x11,
96
97 "Allowed API access to private symbol `%@`. You should use+_systemImageNamed: for this."
98 ,&uStack112,0xc);
99 }
100 __stubs::_objc_release(uVar8);
101 }
102 __stubs::_objc_release(retval);
103 }
104 }
105 __stubs::_os_unfair_lock_lock(&DAT_1d59b3c58);
106 __stubs::_objc_msgSend(cacheMapTableDat,s_setObject:forKey:_1d53ee6a7,cachedImage,imgCacheKey);
107 __stubs::_os_unfair_lock_unlock(&DAT_1d59b3c58);
108 }
109RET_LABEL:
110 retval = __stubs::_objc_retain(cachedImage);
111 __stubs::_objc_release();
112 __stubs::_objc_release(imgCacheKey);
113 __stubs::_objc_release(obj_completedConfig);
114 __stubs::_objc_release(uVar2);
115 if (*(long *)__got::___stack_chk_guard == lStack88) {
116 __stubs::_objc_autoreleaseReturnValue(retval);
117 return;
118 }
119 /* WARNING: Subroutine does not return */
120 __stubs::___stack_chk_fail();
121}
122
123