HagiCode.ModScanner
0.1.0-dev.1
See the version list below for details.
dotnet tool install --global HagiCode.ModScanner --version 0.1.0-dev.1
dotnet new tool-manifest
dotnet tool install --local HagiCode.ModScanner --version 0.1.0-dev.1
#tool dotnet:?package=HagiCode.ModScanner&version=0.1.0-dev.1&prerelease
nuke :add-package HagiCode.ModScanner --version 0.1.0-dev.1
HagiCode Mod Scanner
An offline static scanner that reports which capabilities the managed code of a Unity mod can call (file writes, networking, process startup, dynamic assembly loading, P/Invoke), with the files analyzed and the coverage gaps.
The scanner was moved here from SuperDucky, where it lived under scanner/. This repository is the only place the Scanner is built and released. SuperDucky consumes the pinned release and contains no Scanner source.
What ships
Every release has one lockstep version (<Version> in Directory.Build.props, currently 0.1.0):
- NuGet tool packages
HagiCode.ModScanner(commandhagicode-mod-scanner) andHagiCode.ModScanner.Host(commandhagicode-mod-scanner-host). Both are framework-dependentnet10.0programs. Each carries itsrules/,licenses/andrefs/folders. - Release assets
hagicode-mod-scanner-win-x64-v<version>.tar.gzandhagicode-mod-scanner-linux-x64-v<version>.tar.gz, each with a.sha256file and arelease-manifest.jsonthat lists the SHA-256 of every file. The Windows asset also holdsSuperDuckyHost.exe. Both assets hold theSuperDuckyProbetest instrument.
Nothing here is self-contained. No .NET runtime is bundled. The programs use RollForward Disable and name Microsoft.NETCore.App 10.0.15 (the pin is RuntimeFrameworkVersion in Directory.Build.props). Running them needs exactly that runtime, which SuperDucky Desktop will bundle.
Layout
HagiCode.ModScanner.slnx
Directory.Build.props lockstep <Version>, net10.0, runtime pin 10.0.15, warnings as errors
Directory.Build.targets roll-forward Disable for executables, package metadata, rules/licenses/refs staging
global.json SDK 10.0.402 (latestPatch)
src/SuperDuckyScanner/ the Scanner (Analysis, Protocol, Rules, Snippets, Program.cs); per-RID lock files
src/SuperDuckyHost/ the Windows restricted-token host (Isolation, Native, Paths, Program.cs)
src/SuperDuckyProbe/ the test probe for the host (not packed)
tests/HagiCode.ModScanner.Tests/ scanner tests and golden reports (golden/)
tests/HagiCode.ModScanner.Host.Tests/ host isolation and path tests (Windows-only checks)
rules/built-in-rules.v1.json the built-in rule pack
licenses/ICSharpCode.Decompiler.txt third-party notice
scripts/package-assets.sh publishes one RID and packs its release asset
scripts/write-release-manifest.mjs writes release-manifest.json
.github/workflows/pull-request.yml build and test on Windows and Linux
.github/workflows/release.yml tag guard, assets, NuGet, GitHub release
PORTED-FROM.sha256 SHA-256 of every file ported from SuperDucky
Build and test
dotnet restore HagiCode.ModScanner.slnx --locked-mode
dotnet build HagiCode.ModScanner.slnx -c Release --no-restore
dotnet test HagiCode.ModScanner.slnx -c Release --no-build
The Scanner tests need Microsoft.NETCore.App 10.0.15 on the machine (the test host runs on the pinned runtime). The Host isolation tests skip on Linux and run on Windows. They skip rather than fail when SUPERDUCKY_PROBE_DIR, SUPERDUCKY_SCANNER_DIR or SUPERDUCKY_SNAPSHOT_DIR is unset. The published-Scanner smoke test needs SUPERDUCKY_SMOKE_SCANNER_DIR (a publish folder) and SUPERDUCKY_SMOKE_DOTNET_ROOT (a dotnet root with 10.0.15). CI sets all of them.
Publish and pack the release assets for one runtime identifier (win-x64 or linux-x64):
scripts/package-assets.sh linux-x64 0.1.0 dist
Pack the NuGet tool packages:
dotnet pack src/SuperDuckyScanner/SuperDuckyScanner.csproj -c Release -o nupkg
dotnet pack src/SuperDuckyHost/SuperDuckyHost.csproj -c Release -o nupkg
Restore the per-RID lock files after changing a package reference. Restore one RID at a time, because each lock file path depends on the RID:
dotnet restore src/SuperDuckyScanner/SuperDuckyScanner.csproj -r linux-x64 --force-evaluate
dotnet restore src/SuperDuckyScanner/SuperDuckyScanner.csproj -r win-x64 --force-evaluate
Release flow
- Set
<Version>inDirectory.Build.props(lockstep for packages and assets). - Draft the release:
release-draft.ymlruns on every push tomain(and on manual dispatch with an optionalversion). It callsHagiCode-org/hagi-release-drafter@v0.1.2, which derives the version from Conventional Commits and creates or updates one draft releasev<version>. It never publishes. Needscontents: writein that job only. - Review the draft notes. Push the tag
v<Version>, for examplev0.1.0; it must match the draft's tag and point at the commit the draft was created for. release.ymlruns in this order:verify(the tag must match^v[0-9]+\.[0-9]+\.[0-9]+$and<Version>; then restore, build and test),assets(one job per RID),packages(pack and push to nuget.org), andrelease(attach the assets and checksums to the GitHub release).
Every push to main also runs release.yml on the dev channel: verify (restore, build and test), then packages pushes <Version>-dev.<run_number> (for example 0.1.0-dev.42) to nuget.org. The dev channel creates no GitHub release and no RID assets. Dev versions sort below the stable <Version>. Each run publishes new, permanent versions to nuget.org; a version can be unlisted there but not deleted. The dev version uses the same <Version> as the next stable release, so bump <Version> in Directory.Build.props after a stable release if the dev builds should target the following version.
Owner prerequisite before the first publish: on nuget.org, create a Trusted Publishing policy for the repository HagiCode-org/hagicode-mod-scanner and the workflow file release.yml, then set the repository secret NUGET_USER. No long-lived NuGet API key is stored anywhere. Without NUGET_USER the packages job fails with an explicit message.
Source of the port
The Scanner was ported from the SuperDucky working tree, not from a commit: at the time of the port, SuperDucky HEAD was 25690efb, and the scanner sources, the two per-RID lock files, scanner/licenses/ and FileAccessSession.cs were not yet committed there. PORTED-FROM.sha256 lists the SHA-256 of every ported file as it was at that point. Verify a copy by running sha256sum -c from the SuperDucky scanner/ folder, and replace this section with the full SuperDucky commit SHA once the owner commits those files.
Licensing
Licensed under the Apache License, Version 2.0. See LICENSE. Third-party notices are in NOTICE and in licenses/.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 99 | 11/29/2026 |
| 0.1.0-dev.7 | 41 | 12/3/2026 |
| 0.1.0-dev.6 | 47 | 12/1/2026 |
| 0.1.0-dev.5 | 64 | 11/30/2026 |
| 0.1.0-dev.3 | 73 | 11/29/2026 |
| 0.1.0-dev.1 | 62 | 11/29/2026 |