mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 09:47:01 +02:00
fix embedded resources w/ 16-bit int
This commit is contained in:
1 parent
891a89d26f
commit
74ebacf120
3 files changed
+21
-16
No files matched your search
+14
-12
@@ -5,24 +5,26 @@
|
||||
#include <TargetConditionals.h>
|
||||
#endif
|
||||
|
||||
extern unsigned char checkra1n[];
|
||||
extern unsigned int checkra1n_len;
|
||||
#include <stdint.h>
|
||||
|
||||
extern unsigned char checkra1n_kpf_pongo_lzma[];
|
||||
extern unsigned int checkra1n_kpf_pongo_lzma_len;
|
||||
extern uint8_t checkra1n[];
|
||||
extern uint32_t checkra1n_len;
|
||||
|
||||
extern unsigned char ramdisk_dmg_lzma[];
|
||||
extern unsigned int ramdisk_dmg_lzma_len;
|
||||
extern uint8_t checkra1n_kpf_pongo_lzma[];
|
||||
extern uint32_t checkra1n_kpf_pongo_lzma_len;
|
||||
|
||||
extern unsigned char binpack_dmg[];
|
||||
extern unsigned int binpack_dmg_len;
|
||||
extern uint8_t ramdisk_dmg_lzma[];
|
||||
extern uint32_t ramdisk_dmg_lzma_len;
|
||||
|
||||
extern unsigned char Pongo_bin[];
|
||||
extern unsigned int Pongo_bin_len;
|
||||
extern uint8_t binpack_dmg[];
|
||||
extern uint32_t binpack_dmg_len;
|
||||
|
||||
extern uint8_t Pongo_bin[];
|
||||
extern uint32_t Pongo_bin_len;
|
||||
|
||||
#if defined(__APPLE__) && (TARGET_OS_IPHONE || defined(DEV_BUILD) || defined(FORCE_HELPER))
|
||||
extern unsigned char libcheckra1nhelper_dylib[];
|
||||
extern unsigned int libcheckra1nhelper_dylib_len;
|
||||
extern uint8_t libcheckra1nhelper_dylib[];
|
||||
extern uint32_t libcheckra1nhelper_dylib_len;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+3
-1
@@ -134,7 +134,9 @@ else
|
||||
endif
|
||||
|
||||
$(GENDIR)/gen-%.c: $(RESOURCES_DIR)/%
|
||||
cd $(RESOURCES_DIR) && xxd -iC $$(echo $< | cut -d/ -f2) > ../$@
|
||||
echo '#include <stdint.h>' > $(RESOURCES_DIR)/../$@
|
||||
cd $(RESOURCES_DIR) && xxd -iC $$(echo $< | cut -d/ -f2) | sed -e 's/unsigned int/uint32_t/' -e 's/unsigned char/uint8_t/' >> ../$@
|
||||
|
||||
|
||||
$(OBJDIR)/pongo_helper.c.o: pongo_helper.c $(wildcard ../include/*.h) $(RESOURCES_DIR)/ramdisk.dmg $(RESOURCES_DIR)/checkra1n-kpf-pongo
|
||||
$(CC) -c -o $@ $(CFLAGS) -DRAMDISK_UNCOMPRESSED_SIZE="\"$$(wc -c < $(RESOURCES_DIR)/ramdisk.dmg | tr -d ' ')\"" -DKPF_UNCOMPRESSED_SIZE="\"$$(wc -c < $(RESOURCES_DIR)/checkra1n-kpf-pongo | tr -d ' ')\"" $<
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/stat.h>
|
||||
#include <inttypes.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
@@ -51,7 +52,7 @@ int exec_checkra1n(void) {
|
||||
}
|
||||
ssize_t didWrite_Pongo_bin = write(fd_pongo, Pongo_bin, Pongo_bin_len);
|
||||
if (didWrite_Pongo_bin != (ssize_t)Pongo_bin_len) {
|
||||
LOG(LOG_FATAL, "Size written to %s does not match expected: %zd != %u: %d (%s)", pongo_path, didWrite_Pongo_bin, Pongo_bin_len, errno, strerror(errno));
|
||||
LOG(LOG_FATAL, "Size written to %s does not match expected: %zd != %" PRIu32 ": %d (%s)", pongo_path, didWrite_Pongo_bin, Pongo_bin_len, errno, strerror(errno));
|
||||
close(fd_pongo);
|
||||
unlink(pongo_path);
|
||||
free(pongo_path);
|
||||
@@ -71,7 +72,7 @@ int exec_checkra1n(void) {
|
||||
}
|
||||
ssize_t didWrite_checkra1n = write(fd_checkra1n, checkra1n, checkra1n_len);
|
||||
if (didWrite_checkra1n != (ssize_t)checkra1n_len) {
|
||||
LOG(LOG_FATAL, "Size written to %s does not match expected: %zd != %d: %d (%s)", checkra1n_path, didWrite_checkra1n, checkra1n_len, errno, strerror(errno));
|
||||
LOG(LOG_FATAL, "Size written to %s does not match expected: %zd != %" PRIu32 ": %d (%s)", checkra1n_path, didWrite_checkra1n, checkra1n_len, errno, strerror(errno));
|
||||
close(fd_checkra1n);
|
||||
unlink(checkra1n_path);
|
||||
free(checkra1n_path);
|
||||
@@ -106,7 +107,7 @@ int exec_checkra1n(void) {
|
||||
}
|
||||
ssize_t didWrite_libcheckra1nhelper = write(helper_fd, libcheckra1nhelper_dylib, libcheckra1nhelper_dylib_len);
|
||||
if ((unsigned int)didWrite_libcheckra1nhelper != libcheckra1nhelper_dylib_len) {
|
||||
LOG(LOG_FATAL, "Size written does not match expected: %zd != %d: %d (%s)", didWrite_libcheckra1nhelper, libcheckra1nhelper_dylib_len, errno, strerror(errno));
|
||||
LOG(LOG_FATAL, "Size written does not match expected: %zd != %" PRIu32 ": %d (%s)", didWrite_libcheckra1nhelper, libcheckra1nhelper_dylib_len, errno, strerror(errno));
|
||||
close(helper_fd);
|
||||
unlink(libcheckra1nhelper_dylib_path);
|
||||
return -1;
|
||||
|
||||
Reference in new issue
Block a user