Kaynağa Gözat

fix struct for iOS 14.1 based on the macOS 11.3 (20E232) KDK

Zhuowei Zhang 3 yıl önce
ebeveyn
işleme
6c6ee340ac
2 değiştirilmiş dosya ile 14 ekleme ve 2 silme
  1. 2 2
      hv.m
  2. 12 0
      hv_kernel_structs.h

+ 2 - 2
hv.m

@@ -328,8 +328,8 @@ static bool find_sys_reg(hv_sys_reg_t sys_reg, uint64_t* offset, uint64_t* sync_
   return true;
 }
 
-static_assert(offsetof(arm_guest_rw_context_t, dbgregs.bp[0].bvr) == 0x450,
-              "HV_SYS_REG_DBGBVR0_EL1");
+//static_assert(offsetof(arm_guest_rw_context_t, dbgregs.bp[0].bvr) == 0x450,
+//              "HV_SYS_REG_DBGBVR0_EL1");
 
 hv_return_t hv_vcpu_get_sys_reg(hv_vcpu_t vcpu, hv_sys_reg_t sys_reg, uint64_t* value) {
   struct hv_vcpu_data* vcpu_data = &vcpus[vcpu];

+ 12 - 0
hv_kernel_structs.h

@@ -42,7 +42,9 @@ typedef struct {
   uint64_t cntv_ctl_el0;
   uint64_t cntp_ctl_el0;
   uint64_t cntkctl_el1;
+#ifndef OLDSTRUCT_IOS141
   uint64_t ich_vmcr_el2;
+#endif
 } arm_guest_banked_sysregs_t;
 
 typedef struct {
@@ -53,19 +55,29 @@ typedef struct {
   uint64_t vmpidr_el2;
   uint64_t vpidr_el2;
   uint64_t virtual_timer_offset;
+#ifdef OLDSTRUCT_IOS141
+  uint64_t ich_hcr_el2;
+#endif
   uint64_t hfgrtr_el2;
   uint64_t hfgwtr_el2;
   uint64_t hfgitr_el2;
   uint64_t hdfgrtr_el2;
   uint64_t hdfgwtr_el2;
+#ifndef OLDSTRUCT_IOS141
   uint64_t cnthctl_el2;
+#endif
   uint64_t timer;
   uint64_t vmkeyhi_el2;
   uint64_t vmkeylo_el2;
   uint64_t apsts_el1;
+#ifndef OLDSTRUCT_IOS141
   uint64_t ich_hcr_el2;
   uint64_t ich_lr_el2[8];
+#endif
   uint64_t host_debug;
+#ifdef OLDSTRUCT_IOS141
+  uint64_t state_used;
+#endif
 } arm_guest_controls_t;
 
 typedef struct {