Jief_Machak Posted April 12, 2021 Share Posted April 12, 2021 In platformdata.cpp, there is snprintf(RBr, 8, "%s", "j95j95am"); but the last char won't be copied and will be replaced by 0 (was already the case before my snprintf function. AsciiStrCpyS do the same). Is it the intended behaviour ? Link to comment Share on other sites More sharing options...
Slice Posted April 12, 2021 Share Posted April 12, 2021 6 minutes ago, Jief_Machak said: In platformdata.cpp, there is snprintf(RBr, 8, "%s", "j95j95am"); but the last char won't be copied and will be replaced by 0 (was already the case before my snprintf function. AsciiStrCpyS do the same). Is it the intended behaviour ? As far as I remember the result should be "j95j95a\0" or may be "j95j95am\0" . I will check when I will be at home. We are still supporting these SMC keys while they are no more used. Last use I saw in 10.7.5. Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 12, 2021 Share Posted April 12, 2021 40 minutes ago, Slice said: the result should be "j95j95a\0" Yes, the result is "j95j95a\0". It can't be "j95j95am\0" because RBr is only 8 char long. But maybe the result should be "j95j95am" as it looks like the final \0 is not needed. It is used like this : LogDataHub(&gEfiMiscSubClassGuid, L"RBr", &RBr, 8); So no \0 looks fine. 3 minutes ago, MifJpn said: Excuse me. Where is Version 11? I downloaded it from the same git-hub (twice). But it's version 9. Maybe I'm misunderstanding? Sorry, forgotten git push. Done now. 1 Link to comment Share on other sites More sharing options...
Matgen84 Posted April 12, 2021 Share Posted April 12, 2021 Hi @Jief_Machak Version 11: no parsing bug (Z390 config.plist). Only strange lines: ProductName SETTINGS_DATA= ProductName setting=iMac19,1 ProductName new SETTINGS_DATA=iMac19,1 And void ParseSMBIOSSettings(SETTINGS_DATA&, const TagDict*) : BoardVersion: Imac19,1 Result version Z390 04-11 15-30.rtf 2 Link to comment Share on other sites More sharing options...
Slice Posted April 12, 2021 Share Posted April 12, 2021 2 hours ago, Jief_Machak said: Yes, the result is "j95j95a\0". It can't be "j95j95am\0" because RBr is only 8 char long. But maybe the result should be "j95j95am" as it looks like the final \0 is not needed. It is used like this : LogDataHub(&gEfiMiscSubClassGuid, L"RBr", &RBr, 8); So no \0 looks fine. Sorry, forgotten git push. Done now. Yes, real iMac17,1 has these values RBr [ch8*] (bytes 6a 39 35 6a 39 35 61 6d) RPlt [ch8*] (bytes 6a 39 35 00 00 00 00 00) While currently Clover makes me RPlt [ch8*] (bytes 6a 39 35 00 00 00 00 00) RBr [ch8*] (bytes 6a 39 35 6a 39 35 61 00) Link to comment Share on other sites More sharing options...
Slice Posted April 12, 2021 Share Posted April 12, 2021 New one Quote Please send the file '/Users/sergey/Documents/Hacks/DellE6430/config 3.plist' as is to me. DO NOT modify the file please, or I won't catch that bug in my new parser. Thanks. config 3.plist Should be snprintf(RBr, 9, "%s", "j95j95am"); ? And char RBr[9]; Link to comment Share on other sites More sharing options...
polyzargone Posted April 12, 2021 Share Posted April 12, 2021 4 hours ago, Jief_Machak said: Fixed in version 11 ? Seems like : polyzargone@MacBook-Optimus Clover_test % ./CloverX64TestNewParser Version 11 No parsing bug detected. Great. Let me know Link to comment Share on other sites More sharing options...
yapan4 Posted April 12, 2021 Share Posted April 12, 2021 Version 11 No parsing bug detected. Great. Let me know Saving session... ...copying shared history... ...saving history...truncating history files... ...completed. Deleting expired sessions...none found. [Process completed] Link to comment Share on other sites More sharing options...
matxpa Posted April 12, 2021 Share Posted April 12, 2021 On 4/11/2021 at 12:33 PM, Jief_Machak said: Did we have the opposite problem few days ago ? Good we support 2 compilers ! I'll have a look. Nice diagnostic, thanks. @Jief_Machak Slice's r5133 Release (master commit fd3b09cf1) is a GCC53 build I've made a r5133 Release (master commit fd3b09cf1) XCODE8 build. That r5133 XCODE8 Release work fine I can boot on a Laptop Asus X75VB (MBP11,3 IvyBridge I5-3340M) Big Sur 11.2.3 (20D91) Yesturday i've built three XCODE8 r5133 Releases based on the three master commits (fe26ba9, 4269083 and the last c07c154) The three r5133 XCODE8 built Releases are OK but none of them can BOOT (black screen, no REFIT_MAINMENU_SCREEN displayed) I didn't try with others commits Those three r5133 GCC53 built Releases work fine Result of your parser CloverX64TestNewParser ./CloverX64TestNewParser /Users/meunier/Desktop/"EFI X75 MBP1x,x"/Clover Version 11 Look for config.plist in folder '/Users/meunier/Desktop/EFI X75 MBP1x,x/Clover' file:/Users/meunier/Desktop/EFI X75 MBP1x,x/Clover/r5101_EFI_Clover_Mojave_10.14.6_20191220/EFI/CLOVER/config.plist ... (57 ".plist" files) file:/Users/meunier/Desktop/EFI X75 MBP1x,x/Clover/r5133-EFI 3 20210412 c07c154 GCC53 OK/CLOVER/config.plist No parsing bug detected. Great. Let me know greetings 1 Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 12, 2021 Share Posted April 12, 2021 2 hours ago, Slice said: New one config 3.plist 19.87 kB · 2 downloads Should be snprintf(RBr, 9, "%s", "j95j95am"); ? And char RBr[9]; We can define as 9 bytes long, or just do a memcpy instead of a snprintf. @matxpa All your plist are in the folder "/Users/meunier/Desktop/"EFI X75 MBP1x,x"/Clover" ? If you have old, almost forgotten archive, I'm interested toparse them too. You can do /CloverX64TestNewParser / ! (take a small break, it'll take some time). Version 12 pushed... Link to comment Share on other sites More sharing options...
Slice Posted April 12, 2021 Share Posted April 12, 2021 Version 12 1 file(s) ignored because of xml structural problem (missing closing tag or like). No parsing bug detected. Great. Let me know (there was ~300 files config-like. It's a pity there is no counter) Link to comment Share on other sites More sharing options...
yapan4 Posted April 12, 2021 Share Posted April 12, 2021 Version 12 ~200 .plist files No parsing bug detected. Great. Let me know Saving session... ...copying shared history... ...saving history...truncating history files... ...completed. [Process completed] Link to comment Share on other sites More sharing options...
Slice Posted April 12, 2021 Share Posted April 12, 2021 57 minutes ago, Jief_Machak said: We can define as 9 bytes long, or just do a memcpy instead of a snprintf. We can't use memcpy because in other cases it will copy extra bytes while snprintf copy until zero. Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 12, 2021 Share Posted April 12, 2021 1 hour ago, Slice said: We can't use memcpy because in other cases We use memcpy only for the case where Rbr is 8 bytes long. But 9 bytes definition is probably the more intuitive... 2 hours ago, Slice said: It's a pity there is no counter I can do a version 13 with a counter A lot of plist tested. That's great. I'll asked few other people to do some more. 1 Link to comment Share on other sites More sharing options...
Slice Posted April 13, 2021 Share Posted April 13, 2021 6 hours ago, Jief_Machak said: We use memcpy only for the case where Rbr is 8 bytes long. But 9 bytes definition is probably the more intuitive... memset(RBr, 0, 8); if (ApplePlatformData[Model].smcBranch[0] != 'N') { snprintf(RBr, 8, "%s", ApplePlatformData[Model].smcBranch.c_str()); // memcpy(RBr, ApplePlatformData[Model].smcBranch.c_str(), 8); } else { Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 13, 2021 Share Posted April 13, 2021 2 hours ago, Slice said: memset(RBr, 0, 8); if (ApplePlatformData[Model].smcBranch[0] != 'N') { snprintf(RBr, 8, "%s", ApplePlatformData[Model].smcBranch.c_str()); // memcpy(RBr, ApplePlatformData[Model].smcBranch.c_str(), 8); } else { Not sure what you mean... You added memcpy, but commented ? To be sure to not go past the end of the string : memcpy(RBr, ApplePlatformData[Model].smcBranch.c_str(), MAX(8, ApplePlatformData[Model].smcBranch.sizeInBytesIncludingTerminator())); Link to comment Share on other sites More sharing options...
Slice Posted April 13, 2021 Share Posted April 13, 2021 Yes, this is the way. Link to comment Share on other sites More sharing options...
Matgen84 Posted April 13, 2021 Share Posted April 13, 2021 @Jief_Machak I build latest commit r5133 66bbace (XCODE8) and boot successfully Big Sur 11.3 Beta 7 (Z390 config) Spoiler 2021-4-11_12-56_CLOVERX64_2021-04-13_66bbace.efi.log 3 Link to comment Share on other sites More sharing options...
phi777 Posted April 13, 2021 Share Posted April 13, 2021 (edited) [...] === [ Parse ] ==================== Warning: Unknown key '/Quirks/ProvideConsoleGopEnable:294'. Skipped. Warning: Unknown key '/Quirks/AppleCpuPmCfgLock:300'. Skipped. Warning: Unknown key '/Quirks/AppleXcpmCfgLock:303'. Skipped. Warning: Unknown key '/Quirks/CustomSMBIOSGuid:308'. Skipped. Warning: Unknown key '/Quirks/DisableRtcChecksum:314'. Skipped. Warning: Unknown key '/Quirks/LapicKernelPanic:322'. Skipped. Warning: Unknown key '/Quirks/PanicNoKextDump:325'. Skipped. === [ CompareOldNewSettings ] ==================== Comparison OK No parsing bug detected. Great. Let me know Looks good to me Edited April 13, 2021 by phi777 2 1 Link to comment Share on other sites More sharing options...
Slice Posted April 13, 2021 Share Posted April 13, 2021 9 hours ago, Jief_Machak said: Not sure what you mean... You added memcpy, but commented ? To be sure to not go past the end of the string : memcpy(RBr, ApplePlatformData[Model].smcBranch.c_str(), MAX(8, ApplePlatformData[Model].smcBranch.sizeInBytesIncludingTerminator())); But MIN() Ok, now i have good key RBr [ch8*] (bytes 6a 39 35 6a 39 35 61 6d) Committed. Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 13, 2021 Share Posted April 13, 2021 16 minutes ago, Slice said: But MIN() Yes MAX would have been funny. There is also "j133_4_5". Link to comment Share on other sites More sharing options...
Slice Posted April 13, 2021 Share Posted April 13, 2021 23 minutes ago, Jief_Machak said: Yes MAX would have been funny. There is also "j133_4_5". Oh, thanks! Link to comment Share on other sites More sharing options...
eng_redaesm Posted April 13, 2021 Share Posted April 13, 2021 [mention=1176907]Jief_Machak[/mention] I build latest commit r5133 66bbace (XCODE8) and boot successfully Big Sur 11.3 Beta 7 (Z390 config) Spoiler 2021-4-11_12-56_CLOVERX64_2021-04-13_66bbace.efi.log@jief_makhac Unfortunately not booting with with me may be the. Version of xcode matters i have 12.4 verOSent from my iPhone using Tapatalk Link to comment Share on other sites More sharing options...
kushwavez Posted April 13, 2021 Share Posted April 13, 2021 (edited) commit ef68d4 can't build. ./buildme XCODE8 [...] [CPP] platformdata /Users/kushwavez/git/CloverBootloader/rEFIt_UEFI/Platform/platformdata.cpp:1027:23: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] snprintf(RPlt, 8, ApplePlatformData[Model].smcPlatform.c_str()); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/kushwavez/git/CloverBootloader/rEFIt_UEFI/Platform/platformdata.cpp:1027:23: note: treat the string as an argument to avoid this snprintf(RPlt, 8, ApplePlatformData[Model].smcPlatform.c_str()); ^ "%s", 1 error generated. make: *** [/Users/kushwavez/git/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/rEFIt_UEFI/refit/OUTPUT/Platform/platformdata.obj] Error 1 build.py... : error 7000: Failed to execute command make tbuild [/Users/kushwavez/git/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/rEFIt_UEFI/refit] build.py... : error F002: Failed to build module /Users/kushwavez/git/CloverBootloader/rEFIt_UEFI/refit.inf [X64, XCODE8, RELEASE] - Failed - Build end time: 21:05:25, Apr.13 2021 Build total time: 00:01:59 same with fb9562496e8ab13fa5340d73b88ae17fc5980457 66bbace4f782f99d2381b04e0424d16f0fbbb8e0 is okay EDIT: also @Jief_Machak as @eng_redaesm mentioned too, it doesn't work for me neither. 66bbace4f built with XCODE8, nothing happens when booting, no log generated. Edited April 13, 2021 by kushwavez Link to comment Share on other sites More sharing options...
Slice Posted April 13, 2021 Share Posted April 13, 2021 18 minutes ago, kushwavez said: commit ef68d4 can't build. ./buildme XCODE8 [...] [CPP] platformdata /Users/kushwavez/git/CloverBootloader/rEFIt_UEFI/Platform/platformdata.cpp:1027:23: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] snprintf(RPlt, 8, ApplePlatformData[Model].smcPlatform.c_str()); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/kushwavez/git/CloverBootloader/rEFIt_UEFI/Platform/platformdata.cpp:1027:23: note: treat the string as an argument to avoid this snprintf(RPlt, 8, ApplePlatformData[Model].smcPlatform.c_str()); ^ "%s", 1 error generated. make: *** [/Users/kushwavez/git/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/rEFIt_UEFI/refit/OUTPUT/Platform/platformdata.obj] Error 1 build.py... : error 7000: Failed to execute command make tbuild [/Users/kushwavez/git/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/rEFIt_UEFI/refit] build.py... : error F002: Failed to build module /Users/kushwavez/git/CloverBootloader/rEFIt_UEFI/refit.inf [X64, XCODE8, RELEASE] - Failed - Build end time: 21:05:25, Apr.13 2021 Build total time: 00:01:59 same with fb9562496e8ab13fa5340d73b88ae17fc5980457 66bbace4f782f99d2381b04e0424d16f0fbbb8e0 is okay No problem, committed the fix. 1 Link to comment Share on other sites More sharing options...
Recommended Posts