Use Dir[] instead of [libs]#each

deobfuscate local variable names from ffi_lib, and add docs.
deobfuscate attach_function() parameters
Use full-style-block for attach_function() -> arguments.map!