This could be achieved with LIEF: https://lief-project.github.io/doc/latest/tutorials/09_frida_lief.html