Skip to content

Commit

Permalink
Make IPS instead of an edited code.bin
Browse files Browse the repository at this point in the history
  • Loading branch information
hax0kartik committed Oct 18, 2017
1 parent 779a596 commit c6f23d6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 39 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ This is a patch for 3DS news module(0004013000003502) which changes the default

To use:

1. Extract the code.bin of news module(0004013000003502) using GM9
2. Download the precompiled binaries of the program from the release page.
3. Put the code.bin and the program in a new folder.
4. Download [armips](https://buildbot.orphis.net/armips/) from here.
5. Put it in the same folder as before.
6. Run the program and type in the rgb hex
7. Drag the `0004013000003502` folder from the `out` folder to `sdcard:/luma/titles`
8. Enable luma game patching.
9. ???
10. PROFIT!!!
1. Download the precompiled binaries of the program from the release page.
2. Run the program and type in the rgb hex
3. Drag the `0004013000003502` folder from the `out` folder to `sdcard:/luma/titles`
4. Enable luma game patching.
5. ???
6. PROFIT!!!

To compile:-
`gcc main.c -o CustomRGBPattern.exe`
45 changes: 16 additions & 29 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ int main()
uint32_t rgb = 0;
printf("Type in the hex rgb and press Enter:\n");
scanf("%X", &rgb);
FILE *file = fopen("patch.s", "wb+");
fprintf(file, ".arm.little\n\n.open \"code.bin\", \"out/0004013000003502/code.bin\", 0x100000\n\n.thumb\n.org 0x%X\n\n", addr);
led pat;
memset(&pat.r[0], 0, 32);
memset(&pat.g[0], 0, 32);
Expand Down Expand Up @@ -46,39 +44,28 @@ int main()
round += 17;
}
*/


fprintf(file, "patch:\n");
fprintf(file, "//pat red\n");
for(int i = 0; i!=32; i+=1)
fprintf(file, " dcb 0x%X\n", pat.r[i]);
fprintf(file, "//pat green\n");
for(int i = 0; i!=32; i+=1)
fprintf(file, " dcb 0x%X\n", pat.g[i]);
fprintf(file, "//pat blue\n");
for(int i = 0; i!=32; i+=1)
fprintf(file, " dcb 0x%X\n", pat.b[i]);
fprintf(file, "\n.org 0x%X\n", addr2);
fprintf(file, "patch1:\n");
fprintf(file, "//pat red\n");
for(int i = 0; i!=32; i+=1)
fprintf(file, " dcb 0x%X\n", pat.r[i]);
fprintf(file, "//pat green\n");
for(int i = 0; i!=32; i+=1)
fprintf(file, " dcb 0x%X\n", pat.g[i]);
fprintf(file, "//pat blue\n");
for(int i = 0; i!=32; i+=1)
fprintf(file, " dcb 0x%X\n", pat.b[i]);
fprintf(file, ".close");
fclose(file);
#ifdef _WIN32
mkdir("out");
mkdir("out/0004013000003502");
system("armips.exe patch.s");
#else
mkdir("out", 0777);
mkdir("out/0004013000003502", 0777);
system("armips patch.s");
#endif
FILE *file = fopen("out/0004013000003502/code.ips", "wb+");
char *header = "PATCH";
fwrite(header, 5, 1, file);
fputc(00, file);
fputc(0xA1, file);//addr
fputc(0x94, file);//addr
fputc(0x00, file);
fputc(0xC3, file);//size
fwrite(&pat, sizeof(pat), 1, file);
fputc(0x50, file);
fputc(0x3C, file);
fputc(0xFF, file);
fwrite(&pat, sizeof(pat), 1, file);
char *end = "EOF";
fwrite(end, 3, 1, file);
fclose(file);
return 0;
}

0 comments on commit c6f23d6

Please sign in to comment.