PS3Xploit / PS3xploit-resigner

A Tool To Resign PS2/PS3/PSX/PSP Content For Use With PS3 etHANol 4.82/4.84
GNU General Public License v3.0
185 stars 73 forks source link

Failed to compile main.cpp! Linux #44

Open daishishi opened 4 years ago

daishishi commented 4 years ago

Hello there, I don't know what is happening and didn't found anything searching the internet so I'm opening a issue. When I try to use the 'make' in source/src or resign_linux.sh I got a 'Failed to compile main.cpp'. I'm using Pop OS! 20.04 Here is the output from source/src; make

main.cpp:27: warning: "_LARGEFILE64_SOURCE" redefined 27 #define _LARGEFILE64_SOURCE
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from main.cpp:1: /usr/include/features.h:211: note: this is the location of the previous definition 211 # define _LARGEFILE64_SOURCE 1
main.cpp: In function ‘long long int current_timestamp()’: main.cpp:685:5: error: ‘gettimeofday’ was not declared in this scope 685 gettimeofday(&te, NULL); // get current time ^~~~ main.cpp: In function ‘int parse_psp_pkg(uint8_t, uint32_t, uint8_t, uint32_t, int, uint64_t)’: main.cpp:1319:31: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=] 1319 printf("header[i].file_off=%x\n", header[i].file_off); ~^ ~~~~~~
unsigned int uint64_t {aka long unsigned int}
%lx
main.cpp:1320:32: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=] 1320 printf("header[i].file_size=%x\n", header[i].file_size); ~^ ~~~~~~~
unsigned int uint64_t {aka long unsigned int}
%lx
main.cpp: In function ‘int parse_ps3_psp_pkg(uint8_t, uint32_t, uint8_t)’: main.cpp:1423:31: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=] 1423 printf("header[i].file_off=%x\n", header[i].file_off); ~^ ~~~~~~
unsigned int uint64_t {aka long unsigned int}
%lx
main.cpp:1424:32: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=] 1424 printf("header[i].file_size=%x\n", header[i].file_size); ~^ ~~~~~~~
unsigned int uint64_t {aka long unsigned int}
%lx
main.cpp: In function ‘int main(int, char**)’: main.cpp:1566:22: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=] 1566 printf("size:%016llx\n", len); ~~^ ~~~
uint64_t {aka long unsigned int}
long long unsigned int
%016lx
main.cpp:1588:23: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=] 1588 printf("bkp:%016llx\n", bkp); ~~^ ~~~
uint64_t {aka long unsigned int}
long long unsigned int
%016lx

main.cpp: In function ‘int read_act_dat_and_make_rif(char)’: main.cpp:747:7: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] 747 | fread(idps, 0x10, 1, fp); | ~^~~~~~~ main.cpp:763:7: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] 763 | fread(&account_id, 8,1,fp);//skip aa account need | ~^~~~~ main.cpp:765:7: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] 765 | fread(act_dat_key, 0x10,1,fp); //copy first key in primary table of act.dat | ~^~~~~~~~ main.cpp:774:7: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] 774 | fread(rap, 0x10,1,fp); | ~^~~~ main.cpp: In function ‘int read_rif_key(char, uint8_t)’: main.cpp:846:7: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] 846 | fread(idps, 0x10, 1, fp); | ~^~~~~~~ main.cpp:860:7: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] 860 | fread(act_dat_key, 0x10,1,fp); //copy first key in primary table of act.dat | ~^~~~~~~~ main.cpp:871:7: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] 871 | fread(rap, 0x10,1,fp); | ~^~~~ main.cpp: In function ‘int sign_act_dat()’: main.cpp:888:7: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] 888 | fread(act_dat_buf, 0x1038,1,fp); | ~^~~~~~ main.cpp: In function ‘int sign_enc(FILE)’: main.cpp:1024:7: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] 1024 | fread(buf, 0x100,1,fp); | ~^~~~~ main.cpp: In function ‘int parse_psp_pkg(uint8_t, uint32_t, uint8_t, uint32_t, int, uint64_t)’: main.cpp:1344:8: warning: ignoring return value of ‘ssize_t write(int, const void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1344 | write(file_out, name, len_dec_name); | ~^~~~~~~~~~ main.cpp:1354:10: warning: ignoring return value of ‘ssize_t read(int, void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1354 | read(file_out, tmp_buf, header[i].file_size-loop); | ~~^~~~~~~~~~~ main.cpp:1357:11: warning: ignoring return value of ‘ssize_t write(int, const void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1357 | write(file_out, tmp_buf, header[i].file_size-loop); | ~^~~~~~~~~~~~~ main.cpp:1362:10: warning: ignoring return value of ‘ssize_t read(int, void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1362 | read(file_out, tmp_buf, 10010241024); | ~~^~~~~~~~ main.cpp:1365:11: warning: ignoring return value of ‘ssize_t write(int, const void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1365 | write(file_out, tmp_buf, 1001024*1024); | ~^~~~~~~~~~ main.cpp: In function ‘int main(int, char*)’: main.cpp:1495:8: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] 1495 | fread(content_id_edat, 0x34, 1,fp); | ~^~~~~~~~~ main.cpp:1582:10: warning: ignoring return value of ‘ssize_t write(int, const void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1582 | write(fd_out, buf2, len-bkp); | ~^~~~~~~ main.cpp:1590:10: warning: ignoring return value of ‘ssize_t write(int, const void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1590 | write(fd_out, buf2, 10010241024); | ~^~~~~~~~~ main.cpp: In function ‘void decrypt_debug_pkg_sse(uint8_t, uint64_t, uint64_t, int, uint64_t)’: main.cpp:1159:10: warning: ignoring return value of ‘ssize_t write(int, const void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1159 | write(file, pkg, 10010241024); | ~^~~~~~ main.cpp:1177:8: warning: ignoring return value of ‘ssize_t write(int, const void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1177 | write(file, pkg, last_round_size); | ~^~~~~~~~ main.cpp: In function ‘void decrypt_debug_pkg_normal(uint8_t, uint64_t, uint64_t, int, uint64_t)’: main.cpp:1095:10: warning: ignoring return value of ‘ssize_t write(int, const void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1095 | write(file, pkg, 10010241024); | ~^~~~~~ main.cpp:1112:8: warning: ignoring return value of ‘ssize_t write(int, const void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1112 | write(file, pkg, last_round_size); | ~^~~~~~~~ main.cpp: In function ‘void check_ps2_pkg_patch(uint8_t, uint64_t, int)’: main.cpp:1249:10: warning: ignoring return value of ‘ssize_t read(int, void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1249 | read(fd, tmp_buf, 0x100); | ~~^~~~~~ main.cpp:1255:12: warning: ignoring return value of ‘ssize_t write(int, const void, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1255 | write(fd, R+1, 0x14); | ~^~~~~~~ main.cpp:1257:12: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1257 | write(fd, S+1, 0x14); | ~^~~~~~~ Failed to compile main.cpp! make: *** [Makefile:37: main.o] Erro 1

Skitz069 commented 3 years ago

you need to open up main.cpp with nano (get with(without quotes):"sudo apt install nano" or use another text editor) and include sys/time.h. i promise its that easy. this wrecked me for 3 months trying on and off again and after that it worked instantly. open a terminal in the src folder, and (without quotes) type: "nano main.cpp" then at the very beginning of all the text add the following line (without quotes): "#include <sys/time.h>" then save and exit. if using nano push ctrl+x, then y, then enter. then run make and achieve happiness.