Permalink
Browse files

restore patch 'filtering'

  • Loading branch information...
fgsfdsfgs committed Aug 1, 2018
1 parent 210cf55 commit 83690c3be52e01314eb3f0577f8598948b409b13
Showing with 4 additions and 3 deletions.
  1. +2 −1 src/firmware.c
  2. +2 −2 src/kippatches.c
View
@@ -144,6 +144,7 @@ void patch(pk11_offs *pk11, pkg2_hdr_t *pkg2, link_t *kips) {
}
u8 kipHash[0x20];
char *patchFilter[] = { "nogc", "nosigchk", NULL };
//Patch FS module (truly not my proudest code TODO cleanup)
LIST_FOREACH_ENTRY(pkg2_kip1_info_t, ki, kips, link) {
@@ -171,7 +172,7 @@ void patch(pk11_offs *pk11, pkg2_hdr_t *pkg2, link_t *kips) {
print(" could not find patchset with matching hash\n");
usleep(6666666);
} else {
int res = kippatch_apply_set(kipDecompText, moddedKip->sections[i].size_decomp, pset, NULL);
int res = kippatch_apply_set(kipDecompText, moddedKip->sections[i].size_decomp, pset, patchFilter);
if (res) {
gfx_con_setcol(&gfx_con, RED, 0, 0);
print("Error: kippatch_apply_set() returned %d\n", res);
View
@@ -62,15 +62,15 @@ int kippatch_apply(u8 *kipdata, u64 kipdata_len, kippatch_t *patch) {
int kippatch_apply_set(u8 *kipdata, u64 kipdata_len, kippatchset_t *patchset, char **filter) {
for (kippatch_t *p = patchset->patches; p && p->name; ++p) {
/*int found = 0;
int found = 0;
for (char **filtname = filter; filtname && *filtname; ++filtname) {
if (!strcmp(p->name, *filtname)) {
found = 1;
break;
}
}
if (!found) continue;*/
if (filter && !found) continue;
int r = kippatch_apply(kipdata, kipdata_len, p);
if (r) return r;

0 comments on commit 83690c3

Please sign in to comment.