mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-08-03 11:23:49 +00:00
new ABIs + one stub
This commit is contained in:
@@ -1832,6 +1832,20 @@ uint64_t KYTY_SYSV_ABI KernelGetGPI() {
|
||||
|
||||
} // namespace LibKernel
|
||||
|
||||
namespace LibKernelWriteThrottling {
|
||||
|
||||
LIB_VERSION("libkernel_write_throttling", 1, "libkernel", 1, 1);
|
||||
|
||||
static uint64_t KYTY_SYSV_ABI WriteThrottlingStub() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
LIB_DEFINE(InitLibKernelWriteThrottling) {
|
||||
LIB_FUNC("YFC3dBBipj8", WriteThrottlingStub);
|
||||
}
|
||||
|
||||
} // namespace LibKernelWriteThrottling
|
||||
|
||||
namespace Posix {
|
||||
|
||||
LIB_VERSION("Posix", 1, "libkernel", 1, 1);
|
||||
@@ -2007,6 +2021,12 @@ int64_t KYTY_SYSV_ABI recv(int s, void* buf, uint64_t len, int flags) {
|
||||
return Network::Net::Recv(s, buf, len, flags);
|
||||
}
|
||||
|
||||
int64_t KYTY_SYSV_ABI recvfrom(int s, void* buf, uint64_t len, int flags, void* addr,
|
||||
uint32_t* addrlen) {
|
||||
PRINT_NAME();
|
||||
return Network::Net::Recvfrom(s, buf, len, flags, addr, addrlen);
|
||||
}
|
||||
|
||||
int KYTY_SYSV_ABI inet_pton(int af, const char* src, void* dst) {
|
||||
PRINT_NAME();
|
||||
|
||||
@@ -2154,6 +2174,7 @@ LIB_DEFINE(InitLibKernel_1_Posix) {
|
||||
LIB_FUNC("fZOeZIOEmLw", Posix::send);
|
||||
LIB_FUNC("oBr313PppNE", Posix::sendto);
|
||||
LIB_FUNC("Ez8xjo9UF4E", Posix::recv);
|
||||
LIB_FUNC("lUk6wrGXyMw", Posix::recvfrom);
|
||||
LIB_FUNC("4n51s0zEf0c", Posix::inet_pton);
|
||||
LIB_FUNC("5jRCs2axtr4", Posix::inet_ntop);
|
||||
LIB_FUNC("cfwBSQyr5Ys", cfwBSQyr5Ys);
|
||||
@@ -3255,6 +3276,7 @@ LIB_DEFINE(InitLibKernel_1) {
|
||||
InitLibKernel_1_Pthread(s);
|
||||
LibKernelApr::InitLibKernel_1_Apr(s);
|
||||
Posix::InitLibKernel_1_Posix(s);
|
||||
LibKernelWriteThrottling::InitLibKernelWriteThrottling(s);
|
||||
|
||||
LIB_OBJECT("f7uOxY9mM1U", &LibKernel::g_stack_chk_guard);
|
||||
LIB_OBJECT("djxxOmW6-aw", &LibKernel::g_progname);
|
||||
|
||||
+30
-5
@@ -1950,17 +1950,30 @@ int64_t KYTY_SYSV_ABI Sendto(int s, const void* buf, uint64_t len, int flags, co
|
||||
}
|
||||
|
||||
int64_t KYTY_SYSV_ABI Recv(int s, void* buf, uint64_t len, int flags) {
|
||||
return Recvfrom(s, buf, len, flags, nullptr, nullptr);
|
||||
}
|
||||
|
||||
int64_t KYTY_SYSV_ABI Recvfrom(int s, void* buf, uint64_t len, int flags, void* addr,
|
||||
uint32_t* addrlen) {
|
||||
PRINT_NAME();
|
||||
|
||||
LOGF("\t s = %d\n"
|
||||
"\t buf = 0x%016" PRIx64 "\n"
|
||||
"\t len = %" PRIu64 "\n"
|
||||
"\t flags = 0x%08" PRIx32 "\n",
|
||||
s, reinterpret_cast<uint64_t>(buf), len, static_cast<uint32_t>(flags));
|
||||
"\t flags = 0x%08" PRIx32 "\n"
|
||||
"\t addr = 0x%016" PRIx64 "\n"
|
||||
"\t addrlen = 0x%016" PRIx64 "\n",
|
||||
s, reinterpret_cast<uint64_t>(buf), len, static_cast<uint32_t>(flags),
|
||||
reinterpret_cast<uint64_t>(addr), reinterpret_cast<uint64_t>(addrlen));
|
||||
|
||||
if (buf == nullptr || (addr != nullptr && addrlen == nullptr)) {
|
||||
*Posix::GetErrorAddr() = Posix::POSIX_EFAULT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
NativeSocket socket = INVALID_NATIVE_SOCKET;
|
||||
if (buf == nullptr || !GetSocketBackend(s, &socket)) {
|
||||
*Posix::GetErrorAddr() = (buf == nullptr ? Posix::POSIX_EFAULT : Posix::POSIX_EBADF);
|
||||
if (!GetSocketBackend(s, &socket)) {
|
||||
*Posix::GetErrorAddr() = Posix::POSIX_EBADF;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1971,7 +1984,19 @@ int64_t KYTY_SYSV_ABI Recv(int s, void* buf, uint64_t len, int flags) {
|
||||
}
|
||||
|
||||
const int host_len = static_cast<int>(len > 0x7fffffffu ? 0x7fffffffu : len);
|
||||
const int result = ::recv(socket, static_cast<char*>(buf), host_len, host_flags);
|
||||
int result = 0;
|
||||
if (addr == nullptr) {
|
||||
result = ::recv(socket, static_cast<char*>(buf), host_len, host_flags);
|
||||
} else {
|
||||
sockaddr_storage host_addr {};
|
||||
int host_addrlen = sizeof(host_addr);
|
||||
result = ::recvfrom(socket, static_cast<char*>(buf), host_len, host_flags,
|
||||
reinterpret_cast<sockaddr*>(&host_addr), &host_addrlen);
|
||||
if (result != SOCKET_ERROR &&
|
||||
ConvertHostSockaddr(&host_addr, host_addrlen, addr, addrlen) != 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (result == SOCKET_ERROR) {
|
||||
return SetPosixSocketError();
|
||||
}
|
||||
|
||||
@@ -63,6 +63,8 @@ int64_t KYTY_SYSV_ABI Send(int s, const void* buf, uint64_t len, int flags);
|
||||
int64_t KYTY_SYSV_ABI Sendto(int s, const void* buf, uint64_t len, int flags, const void* addr,
|
||||
uint32_t addrlen);
|
||||
int64_t KYTY_SYSV_ABI Recv(int s, void* buf, uint64_t len, int flags);
|
||||
int64_t KYTY_SYSV_ABI Recvfrom(int s, void* buf, uint64_t len, int flags, void* addr,
|
||||
uint32_t* addrlen);
|
||||
|
||||
} // namespace Net
|
||||
|
||||
|
||||
Reference in New Issue
Block a user