fix(hle): GameService Ok stubs plus NetInetPton and Json terminate (#560)

Resolve logo-accept-gate unresolved NIDs seen on PPSA04264: share/voice/
telemetry/content Ok stubs, sceNetInetPton, and Json Initializer::terminate.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
MarcelMediaDev
2026-07-23 10:33:39 +01:00
committed by GitHub
parent eb252af7b3
commit 7a108c6f87
3 changed files with 119 additions and 0 deletions
+46
View File
@@ -755,6 +755,52 @@ public static class NetExports
return true;
}
[SysAbiExport(
Nid = "8Kcp5d-q1Uo",
ExportName = "sceNetInetPton",
Target = Generation.Gen4 | Generation.Gen5,
LibraryName = "libSceNet")]
public static int NetInetPton(CpuContext ctx)
{
var addressFamily = unchecked((int)ctx[CpuRegister.Rdi]);
var sourceAddress = ctx[CpuRegister.Rsi];
var destinationAddress = ctx[CpuRegister.Rdx];
if (sourceAddress == 0 || destinationAddress == 0)
{
return SetNetError(ctx, NetErrorInvalidArgument, NetErrnoInvalidArgument);
}
if (!TryReadUtf8Z(ctx, sourceAddress, MaxNameLength, out var source))
{
return SetNetError(ctx, NetErrorInvalidArgument, NetErrnoInvalidArgument);
}
var family = addressFamily switch
{
2 => AddressFamily.InterNetwork, // AF_INET
28 => AddressFamily.InterNetworkV6, // AF_INET6
_ => AddressFamily.Unknown,
};
if (family == AddressFamily.Unknown ||
!IPAddress.TryParse(source, out var parsed) ||
parsed.AddressFamily != family)
{
// Match BSD inet_pton: return 0 for a parseable-family miss.
ctx[CpuRegister.Rax] = 0;
return 0;
}
var bytes = parsed.GetAddressBytes();
if (!ctx.Memory.TryWrite(destinationAddress, bytes))
{
return SetNetError(ctx, NetErrorInvalidArgument, NetErrnoInvalidArgument);
}
TraceNet("inet_pton", addressFamily, sourceAddress, destinationAddress, (ulong)bytes.Length);
ctx[CpuRegister.Rax] = 1;
return 1;
}
private static void TraceNet(string operation, int id, ulong arg0, ulong arg1, ulong arg2)
{
if (!string.Equals(Environment.GetEnvironmentVariable("SHARPEMU_LOG_NET"), "1", StringComparison.Ordinal))