Skip to content

Commit

Permalink
More fixes to revision value matching
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed May 21, 2019
1 parent 9d84c86 commit 29767fa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 40 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ VirtualSMC Changelog
#### v1.0.4
- Removed exposed REV, RBr, RPlt keys from I/O Registry
- Minor EFI driver compatibility improvements
- Synced RVUF, RVFB with REV from booter keys
- Fixed prebuilt revisions for GEN 3 chip emulation
- Dropped custom prebuilt revisions in favour of loader inject

#### v1.0.3
- Added multiple new ssio sensors
Expand Down
42 changes: 4 additions & 38 deletions VirtualSMC/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -205,21 +205,6 @@
</dict>
<key>ModelInfo</key>
<dict>
<key>Mac-7DF21CB3ED6977E5</key>
<dict>
<key>hwname</key>
<data>c21jLXBpa2V0b24A</data>
<key>branch</key>
<data>ajc4ajc4YW0=</data>
<key>platform</key>
<data>ajc4AAAAAAA=</data>
<key>rev</key>
<data>AiIPAAAW</data>
<key>revfb</key>
<data>AiIPAAAW</data>
<key>revfu</key>
<data>AiIPAAAW</data>
</dict>
<key>GenericV1</key>
<dict>
<key>branch</key>
Expand Down Expand Up @@ -250,31 +235,12 @@
<key>revfu</key>
<data>AigPAAAH</data>
</dict>
<key>Mac-27ADBB7B4CEE8E61</key>
<key>GenericV3</key>
<dict>
<key>branch</key>
<data>ajE2ajE3AAA=</data>
<key>platform</key>
<data>ajE3AAAAAAA=</data>
<key>rev</key>
<data>AhUPAAAH</data>
<key>revfb</key>
<data>AhUPAAAH</data>
<key>revfu</key>
<data>AhUPAAAH</data>
</dict>
<key>Mac-42FD25EABCABB274</key>
<dict>
<key>branch</key>
<data>ajc4ajc4YW0=</data>
<key>hwname</key>
<data>c21jLWh1cm9ucml2ZXIA</data>
<key>platform</key>
<data>ajc4AAAAAAA=</data>
<key>rev</key>
<data>AiIPAAAW</data>
<key>revfb</key>
<data>AiIPAAAW</data>
<key>revfu</key>
<data>AiIPAAAW</data>
<data>ajUyAAAAAAA=</data>
</dict>
</dict>
<key>_STA</key>
Expand Down
6 changes: 5 additions & 1 deletion VirtualSMC/kern_vsmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ bool VirtualSMC::obtainBooterModelInfo(SMCInfo &deviceInfo) {
auto rev = OSDynamicCast(OSData, platform->getProperty("REV"));
if (rev && rev->getLength() == deviceInfo.getBufferSize(SMCInfo::Buffer::RevMain)) {
lilu_os_memcpy(deviceInfo.getBuffer(SMCInfo::Buffer::RevMain), rev->getBytesNoCopy(), rev->getLength());
lilu_os_memcpy(deviceInfo.getBuffer(SMCInfo::Buffer::RevFlasherBase), rev->getBytesNoCopy(), rev->getLength());
lilu_os_memcpy(deviceInfo.getBuffer(SMCInfo::Buffer::RevFlasherUpdate), rev->getBytesNoCopy(), rev->getLength());
platform->removeProperty("REV");
}

Expand Down Expand Up @@ -297,7 +299,9 @@ bool VirtualSMC::obtainModelInfo(SMCInfo &deviceInfo, const char *boardIdentifie
}

const char *generic = "GenericV2";
if (gen == SMCInfo::Generation::V1 || deviceInfo.getGeneration() == SMCInfo::Generation::V1)
if (gen == SMCInfo::Generation::V3 || deviceInfo.getGeneration() == SMCInfo::Generation::V3)
generic = "GenericV3";
else if (gen == SMCInfo::Generation::V1 || deviceInfo.getGeneration() == SMCInfo::Generation::V1)
generic = "GenericV1";

doObtain(generic, true);
Expand Down
3 changes: 2 additions & 1 deletion VirtualSMCSDK/kern_smcinfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ class SMCInfo {
*/
bool isValid() const {
// Note, we do not check mac/serial validity, as they are optional!
return main[0] && flasherBase[0] && flasherUpdate[0] && branch[0] && platform[0] && hardwareModel[0];
// Everything but platform was also removed by T2!
return platform[0] && hardwareModel[0];
}
};

Expand Down

0 comments on commit 29767fa

Please sign in to comment.