No description
  • C++ 91.3%
  • Python 4.4%
  • Shell 3%
  • CMake 1.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ethan O'Brien 5af12f44cc
All checks were successful
Build / Windows x64 (MSVC) (push) Successful in 18s
Chatgpt said I should fix the coin I guess
2026-08-27 13:37:19 -05:00
.forgejo/workflows Include Wine launcher in package verification 2026-08-22 17:31:21 -05:00
cmake Initial SIFAC patch implementation 2026-08-22 15:29:28 -05:00
docs Add verified Wine launcher and setup guide 2026-08-22 17:26:17 -05:00
src Chatgpt said I should fix the coin I guess 2026-08-27 13:37:19 -05:00
tools Initial SIFAC patch implementation 2026-08-22 15:29:28 -05:00
.gitignore Initial SIFAC patch implementation 2026-08-22 15:29:28 -05:00
CMakeLists.txt Add verified Wine launcher and setup guide 2026-08-22 17:26:17 -05:00
ll3.bat Add configurable startup and display hooks 2026-08-22 16:05:25 -05:00
README.md Chatgpt said I should fix the coin I guess 2026-08-27 13:37:19 -05:00
sifac-wine.sh Add verified Wine launcher and setup guide 2026-08-22 17:26:17 -05:00
SifacPatch.ini Simplify native aspect configuration 2026-08-22 16:23:27 -05:00
SifacPatchPublicKey.pem Initial SIFAC patch implementation 2026-08-22 15:29:28 -05:00

SIFAC Patch

A small, source-built Windows patch for Love Live! School idol festival after school ACTIVITY. It keeps the pristine game executable and printer DLL intact and replaces the old JConfig/opaque-patch stack with one configurable winhttp.dll bootstrap.

The proxy does not redirect or modify network traffic. Every WinHTTP call is forwarded unchanged to the system DLL; the separate reconstructed Windows service remains responsible for networking.

What it does

  • replaces the embedded RSA-2048 public key in memory from a PEM file;
  • bypasses the process-enumeration guard without editing ll3.exe;
  • replaces the client's confusing startup arguments with friendly display, graphics-quality, monitor-output, and cabinet-mode settings;
  • emulates the Taito USB-I/O device and its 64-byte input report, including the board's coin handshake (14-bit credit count in IN[12..13], subtract requests from OUT[12..13] echoed in IN[14..15]) and the door switches on their real 0xFC idle byte — see docs/usbio-protocol.md;
  • provides configurable keyboard mappings for all nine rhythm buttons, cabinet controls, coin input, and door switches;
  • provides native, configurable XInput controller mappings for buttons, triggers, and both sticks, without an external controller mapper;
  • emulates the small COM2 RFID health handshake and configurable card scan;
  • satisfies the printer/touch availability checks while leaving the pristine S6145-5Husb.dll in place;
  • converts mouse presses inside the foreground SIFAC client area to touch; clicks in other applications are untouched, and the physical game-window click is suppressed by default to prevent mouse-plus-touch double input.

All version-specific RVAs are in SifacPatch.ini and are guarded by the PE timestamp, image size, entry point, and byte signatures.

Build

From a Visual Studio x64 developer prompt:

cmake -S . -B build -A x64
cmake --build build --config Release
cmake --install build --config Release --prefix dist

Or with MinGW-w64 from WSL/Linux:

cmake -S . -B build/mingw64 \
  -DCMAKE_TOOLCHAIN_FILE=cmake/mingw64-toolchain.cmake \
  -DCMAKE_BUILD_TYPE=Release
cmake --build build/mingw64 -j
cmake --install build/mingw64 --prefix dist

The dist directory contains the complete Windows deployment plus the optional Linux/Wine launcher:

winhttp.dll
SifacPatch.ini
SifacPatchPublicKey.pem
ll3.bat
sifac-wine.sh

The Forgejo Actions workflow in .forgejo/workflows/build.yml runs an MSVC x64 build on pushes, pull requests, and manual dispatches. It expects a native runner with the windows-latest label and publishes a downloadable SifacPatch-windows-x64 ZIP artifact.

Install

Start from the unmodified game extracted from vdimg_ec_dec.img. Copy the four files from dist beside ll3.exe, then launch ll3.bat.

Do not copy the legacy PC package's patched ll3.exe, modified S6145-5Husb.dll, jconfig.dll, jconfigPatch.dll, jconfig8.dll, monitor files, or debug CRT. They are not required by this patch.

The supplied ll3.bat intentionally launches ll3.exe without hardcoded display arguments. Configure startup behavior under [Display] instead. Additional raw arguments passed to the batch file are still forwarded; set [Display] Enabled=false to use the client's native argument handling.

For Linux and WSL, see docs/wine.md. The verified Fedora setup needs Wine but no Winetricks verbs or Windows redistributable installers. On WSL, use the supplied launcher instead of running ll3.exe directly from /mnt/c or /mnt/d; it stages executable root files on the native Linux filesystem while leaving the large asset directories in place.

Configuration

Keyboard values accept literal single-character keys such as a, B, or ;, readable names such as Space, Enter, Escape, or F3, and Win32 virtual-key codes in decimal or 0x notation. Use 0, None, or Disabled to disable a binding. Write digit keys as Key0 through Key9 to distinguish them from decimal codes. F1 through F24, arrow keys, common navigation and modifier names, and LeftMouse, RightMouse, MiddleMouse, Mouse4, and Mouse5 are also accepted. Defaults are documented inline in SifacPatch.ini. Microsoft's Virtual-Key Codes reference lists the value for every keyboard and mouse key.

  • [Value] PublicKeyFile selects the RSA PEM beside the proxy.
  • [Display] controls startup behavior at the client's own option and window setup routines. Mode accepts Windowed or Fullscreen; MonitorOutput accepts Single or Dual; CabinetMode accepts Satellite or Central; and GraphicsQuality accepts High or ArcadeDefault. Width and Height are client-area dimensions. Position=Center centers the framed window, while Position=Coordinates uses X and Y like the original -wx and -wy arguments. FitToWorkArea=true prevents Windows from independently clipping an oversized framed window, optionally preserving its requested aspect ratio. AspectMode=Fit preserves SIFAC's native 16:9 content inside a differently shaped client with centered black bars; AspectMode=Stretch retains the client's original fill behavior.
  • [Input] controls every cabinet binding.
  • [Input] GameWindowOnly=true prevents keyboard, controller, coin, and card toggle bindings from affecting SIFAC while another application is selected.
  • [Locale] Enabled=true supplies the game's expected Japanese Shift-JIS code page locally, so dynamic labels render without changing the Windows system locale. CodePage=932 is the normal setting.
  • [Controller] maps the same cabinet inputs to an XInput controller. Keyboard and controller inputs remain active together. UserIndex selects controller 0 through 3; TriggerThreshold and StickThreshold control analog activation sensitivity. Each controller binding uses one of the readable names listed below; use None to disable that binding.
  • [Card] Toggle toggles a scan; Id is the 16-digit card identifier.
  • [Touch] GameWindowOnly=true prevents clicks in other applications from becoming touches.
  • [Touch] SuppressMouseClick=true prevents duplicate mouse and touch input inside SIFAC.
  • [Version] contains the audited client fingerprint and module-relative patch/hook locations for porting to another executable.

SIFAC exposes two distinct cabinet inputs named Enter SW and Decision Button. Menus asking for confirmation use Decision, not the raw Enter switch. Consequently, the supplied defaults use keyboard Enter for Decision and controller Start for Decision; the raw Enter binding is disabled unless a cabinet-accurate setup needs it.

Set [General] Debug=false after setup to stop writing SifacPatch.log.

Controller binding names are None, DPadUp, DPadDown, DPadLeft, DPadRight, Start, Back, LeftThumb, RightThumb, LeftShoulder, RightShoulder, A, B, X, Y, LeftTrigger, RightTrigger, and the four directions of either stick, such as LeftStickUp or RightStickLeft. The patch dynamically uses the system XInput runtime, so no XInput DLL needs to be copied into the game directory. Controllers presented to Windows as XInput devices work directly.

Verification and provenance

The runtime was tested against the pristine ll3.exe and pristine printer DLL with JConfig physically absent. It cleared both USB-I/O and card-scanner startup gates; an automated F3 pulse increased the on-screen credit counter from 00 to 01. Display-hook validation covered a centered, aspect-fitted single window; exact 1280x720 coordinate placement; dual-window output; and the native raw-command-line fallback. A 2560x1080 test also verified centered 16:9 pillarboxing in AspectMode=Fit without stretching the game image.

The byte audit and hashes are in docs/audit.md. The optional tools/patch_ll3.py reproduces the historical patched executable byte-for-byte for regression comparison only; runtime deployment does not use it.

Behavioral references:

No game files or third-party binaries are included.