Skip to content

Commit

Permalink
Enable some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfugil committed Mar 16, 2024
1 parent 3348976 commit 525a4d3
Show file tree
Hide file tree
Showing 42 changed files with 81 additions and 4,840 deletions.
387 changes: 0 additions & 387 deletions apple-include-private/AvailabilityInternal.h

This file was deleted.

4,344 changes: 0 additions & 4,344 deletions apple-include-private/AvailabilityInternalLegacy.h

This file was deleted.

10 changes: 0 additions & 10 deletions apple-include-private/AvailabilityProhibitedInternal.h

This file was deleted.

20 changes: 8 additions & 12 deletions plooshInit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@
01E4277E2BA1EC43008BC989 /* preboot_path.c in Sources */ = {isa = PBXBuildFile; fileRef = 01D3D51C2B5C80DA007845B6 /* preboot_path.c */; };
01E4277F2BA1EC45008BC989 /* bootstrap.c in Sources */ = {isa = PBXBuildFile; fileRef = 01D3D51D2B5C80DA007845B6 /* bootstrap.c */; };
01E427802BA1EC49008BC989 /* overwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = 01B9F8AD2B68170D00428E81 /* overwrite.c */; };
01E427892BA1ED5C008BC989 /* bootstrap.c in Sources */ = {isa = PBXBuildFile; fileRef = 01E427882BA1ED5C008BC989 /* bootstrap.c */; };
01E4278E2BA1ED8F008BC989 /* load.c in Sources */ = {isa = PBXBuildFile; fileRef = 01E4278D2BA1ED8F008BC989 /* load.c */; };
01E427902BA1ED91008BC989 /* xpc_helper.c in Sources */ = {isa = PBXBuildFile; fileRef = 01E4278F2BA1ED91008BC989 /* xpc_helper.c */; };
01E427B12BA1EEE2008BC989 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 01D3D60C2B5C80DA007845B6 /* common.c */; };
01E427B22BA1EEEB008BC989 /* envbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = 01D3D6182B5C80DA007845B6 /* envbuf.c */; };
01E427B32BA1EEED008BC989 /* getusershell.c in Sources */ = {isa = PBXBuildFile; fileRef = 01D3D6192B5C80DA007845B6 /* getusershell.c */; };
Expand Down Expand Up @@ -213,6 +210,9 @@

/* Begin PBXFileReference section */
012A1FC12B91814F0018CCA2 /* memmem.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = memmem.c; sourceTree = "<group>"; };
015DD6BE2BA5992E003E3587 /* load.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = load.c; path = launchctl/load.c; sourceTree = "<group>"; };
015DD6BF2BA5992E003E3587 /* xpc_helper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = xpc_helper.c; path = launchctl/xpc_helper.c; sourceTree = "<group>"; };
015DD6C02BA5992E003E3587 /* bootstrap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bootstrap.c; path = launchctl/bootstrap.c; sourceTree = "<group>"; };
01683B582B8C679500A7A2EA /* crashreporter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = crashreporter.m; sourceTree = "<group>"; };
019B1B452B5CACA800BABAB5 /* load_etc_rc_d.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = load_etc_rc_d.c; sourceTree = "<group>"; };
01B6169C2B720DC70080AB28 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
Expand Down Expand Up @@ -461,9 +461,6 @@
01E4275D2BA1EB29008BC989 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
01E4275F2BA1EB2E008BC989 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/CoreFoundation.framework; sourceTree = DEVELOPER_DIR; };
01E427622BA1EB4F008BC989 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
01E427882BA1ED5C008BC989 /* bootstrap.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bootstrap.c; sourceTree = "<group>"; };
01E4278D2BA1ED8F008BC989 /* load.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = load.c; sourceTree = "<group>"; };
01E4278F2BA1ED91008BC989 /* xpc_helper.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = xpc_helper.c; sourceTree = "<group>"; };
01E427952BA1EE94008BC989 /* libsystemhook.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libsystemhook.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
01E4279D2BA1EEA8008BC989 /* librootfulhooks.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = librootfulhooks.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
01E427A52BA1EEB4008BC989 /* librootlesshooks.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = librootlesshooks.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -1306,9 +1303,9 @@
01E4278C2BA1ED83008BC989 /* launchctl */ = {
isa = PBXGroup;
children = (
01E4278F2BA1ED91008BC989 /* xpc_helper.c */,
01E4278D2BA1ED8F008BC989 /* load.c */,
01E427882BA1ED5C008BC989 /* bootstrap.c */,
015DD6C02BA5992E003E3587 /* bootstrap.c */,
015DD6BE2BA5992E003E3587 /* load.c */,
015DD6BF2BA5992E003E3587 /* xpc_helper.c */,
);
name = launchctl;
sourceTree = "<group>";
Expand Down Expand Up @@ -1745,7 +1742,6 @@
01E427692BA1EC05008BC989 /* handler.c in Sources */,
01E4276C2BA1EC0C008BC989 /* reboot3.c in Sources */,
01E427712BA1EC18008BC989 /* sysstatuscheck.c in Sources */,
01E427892BA1ED5C008BC989 /* bootstrap.c in Sources */,
01E4276D2BA1EC0E008BC989 /* bootstrap.c in Sources */,
01E427742BA1EC20008BC989 /* mount_dmg.c in Sources */,
01E4277E2BA1EC43008BC989 /* preboot_path.c in Sources */,
Expand All @@ -1757,13 +1753,11 @@
01E427752BA1EC23008BC989 /* create_var_jb.c in Sources */,
01E427652BA1EB6E008BC989 /* pinfo.c in Sources */,
01E4276E2BA1EC11008BC989 /* prelaunchd.c in Sources */,
01E427902BA1ED91008BC989 /* xpc_helper.c in Sources */,
01E427682BA1EC03008BC989 /* overwrite_file.c in Sources */,
01E427792BA1EC34008BC989 /* remount.c in Sources */,
01E427702BA1EC15008BC989 /* fixup_user_groups.c in Sources */,
01E4276F2BA1EC13008BC989 /* launchdaemons.c in Sources */,
01E427762BA1EC2C008BC989 /* setup_fakefs.c in Sources */,
01E4278E2BA1ED8F008BC989 /* load.c in Sources */,
01E4277C2BA1EC3F008BC989 /* obliterate.c in Sources */,
01E427772BA1EC2F008BC989 /* main.c in Sources */,
01E4277D2BA1EC41008BC989 /* main.c in Sources */,
Expand Down Expand Up @@ -2196,6 +2190,7 @@
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = NO;
GCC_WARN_PEDANTIC = NO;
HEADER_SEARCH_PATHS = (
"$(PROJECT_DIR)/apple-include",
"$(PROJECT_DIR)/include",
Expand All @@ -2220,6 +2215,7 @@
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = NO;
GCC_WARN_PEDANTIC = NO;
HEADER_SEARCH_PATHS = (
"$(PROJECT_DIR)/apple-include",
"$(PROJECT_DIR)/include",
Expand Down
2 changes: 2 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
CFLAGS += -g -arch arm64 -I$(ROOT)/include -Wno-deprecated-declarations
CFLAGS += -Wall -Wextra

SHELL = /usr/bin/env bash

ifneq ($(ASAN),1)
Expand Down
2 changes: 1 addition & 1 deletion src/fakedyld/main/cores_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void mount_ramdisk_cores(int platform) {
}
}

void init_cores(struct systeminfo* sysinfo_p, int platform) {
void init_cores(struct systeminfo* sysinfo_p, int __attribute__((unused)) platform) {
if (sysinfo_p->osrelease.darwinMajor > 20) {
tmpfs_mount_args_t args = { .case_insensitive = 0, .max_pages = 1, .max_nodes = 1 };
int ret = mount("tmpfs", "/System/Library/PrivateFrameworks/ProgressUI.framework", MNT_DONTBROWSE, &args);
Expand Down
2 changes: 1 addition & 1 deletion src/fakedyld/main/fakedyld.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ int main(int argc, char* argv[], char* envp[], char* apple[]) {
has_verbose_boot = has_verbose_boot || (pinfo.flags & palerain_option_verbose_boot);

pinfo_check(&pinfo);
#if 0
memory_file_handle_t payload;
memory_file_handle_t payload15_dylib;
#if 0
if (pinfo.flags & palerain_option_bind_mount) {
read_file("/payload.dylib", &payload15_dylib);
read_file("/payload", &payload);
Expand Down
2 changes: 1 addition & 1 deletion src/fakedyld/main/mountroot.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void mountroot(struct paleinfo* pinfo_p, struct systeminfo* sysinfo_p) {
if (!(pinfo_p->flags & palerain_option_bind_mount)) {
rootopts |= MNT_UNION;
}
apfs_mount_args_t rootargs = { dev_rootdev, rootopts, APFS_MOUNT_FILESYSTEM };
apfs_mount_args_t rootargs = { dev_rootdev, rootopts, APFS_MOUNT_FILESYSTEM , 0, 0, { "" }, NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0 };
retry_rootfs_mount:
ret = mount("apfs", "/", rootopts, &rootargs);
if (ret) {
Expand Down
3 changes: 2 additions & 1 deletion src/fakedyld/main/prepare_root.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ void prepare_rootfs(struct systeminfo* sysinfo_p, struct paleinfo* pinfo_p) {
LOG("mounting realfs %s\n", real_rootdev);
struct apfs_mount_args arg = {
real_rootdev,
MNT_RDONLY, APFS_MOUNT_FILESYSTEM /* "bdevvp failed: open" kernel panic when mount snapshot */, 0
MNT_RDONLY, APFS_MOUNT_FILESYSTEM /* "bdevvp failed: open" kernel panic when mount snapshot */
, 0, 0, { "" }, NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0
};
ret = mount("apfs", "/cores/fs/real", MNT_RDONLY, &arg);
if (ret) {
Expand Down
3 changes: 1 addition & 2 deletions src/fakedyld/main/rw_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ void write_file(char* path, memory_file_handle_t* handle) {
if (fd == -1) {
panic("open file %s failed", path);
}
int ret;
ssize_t didWrite = write(fd, handle->file_p, handle->file_len);;
if (didWrite != handle->file_len) {
if ((size_t)didWrite != handle->file_len) {
panic("unexpected data size %llu while writing file %s of size %llu (fd: %d)", didWrite, path, handle->file_len, fd);
}
// munmap(handle->file_p, ((handle->file_len & ~0x3fff) + 0x4000));
Expand Down
4 changes: 1 addition & 3 deletions src/fakedyld/patch_dyld/patcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void platform_check_patch(void* arm64_dyld_buf, int platform) {
}

bool has_found_dyld_in_cache = false;
bool patch_dyld_in_cache(struct pf_patch_t *patch, uint32_t *stream) {
bool patch_dyld_in_cache(struct pf_patch_t __attribute__((unused)) *patch, uint32_t *stream) {
char* env_name = pf_follow_xref(arm64_dyld_buf, &stream[2]);
char* env_value = pf_follow_xref(arm64_dyld_buf, &stream[6]);

Expand All @@ -49,8 +49,6 @@ bool patch_dyld_in_cache(struct pf_patch_t *patch, uint32_t *stream) {
}

void dyld_in_cache_patch(void* buf) {
struct mach_header_64 *header = buf;

uint32_t matches[] = {
0xaa1303e0, // mov x0, x19
0x94000000, // bl dyld4::KernelArgs::findEnvp
Expand Down
2 changes: 1 addition & 1 deletion src/fakedyld/patch_dyld/patches/platform/patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int _internal_platform = 0;
void *_internal_rbuf;
bool has_found_platform_patch = false;

bool inject_shc(struct pf_patch32_t *patch, uint32_t *stream) {
bool inject_shc(struct pf_patch32_t __attribute__((unused)) *patch, uint32_t *stream) {
uint32_t *shc_loc = copy_shc(_internal_rbuf, _internal_platform, stream[0]);

if (!shc_loc) {
Expand Down
2 changes: 1 addition & 1 deletion src/fakedyld/patch_dyld/patches/platform/shellcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ uint32_t *copy_shc(void *buf, int platform, uint32_t jmp) {
return NULL;
}

for (int i = 0; i < shc_size; i++) {
for (size_t i = 0; i < shc_size; i++) {
shc_loc[i] = shellcode[i];
}

Expand Down
2 changes: 1 addition & 1 deletion src/fakedyld/patch_dyld/plooshfinder/src/formats/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ struct elf_symbol_64 *elf_find_symbol_stype(void *buf, char *name, uint32_t type
char *strtab = buf + strtab_sect->offset;
uint64_t count = sect->size / sizeof(struct elf_symbol_64);

for (int i = 0; i < count; i++) {
for (uint64_t i = 0; i < count; i++) {
struct elf_symbol_64 *symbol = symtab + i;
char *sym_name = strtab + symbol->name;

Expand Down
28 changes: 14 additions & 14 deletions src/fakedyld/patch_dyld/plooshfinder/src/formats/macho.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void *macho_find_arch(void *buf, uint32_t arch) {
struct fat_header *header = (struct fat_header *) buf;
struct fat_arch *farch = (struct fat_arch *) ((char *) buf + sizeof(struct fat_header));

for (int i = 0; i < convert_endianness32(header->nfat_arch); i++) {
for (uint32_t i = 0; i < convert_endianness32(header->nfat_arch); i++) {
if (farch->cputype == arch) {
return buf + convert_endianness32(farch->offset);
}
Expand All @@ -56,7 +56,7 @@ uint32_t macho_get_platform(void *buf) {
struct load_command_64 *after_header = buf + sizeof(struct mach_header_64);
struct mach_header_64 *header = buf;

for (int i = 0; i < header->ncmds; i++) {
for (uint32_t i = 0; i < header->ncmds; i++) {
if (after_header->cmd == LC_BUILD_VERSION) {
struct build_version_command *cmd = (struct build_version_command *) after_header;

Expand All @@ -83,7 +83,7 @@ struct segment_command_64 *macho_get_segment(void *buf, char *name) {
struct load_command_64 *after_header = buf + sizeof(struct mach_header_64);
struct mach_header_64 *header = buf;

for (int i = 0; i < header->ncmds; i++) {
for (uint32_t i = 0; i < header->ncmds; i++) {
if (after_header->cmd == LC_SEGMENT_64) {
struct segment_command_64 *segment = (struct segment_command_64 *) after_header;
if (strcmp(segment->segname, name) == 0) {
Expand All @@ -106,7 +106,7 @@ struct section_64 *macho_get_section(void *buf, struct segment_command_64 *segme

struct section_64 *section = (struct section_64 *) ((char *) segment + sizeof(struct segment_command_64));

for (int i = 0; i < segment->nsects; i++) {
for (uint32_t i = 0; i < segment->nsects; i++) {
if (strcmp(section->sectname, name) == 0) {
return section;
}
Expand Down Expand Up @@ -150,7 +150,7 @@ struct fileset_entry_command *macho_get_fileset(void *buf, char *name) {
struct load_command_64 *after_header = buf + sizeof(struct mach_header_64);
struct mach_header_64 *header = buf;

for (int i = 0; i < header->ncmds; i++) {
for (uint32_t i = 0; i < header->ncmds; i++) {
if (after_header->cmd == LC_FILESET_ENTRY) {
struct fileset_entry_command *entry = (struct fileset_entry_command *) after_header;
char *entry_name = (void *) entry + entry->entry_id;
Expand All @@ -175,7 +175,7 @@ struct segment_command_64 *macho_get_segment_for_va(void *buf, uint64_t addr) {
struct mach_header_64 *header = buf;
struct segment_command_64 *segment = NULL;

for (int i = 0; i < header->ncmds; i++) {
for (uint32_t i = 0; i < header->ncmds; i++) {
if (after_header->cmd == LC_SEGMENT_64) {
segment = (struct segment_command_64 *) after_header;
uint64_t segment_start = segment->vmaddr;
Expand All @@ -197,7 +197,7 @@ struct segment_command_64 *macho_get_segment_for_va(void *buf, uint64_t addr) {
struct section_64 *macho_get_section_for_va(struct segment_command_64 *segment, uint64_t addr) {
struct section_64 *section = (struct section_64 *) ((char *) segment + sizeof(struct segment_command_64));

for (int i = 0; i < segment->nsects; i++) {
for (uint32_t i = 0; i < segment->nsects; i++) {
uint64_t section_start = section->addr;
uint64_t section_end = section_start + section->size;

Expand Down Expand Up @@ -260,7 +260,7 @@ struct segment_command_64 *macho_get_segment_for_ptr(void *buf, void *ptr) {
struct segment_command_64 *segment = NULL;
uint64_t ptr_addr = (uint64_t) ptr;

for (int i = 0; i < header->ncmds; i++) {
for (uint32_t i = 0; i < header->ncmds; i++) {
if (after_header->cmd == LC_SEGMENT_64) {
segment = (struct segment_command_64 *) after_header;
uint64_t segment_start = (uint64_t) buf + segment->fileoff;
Expand All @@ -283,7 +283,7 @@ struct section_64 *macho_get_section_for_ptr(struct segment_command_64 *segment,
struct section_64 *section = (struct section_64 *) ((char *) segment + sizeof(struct segment_command_64));
uint64_t ptr_addr = (uint64_t) ptr;

for (int i = 0; i < segment->nsects; i++) {
for (uint32_t i = 0; i < segment->nsects; i++) {
uint64_t section_start = (uint64_t) buf + section->offset;
uint64_t section_end = section_start + section->size;

Expand Down Expand Up @@ -336,9 +336,9 @@ struct nlist_64 *macho_find_symbol(void *buf, char *name) {

struct load_command_64 *after_header = buf + sizeof(struct mach_header_64);
struct mach_header_64 *header = buf;
struct symtab_command *symtab_cmd;
struct symtab_command *symtab_cmd = NULL;

for (int i = 0; i < header->ncmds; i++) {
for (uint32_t i = 0; i < header->ncmds; i++) {
if (after_header->cmd == LC_SYMTAB) {
symtab_cmd = (struct symtab_command *) after_header;

Expand Down Expand Up @@ -566,7 +566,7 @@ struct segment_command_64 *fileset_get_segment_for_ptr(void *buf, void *kext, vo
struct segment_command_64 *segment = NULL;
uint64_t ptr_addr = (uint64_t) ptr;

for (int i = 0; i < header->ncmds; i++) {
for (uint32_t i = 0; i < header->ncmds; i++) {
if (after_header->cmd == LC_SEGMENT_64) {
segment = (struct segment_command_64 *) after_header;
uint64_t segment_start = (uint64_t) buf + segment->fileoff;
Expand Down Expand Up @@ -623,9 +623,9 @@ struct nlist_64 *fileset_find_symbol(void *buf, void *kext, char *name) {

struct load_command_64 *after_header = kext + sizeof(struct mach_header_64);
struct mach_header_64 *header = kext;
struct symtab_command *symtab_cmd;
struct symtab_command *symtab_cmd = NULL;

for (int i = 0; i < header->ncmds; i++) {
for (uint32_t i = 0; i < header->ncmds; i++) {
if (after_header->cmd == LC_SYMTAB) {
symtab_cmd = (struct symtab_command *) after_header;

Expand Down
2 changes: 1 addition & 1 deletion src/fakedyld/patch_dyld/plooshfinder/src/formats/pe.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ struct Symbol_Header *pe_find_symbol(void *buf, char *name) {
void *symtab = pe_get_symtab(buf);
void *strtab = pe_get_strtab(buf);

for (int i = 0; i < pe_hdr->numberOfSymbols; i++) {
for (uint32_t i = 0; i < pe_hdr->numberOfSymbols; i++) {
struct Symbol_Header *symbol = symtab + (i * 18); // 18 is the correct size, but struct alignment makes it 20.
char *real_name = symbol->name.name;

Expand Down
2 changes: 1 addition & 1 deletion src/fakedyld/patch_dyld/plooshfinder/src/plooshfinder.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void pf_disable_patch(struct pf_patch_t *patch) {
uint32_t *pf_find_next(uint32_t *stream, uint32_t count, uint32_t match, uint32_t mask) {
uint32_t *find_stream = 0;

for (int i = 0; i < count; i++) {
for (uint32_t i = 0; i < count; i++) {
if (pf_maskmatch32(stream[i], match, mask)) {
find_stream = stream + i;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/fakedyld/patch_dyld/plooshfinder/src/plooshfinder32.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void pf_find_maskmatch32(void *buf, size_t size, struct pf_patchset32_t patchset
uint64_t uint_count = size >> 2;

for (uint64_t i = 0; i < uint_count; i++) {
for (int p = 0; p < patchset.count; p++) {
for (uint32_t p = 0; p < patchset.count; p++) {
struct pf_patch32_t *patch = patchset.patches + p;
if (patch->disabled) continue;

Expand Down
2 changes: 1 addition & 1 deletion src/fakedyld/patch_dyld/plooshfinder/src/plooshfinder64.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void pf_find_maskmatch64(void *buf, size_t size, struct pf_patchset64_t patchset
uint64_t uint_count = size >> 3;

for (uint64_t i = 0; i < uint_count; i++) {
for (int p = 0; p < patchset.count; p++) {
for (uint32_t p = 0; p < patchset.count; p++) {
struct pf_patch64_t *patch = patchset.patches + p;
if (patch->disabled) continue;

Expand Down
2 changes: 1 addition & 1 deletion src/libjailbreak/jbdcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ xpc_object_t jailbreak_send_jailbreakd_message_with_reply_sync(xpc_object_t xdic
if (xpc_get_type(connection) == XPC_TYPE_ERROR) {
return connection;
}
xpc_connection_set_event_handler(connection, ^(xpc_object_t _) {});
xpc_connection_set_event_handler(connection, ^(xpc_object_t __unused _) {});
xpc_connection_activate(connection);
xpc_object_t xreply = xpc_connection_send_message_with_reply_sync(connection, xdict);
xpc_connection_cancel(connection);
Expand Down
2 changes: 1 addition & 1 deletion src/payload/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $(OBJDIR)/%.c.o: %.c $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<

$(patsubst %.o, launchctl/%.o, $(LAUNCHCTL_OBJ)): $(patsubst %.o, launchctl/%.c, $(LAUNCHCTL_OBJ))
$(MAKE) -C launchctl $(shell echo $@ | cut -d/ -f2)
CFLAGS="$(CFLAGS) -Wno-unused-parameter" $(MAKE) -C launchctl $(shell echo $@ | cut -d/ -f2)

payload: $(patsubst %, %-all, $(SUBDIRS)) $(OBJS) $(patsubst %.o, launchctl/%.o, $(LAUNCHCTL_OBJ))
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $(patsubst %.o, launchctl/%.o, $(LAUNCHCTL_OBJ)) $$(find . -name '*.o' | grep 'obj/.*o') -o payload
Expand Down
Loading

0 comments on commit 525a4d3

Please sign in to comment.