Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Update pongo SDK #14

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ktrw_gdb_stub/kernel_symbols/iPhone10,1_17G68.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
KERNELCACHE UUID: D94ABD59-5818-3D61-A459-7D56A3DE3E2F
DEVICE: iPhone10,1 17G68
DEVICE: iPhone10,4 17G68

__disable_preemption 0xFFFFFFF007D091E0
__enable_preemption 0xFFFFFFF007D09210
__mh_execute_header 0xFFFFFFF007004000
_const_boot_args 0xFFFFFFF0079328E0
_IOSleep 0xFFFFFFF00813462C
_kernel_map 0xFFFFFFF0079316C0
_kernel_memory_allocate 0xFFFFFFF007C89084
_kernel_thread_start 0xFFFFFFF007C3375C
_ml_nofault_copy 0xFFFFFFF007D0FA64
_panic 0xFFFFFFF0090A2A48
_paniclog_append_noflush 0xFFFFFFF007C0E2BC
_thread_deallocate 0xFFFFFFF007C01298
_vsnprintf 0xFFFFFFF008022670
2 changes: 1 addition & 1 deletion ktrw_usb_proxy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TARGET = ktrw_usb_proxy

DEBUG ?= 0

CFLAGS = -O2 -Wall -Werror
CFLAGS = -O2 -Wall -Werror -Wno-error=deprecated-declarations

ifneq ($(DEBUG),0)
CFLAGS += -DDEBUG=$(DEBUG)
Expand Down
2 changes: 1 addition & 1 deletion pongo_kext_loader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TARGET = pongo_kext_loader

DEBUG ?= 0

CFLAGS = -O2 -Wall -Werror
CFLAGS = -O2 -Wall -Werror -Wno-error=deprecated-declarations

ifneq ($(DEBUG),0)
CFLAGS += -DDEBUG=$(DEBUG)
Expand Down
6 changes: 3 additions & 3 deletions pongo_kextload/source/pongo_kextload.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ kextload_patch() {
0x00000000, // [3] ?
0xFFFFFFE0, // [4] MSR
};
xnu_pf_maskmatch(patchset, ktrr_mmu_match, ktrr_mmu_mask, ktrr_mmu_count,
xnu_pf_maskmatch(patchset, "patch_ktrr_mmu", ktrr_mmu_match, ktrr_mmu_mask, ktrr_mmu_count,
true, ktrr_mmu_patch);

// Patch out KTRR AMCC lockdown.
Expand All @@ -1039,7 +1039,7 @@ kextload_patch() {
0xFFFFFFE0, // [3] MSR
0xFFFFFFE0, // [4] MSR
};
xnu_pf_maskmatch(patchset, ktrr_amcc_match, ktrr_amcc_mask, ktrr_amcc_count,
xnu_pf_maskmatch(patchset, "patch_ktrr_amcc", ktrr_amcc_match, ktrr_amcc_mask, ktrr_amcc_count,
true, ktrr_amcc_patch);

// Patch the prologue of OSKext::initWithPrelinkedInfoDict() to set doCoalesedSlides to
Expand All @@ -1063,7 +1063,7 @@ kextload_patch() {
0xFFE0FFFF, // [4] MOV
0xFFFFFC1F, // [5] BLR
};
xnu_pf_maskmatch(patchset, OSKext_init_match, OSKext_init_mask, OSKext_init_count,
xnu_pf_maskmatch(patchset, "patch_OSKext_init", OSKext_init_match, OSKext_init_mask, OSKext_init_count,
true, OSKext_init_patch);

// Run the patchset to patch the kernel.
Expand Down
81 changes: 81 additions & 0 deletions pongo_kextload/source/third_party/kerninfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* pongoOS - https://checkra.in
*
* Copyright (C) 2019-2021 checkra1n team
*
* This file is part of pongoOS.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
#ifndef _KERNINFO_H
#define _KERNINFO_H

#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>

#define MAX_BOOTARGS_LEN 256
#define DEFAULT_BOOTARGS "rootdev=md0"

typedef enum {
checkrain_option_none = 0,
checkrain_option_all = -1,
checkrain_option_failure = -2,

checkrain_option_safemode = 1 << 0,
checkrain_option_verbose_boot = 1 << 1,
checkrain_option_verbose_logging = 1 << 2,
checkrain_option_demote = 1 << 3,
checkrain_option_pongo_shell = 1 << 4,
checkrain_option_early_exit = 1 << 5,
} checkrain_option_t, *checkrain_option_p;

struct kerninfo {
uint64_t size;
uint64_t base;
uint64_t slide;
checkrain_option_t flags;
uint16_t cpid;
char bootargs[MAX_BOOTARGS_LEN];
};

#define checkrain_set_option(options, option, enabled) do { \
if (enabled) \
options = (checkrain_option_t)(options | option); \
else \
options = (checkrain_option_t)(options & ~option); \
} while (0);

static inline bool checkrain_option_enabled(checkrain_option_t flags, checkrain_option_t opt)
{
if(flags == checkrain_option_failure)
{
switch(opt)
{
case checkrain_option_safemode:
return true;
default:
return false;
}
}
return (flags & opt) != 0;
}

#endif
Loading