armlibgen is an undocumented program in the official sdk that produces stub archives and assembly for module and library entry (also called module and library info). armlibgen accepts as input an elf containing input data in an unknown format, or a plaintext emd file. An emd file contains one or more directives, where a directive is a line containing one or more keyword value pairs. The valid directives for version 1.20.4 are
emd: <integer>
moduleinfo_output_format: <scelibent_table|emd|sn_linker_cmd>
Library: <symbol> attr: <integer|auto_export|weak_export|nolink_export|plugin_link|loose_import|syscall_export>
Library: <symbol> version: <integer>
Library: <symbol> stubfile: <string>
Library: <symbol> StubFile: <string>
Library: <symbol> nidsuffix: <string>
Library: <symbol> libnamenid: <integer>
Library: <symbol> function: <symbol> localname: <symbol|string> nidname: <symbol|string> openlevel: <integer> prototype: <string> nidvalue: <integer> bind: <global|weak|not_local>
Library: <symbol> variable: <symbol> localname: <symbol|string> nidname: <symbol|string> openlevel: <integer> prototype: <string> nidvalue: <integer> bind: <global|weak|not_local>
Library: <symbol> importer_long_data: <symbol|integer> label: <symbol> section: <string> flag: <string>
StubFile: <string> Library: <symbol>
Module: <symbol> major_version: <integer> minor_version: <integer>
module_attr: <integer|none|cant_stop|exclusive_load|exclusive_start|can_restart|can_relocate|cant_share>
module_function: <symbol> localname: <symbol> bind: <global|weak|not_local>
module_variable: <symbol> localname: <symbol> bind: <global|weak|not_local>
module_reserve_size: <symbol> size: <integer>
sceModuleInfo_type: <integer>
exporter_long_data: <symbol|integer> label: <symbol> section: <string> flag: <string>
The valid keywords are
Library
Module
OpenLink_space
StubFile
attr
bind
class
define
demangle
emd
exporter_long_data
filter
flag
function
importer_long_data
label
libnamenid
localname
major_version
minor_version
module_attr
module_function
module_reserve_size
module_variable
moduleinfo_output_format
name
namespace
nidname
nidsuffix
nidvalue
openlevel
prototype
sceModuleInfo_type
section
size
stubfile
type
variable
version
visibility
Not all keywords are used. Some keyword value pairs after the first one in a directive are optional.