Frida 15.1.28 Released ∞
release
A couple of exciting new things in this release.
File API
Those of you using our JavaScript File API may have noticed that it supports writing to the given file, but there was no way to read from it. This is now supported.
For example, to read each line of a text-file as a string:
(Note that this assumes that the text-file is UTF-8-encoded. Other encodings are not currently supported.)
You can also read a certain number of bytes at some offset:
The argument may also be omitted to read the rest of the file. But if you’re just looking to read a text file in one go, there’s an easier way:
Reading a binary file is just as easy:
(Where bytes is an ArrayBuffer.)
Sometimes you may also want to dump a string into a text file:
Or perhaps dump an ArrayBuffer:
Going back to the example earlier, seek() also supports relative offsets:
Retrieving the current file offset is just as easy:
Checksum API
The other JavaScript API addition this time around is for when you want to compute checksums. While this could be implemented in JavaScript entirely in “userland”, we do get it fairly cheap since Frida depends on GLib, and it already provides a Checksum API out of the box. All we needed to do was expose it.
Putting it all together, this means we can read a file and compute its SHA-256:
Or, for more control:
(You can learn more about this API from our TypeScript bindings.)
EOF
There are also a few other goodies in this release, so definitely check out the changelog below.
Enjoy!
Changelog
- gumjs: Extend the File API.
- gumjs: Add Checksum API.
- gumjs: Fix handling of relative ESM imports from root.
- glib: (win32) Add Input/OutputStream support for plain files.
- build: Make XP SDK optional on Windows.
- node: Target Electron 19.0.0 instead of 19.0.0-alpha.1.
- node: Define openssl_fips to work around node-gyp issue.