Post by oleavr on Dec 4, 2021 2:58:26 GMT
With the machine hooked up to the local network, I finally got around to cross-compiling Frida for it. Here is what it looks like.
This was done very quickly, and it's getting so late that I'm going to have to rush through the details real quick:
Some examples:
Note: The frida-agent.so binary is quite large due to the V8 JS engine being included. Frida can be built without it to shave off a lot of footprint, but I opted to include it for the initial exploration, just in case I'd end up using it. (The default JS engine is QuickJS, but you can switch to V8 by passing --runtime=v8 to the CLI tools.)
The example agent above is really primitive, but down the road I'd like to write a generic "bridge" to make instrumentation really easy. (Frida already has bridges such as frida-objc-bridge, frida-swift-bridge, frida-java-bridge, etc., and it would be awesome to write a frida-c64-bridge that exposes a lot of different functionality by building on VICE's internals.)
This was done very quickly, and it's getting so late that I'm going to have to rush through the details real quick:
- Uploaded binaries here. Extract this tarball's three files (frida-server, lib/frida-helper, lib/frida-agent.so) to the root of a thumb-drive. Mount it at /mnt (important), then run frida-server and tell it to listen on a network interface, e.g.: /mnt/frida-server -l 192.168.1.64 (by default it will only listen on the loopback interface).
- From another machine with frida-tools installed (pip install frida-tools), you can now connect to the running frida-server by passing -H 192.168.1.64
Some examples:
- List running processes: frida-ps -H 192.168.1.64
- Attach Frida's REPL to the64 process: frida -H 192.168.1.64 the64
- Inject a script into the64: frida -H 192.168.1.64 the64 -l c64.js (Example script here. Note that the outer-loop offset is hard-coded for firmware v1.5.2 for now.)
Note: The frida-agent.so binary is quite large due to the V8 JS engine being included. Frida can be built without it to shave off a lot of footprint, but I opted to include it for the initial exploration, just in case I'd end up using it. (The default JS engine is QuickJS, but you can switch to V8 by passing --runtime=v8 to the CLI tools.)
The example agent above is really primitive, but down the road I'd like to write a generic "bridge" to make instrumentation really easy. (Frida already has bridges such as frida-objc-bridge, frida-swift-bridge, frida-java-bridge, etc., and it would be awesome to write a frida-c64-bridge that exposes a lot of different functionality by building on VICE's internals.)