diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 9b8d318c..8e6a7312 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -106,7 +106,7 @@ jobs: build-ps4: name: PS4 - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: git checkout uses: actions/checkout@v4 @@ -114,13 +114,19 @@ jobs: fetch-depth: 0 - name: Create Build Environment - run: > - sudo apt update && - sudo apt install -y wget cmake git gettext smpq && - wget https://github.com/PacBrew/pacbrew-pacman/releases/download/v1.1/pacbrew-pacman-1.1.deb && - sudo dpkg -i pacbrew-pacman-1.1.deb && sudo pacbrew-pacman -Sy && - sudo pacbrew-pacman --noconfirm -S ps4-openorbis ps4-openorbis-portlibs - + run: | + sudo apt-get update && \ + sudo apt-get install -y pacman-package-manager wget cmake git gettext smpq && \ + sudo tee -a /etc/pacman.conf > /dev/null < - @@ -300,6 +299,7 @@ + diff --git a/Xbox 360/libsmb2.vcxproj.filters b/Xbox 360/libsmb2.vcxproj.filters index 8286fa71..fce34c59 100644 --- a/Xbox 360/libsmb2.vcxproj.filters +++ b/Xbox 360/libsmb2.vcxproj.filters @@ -129,9 +129,6 @@ lib - - lib - lib @@ -264,5 +261,8 @@ lib + + lib + \ No newline at end of file diff --git a/Xbox/libsmb2.vcproj b/Xbox/libsmb2.vcproj index 0f5f25c0..c37e4856 100644 --- a/Xbox/libsmb2.vcproj +++ b/Xbox/libsmb2.vcproj @@ -33,7 +33,7 @@ WarnAsError="TRUE" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" - CompileAs="1"/> + CompileAs="0"/> + CompileAs="0"/> - - @@ -369,6 +366,9 @@ + + diff --git a/lib/compat.h b/lib/compat.h index dd9b8d90..825a4617 100644 --- a/lib/compat.h +++ b/lib/compat.h @@ -634,6 +634,7 @@ struct iovec { #ifndef __NDS__ #include #endif +#if !defined(HAVE_SOCKADDR_STORAGE) struct sockaddr_storage { #ifdef HAVE_SOCKADDR_SA_LEN unsigned char ss_len; @@ -641,6 +642,7 @@ struct sockaddr_storage { unsigned char ss_family; unsigned char fill[127]; }; +#endif struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ @@ -653,10 +655,6 @@ struct addrinfo { struct addrinfo *ai_next; /* next structure in linked list */ }; -#ifdef __NDS__ -typedef int socklen_t; -#endif - #endif #define sockaddr_in6 sockaddr_in #else @@ -732,6 +730,9 @@ void smb2_freeaddrinfo(struct addrinfo *res); #define setsockopt net_setsockopt s32 getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); #define select net_select +#define accept net_accept +#define listen net_listen +#define bind net_bind #endif struct pollfd { diff --git a/lib/ntlmssp.c b/lib/ntlmssp.c index c1413754..91d38533 100644 --- a/lib/ntlmssp.c +++ b/lib/ntlmssp.c @@ -124,8 +124,9 @@ struct auth_data { void hex_print(const char *blurb, uint8_t *data, int len) { + int i; printf("%s\n", blurb); - for (int i = 0; i < len; i++) { + for (i = 0; i < len; i++) { printf("%02X ", data[i]); if (!((i + 1) & 0xf)) { printf("\n"); diff --git a/lib/ps2/imports.lst b/lib/ps2/imports.lst index ed5201df..84ed8e9b 100644 --- a/lib/ps2/imports.lst +++ b/lib/ps2/imports.lst @@ -79,4 +79,6 @@ sysclib_IMPORTS_end stdio_IMPORTS_start I_printf +I_putchar +I_puts stdio_IMPORTS_end diff --git a/lib/smb2-cmd-create.c b/lib/smb2-cmd-create.c index 6a91fb98..9748634f 100644 --- a/lib/smb2-cmd-create.c +++ b/lib/smb2-cmd-create.c @@ -442,7 +442,7 @@ int smb2_process_create_request_variable(struct smb2_context *smb2, struct smb2_pdu *pdu) { - struct smb2_create_request *req = (struct smb2_create_request*)pdu->payload;; + struct smb2_create_request *req = (struct smb2_create_request*)pdu->payload; struct smb2_iovec *iov = &smb2->in.iov[smb2->in.niov - 1]; uint32_t offset; void *ptr; diff --git a/lib/smb2-cmd-ioctl.c b/lib/smb2-cmd-ioctl.c index 23c42491..b6a2f3fd 100644 --- a/lib/smb2-cmd-ioctl.c +++ b/lib/smb2-cmd-ioctl.c @@ -387,6 +387,10 @@ smb2_process_ioctl_request_variable(struct smb2_context *smb2, struct smb2_iovec *iov = &smb2->in.iov[smb2->in.niov - 1]; struct smb2_iovec vec; void *ptr = NULL; + struct smb2_ioctl_validate_negotiate_info *info; + /* this one is handled locally regardless of proxy or not */ + ptr = smb2_alloc_init(smb2, sizeof(struct smb2_ioctl_validate_negotiate_info)); + info = ptr; if (req->input_count > iov->len - IOVREQ_OFFSET) { return -EINVAL; @@ -397,11 +401,6 @@ smb2_process_ioctl_request_variable(struct smb2_context *smb2, switch (req->ctl_code) { case SMB2_FSCTL_VALIDATE_NEGOTIATE_INFO: - /* this one is handled locally regardless of proxy or not */ - ptr = smb2_alloc_init(smb2, - sizeof(struct smb2_ioctl_validate_negotiate_info)); - struct smb2_ioctl_validate_negotiate_info *info = ptr; - smb2_get_uint32(&vec, 0, &info->capabilities); memcpy(info->guid, &vec.buf[4], 16); smb2_get_uint16(&vec, 20, &info->security_mode); diff --git a/lib/smb2-cmd-read.c b/lib/smb2-cmd-read.c index e39678c8..598060bd 100644 --- a/lib/smb2-cmd-read.c +++ b/lib/smb2-cmd-read.c @@ -265,11 +265,12 @@ smb2_process_read_fixed(struct smb2_context *smb2, } static void free_read_reply(struct smb2_context *smb2, void * payload) { + struct smb2_read_reply *rep; if (payload == NULL) { return; } - struct smb2_read_reply *rep = (struct smb2_read_reply*)payload; + rep = (struct smb2_read_reply*)payload; if (rep->data_length != 0 && rep->data != NULL) { free(rep->data); } diff --git a/lib/smb2-data-file-info.c b/lib/smb2-data-file-info.c index 638e3eeb..7b921ffa 100644 --- a/lib/smb2-data-file-info.c +++ b/lib/smb2-data-file-info.c @@ -267,12 +267,12 @@ smb2_decode_file_network_open_info(struct smb2_context *smb2, struct smb2_file_network_open_info *fs, struct smb2_iovec *vec) { - if (vec->len < 56) { + uint64_t t; + + if (vec->len < 56) { return -1; } - uint64_t t; - smb2_get_uint64(vec, 0, &t); smb2_win_to_timeval(t, &fs->creation_time);