2. FMOD Ex
• Libunity.so uses FMOD Ex statically(with .c sources or .a
archive) linked.
• NOT uses libfmodex.so
• NOT will be applied by function hooking with Elf32_Ehdr like
eglSwapBuffers()’s method.
• C++ based library, but C wrapper classes.
• C functions can be hooked.
3. IDA analysis – libunity.so
• ONLY Imports tab’s functions can be hooked. FMOD’s are in
Exports tab. (Function pointers are NOT in imports entry
table.)
4. FMOD hooking
• FMOD C API hooking is essential.(libkamcordaudio.so does like
this)
• Getting/sharing FMOD system object is important for interoperating
AudioGrabber with Unity3D FMOD audio.
• So we have to hook FMOD_System_Create(FMOD_SYSTEM** system)
• How to hook FMOD?
• Find another entry table.(exports table)
• In VideoGrabber, we found imports table.(libunity.so imports libGLES*.so function)
• Next we have to find exports table.(libunity.so exports some functions to client)
• Or use “dlsym()” again.
• orig_FMOD_System_Create = dlsym(RTLD_DEFAULT,
"FMOD_System_Create");
• LOGD("FMOD_System_Create: 0x%x", orig_FMOD_System_Create);
5. Final AudioGrabber design
• AudioGrabber will be like below:
• Link libfmodex.so.
• Hook some FMOD functions and get FMOD system object.
• Use our FMOD functions in libfmodex.so, manipulate FMOD audio
and get audio buffer data.
• Put audio buffer data into MediaCodec.
• Mix and encode video and audio to .MP4