Hello,
I'm creating a pokegen NTR plugin, and I'm using the template someone gave out (I don't remember who). Here is the important code:
I know, I know, it's pretty primitive. In the future, I plan to add a file selection, but that's beyond my abilities as of now.
When I try to build the cheat.plg file, it throws a bunch of weird errors while linking:
My question is, does the libc/libgcc included with the template have support for file functions, and if so, what am I doing wrong? If anyone actually knows this convoluted question, please feel free to respond.
Thanks!
I'm creating a pokegen NTR plugin, and I'm using the template someone gave out (I don't remember who). Here is the important code:
Code:
int inject() {
FILE *pokemon_ekx;
long size;
char* buffer;
size_t result;
pokemon_ekx = fopen("../../pokemon.ekx", "rb");
fseek(pokemon_ekx, 0, SEEK_END);
size = ftell(pokemon_ekx);
long pokemon_array[size];
if (pokemon_ekx == NULL)
return 1;
buffer = (char*) malloc(sizeof(char) * size);
if (buffer == NULL)
return 1;
result = fread(buffer, 1, size, pokemon_ekx);
if (result != size)
return 1;
// Credit to YoshiOG1 for finding this address
WRITEU16(0x08C9E134 , buffer);
fclose(pokemon_ekx);
free(buffer);
return 0;
}
I know, I know, it's pretty primitive. In the future, I plan to add a file selection, but that's beyond my abilities as of now.
When I try to build the cheat.plg file, it throws a bunch of weird errors while linking:
Code:
lib\\libc.a(lib_a-fopen.o): In function `_fopen_r':
(.text+0x44): undefined reference to `_open_r'
lib\\libc.a(lib_a-freer.o): In function `_malloc_trim_r':
(.text+0x48): undefined reference to `_sbrk_r'
lib\\libc.a(lib_a-freer.o): In function `_malloc_trim_r':
(.text+0x78): undefined reference to `_sbrk_r'
lib\\libc.a(lib_a-freer.o): In function `_malloc_trim_r':
(.text+0xc0): undefined reference to `_sbrk_r'
lib\\libc.a(lib_a-fseeko.o): In function `_fseeko_r':
(.text+0x2f4): undefined reference to `_fstat_r'
lib\\libc.a(lib_a-fseeko.o): In function `_fseeko_r':
(.text+0x3f8): undefined reference to `_fstat_r'
lib\\libc.a(lib_a-makebuf.o): In function `__smakebuf_r':
(.text+0x30): undefined reference to `_fstat_r'
lib\\libc.a(lib_a-makebuf.o): In function `__smakebuf_r':
(.text+0x124): undefined reference to `_isatty_r'
lib\\libc.a(lib_a-mallocr.o): In function `_malloc_r':
(.text+0x2e0): undefined reference to `_sbrk_r'
lib\\libc.a(lib_a-mallocr.o): In function `_malloc_r':
(.text+0x358): undefined reference to `_sbrk_r'
lib\\libc.a(lib_a-stdio.o): In function `__sread':
(.text+0xc): undefined reference to `_read_r'
lib\\libc.a(lib_a-stdio.o): In function `__swrite':
(.text+0x68): undefined reference to `_lseek_r'
lib\\libc.a(lib_a-stdio.o): In function `__swrite':
(.text+0x88): undefined reference to `_write_r'
lib\\libc.a(lib_a-stdio.o): In function `__sseek':
(.text+0xa0): undefined reference to `_lseek_r'
lib\\libc.a(lib_a-stdio.o): In function `__sclose':
(.text+0xcc): undefined reference to `_close_r'
arm-none-eabi-ld: error: required section '.rel.plt' not found in the linker script
arm-none-eabi-ld: final link failed: Invalid operation
My question is, does the libc/libgcc included with the template have support for file functions, and if so, what am I doing wrong? If anyone actually knows this convoluted question, please feel free to respond.
Thanks!
Last edited by ZiggyDeer,