Skip to content

Frida 17 compatibility: rebuild bundle with patched frida-mono-api#19

Open
ymuuuu wants to merge 3 commits into
GoSecure:masterfrom
ymuuuu:frida-17
Open

Frida 17 compatibility: rebuild bundle with patched frida-mono-api#19
ymuuuu wants to merge 3 commits into
GoSecure:masterfrom
ymuuuu:frida-17

Conversation

@ymuuuu

@ymuuuu ymuuuu commented Apr 27, 2026

Copy link
Copy Markdown

Summary

Frida 17.0.0 (release notes, May 2025) removed the static Module.* helper family (including Module.findExportByName). The bundled dist/xamarin-unpin.js was built against the old API surface, so attaching the script under any Frida 17.x runtime crashes immediately at module-load time:

TypeError: not a function
    at <anonymous> (mono-api/src/mono-module.js:17)
    at <anonymous> (mono-api/src/mono-api.js:2)
    at <anonymous> (mono-api/src/index.js:1)
    at <anonymous> (src/main.js:24)

(reproduced under frida -U -l dist/xamarin-unpin.js com.test.sample on Frida CLI 17.9.1).

This PR ships a rebuilt bundle that resolves the crash:

  • dist/xamarin-unpin.js — regenerated via npm run build against an updated frida-mono-api whose Module.findExportByName calls have been migrated to Frida-17 forms (module.findExportByName(...) instance method and Module.findGlobalExportByName(...) for the module-agnostic case). The actual logical change in the bundle is 7 lines; the rest of the file's whitespace differences come from the toolchain version. 0 remaining Module.findExportByName( references in the new bundle.
  • README.md — top banner attributing the work as a community contribution and linking back to the dependent frida-mono-api PR.
  • .gitignore — adds mono-api/ (the build-time clone of frida-mono-api) so future contributors don't accidentally commit it.
  • package-lock.json — regenerated by a current npm; large diff is mechanical, no semver bumps in package.json. Happy to revert this file if that's preferred.

The src/main.js source is unchanged — it doesn't reference any removed API directly, so all of the migration is contained inside the bundled frida-mono-api.

Companion PR

This PR depends on (or pairs with) GoSecure/frida-mono-api#1, which contains the source-level frida-mono-api migration. The bundle here is built against that branch, so once the library PR lands the bundle here can be re-generated against extra directly with no further changes.

Limitations not addressed

The README's existing Limitations section about frida -f early-instrumentation still applies and is not changed by this PR — frida-mono-api still requires the Mono shared library to be already mapped, so the documented attach-mode workflow (launch the app first, then frida -U -l ...) is still required.

Test plan

  • Build clean: git clone -b frida-17 https://github.com/ymuuuu/frida-mono-api mono-api && npm install && npm run build produces dist/xamarin-unpin.js.
  • Bundle audit: grep "Module\.findExportByName(" dist/xamarin-unpin.js returns no matches.
  • Bundle audit: bundle contains Module.findGlobalExportByName('mono_thread_attach') and _monoModule["default"].findExportByName(exportName).
  • Runtime: attach to a running Xamarin Android sample under Frida 17.9.1; expected [+] Hooked HttpMessageInvoker.SendAsync ... / [+] Done! output, then HTTPS traffic interceptable through a user-CA proxy.

🤖 Generated with Claude Code

- depend on ymuuuu/frida-mono-api#frida-17 (fixes Module.findExportByName removal)
- regenerate dist/xamarin-unpin.js via npm run build
- README banner with Frida 17 + GoSecure attribution
- .gitignore: exclude mono-api/ (the cloned dependency)

Frida 17.0.0 (May 2025) removed Module.findExportByName and the rest of the
static Module.* helpers, so the previous bundle crashed at module-load time
with TypeError: not a function. The bundled script is regenerated from the
patched frida-mono-api branch and verified to contain no remaining
Module.findExportByName(...) call sites.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates this project’s bundled Frida script to be compatible with Frida 17.x by rebuilding the distribution bundle against a patched frida-mono-api that no longer relies on removed static Module.* helpers.

Changes:

  • Rebuild dist/xamarin-unpin.js using updated frida-mono-api APIs compatible with Frida 17.x.
  • Add a README banner explaining the Frida 17 compatibility context and upstream dependency branch.
  • Ignore the build-time mono-api/ checkout and regenerate package-lock.json with a newer npm (lockfile v3).

Reviewed changes

Copilot reviewed 1 out of 4 changed files in this pull request and generated 1 comment.

File Description
dist/xamarin-unpin.js Rebuilt bundled script targeting Frida 17-compatible frida-mono-api export lookup APIs.
README.md Adds a Frida 17 compatibility/community-contribution banner and links to the patched dependency branch.
.gitignore Ignores mono-api/ so the build-time dependency checkout won’t be committed.
package-lock.json Regenerated lockfile (now lockfileVersion 3) to reflect the updated build environment and local dependency layout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment on lines +5 to +8
> `dist/xamarin-unpin.js` was rebuilt against an updated
> [`ymuuuu/frida-mono-api@frida-17`](https://github.com/ymuuuu/frida-mono-api/tree/frida-17).
> Note: the README's *Limitations* section about `frida -f` (early instrumentation) still
> applies — attach to a running process, do not spawn.

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new banner links to ymuuuu/frida-mono-api@frida-17, but later in this README the build instructions still tell contributors to clone GoSecure/frida-mono-api and switch to extra. This is inconsistent and will likely lead to rebuilding dist/xamarin-unpin.js against the wrong frida-mono-api version. Please update the build instructions (or adjust this banner) so they reference the same repo/branch used to build the bundled script.

Suggested change
> `dist/xamarin-unpin.js` was rebuilt against an updated
> [`ymuuuu/frida-mono-api@frida-17`](https://github.com/ymuuuu/frida-mono-api/tree/frida-17).
> Note: the README's *Limitations* section about `frida -f` (early instrumentation) still
> applies — attach to a running process, do not spawn.
> `dist/xamarin-unpin.js` was rebuilt against an updated `frida-mono-api` fork; if you
> rebuild it locally, use the exact repository and branch specified in the build instructions
> below so your generated bundle matches the checked-in script. Note: the README's
> *Limitations* section about `frida -f` (early instrumentation) still applies — attach
> to a running process, do not spawn.

Copilot uses AI. Check for mistakes.
ymuuuu added 2 commits April 27, 2026 04:00
- Replace the small blockquote banner with a top-level header that
  names this as a Frida 17 compatibility fork, links the Frida 17
  release notes, and credits the upstream authors (GoSecure and
  @freehuntx).
- Update the "Building and Running the Frida Script" section: the
  original instructions cloned GoSecure/frida-mono-api on the `extra`
  branch, which still uses removed APIs. Point at the patched
  ymuuuu/frida-mono-api@frida-17 instead so a fresh `npm run build`
  produces a working bundle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants