README.md (4842B)
1 vita-toolchain 2 ============== 3 These are a set of tools that, along with an ARM compiler and linker, provides a 4 build system for PlayStation Vita(TM). Look at 5 [buildscripts](https://github.com/vitasdk/buildscripts) for more information on 6 building the complete toolchain with binutils/gcc/newlib. As such, this repo 7 only contains Vita specific host tools. Check out the 8 [specifications](doc/specifications.pdf) for more details on the Vita executable 9 format, these tools, and their inputs/outputs (including the YAML configuration 10 format). 11 12 ### vita-elf-create 13 ``` 14 usage: vita-elf-create [-v|vv|vvv] [-n] [-e config.yml] input.elf output.velf 15 -v,-vv,-vvv: logging verbosity (more v is more verbose) 16 -n : allow empty imports 17 -e yml : optional config options 18 input.elf : input ARM ET_EXEC type ELF 19 output.velf: output ET_SCE_RELEXEC type ELF 20 ``` 21 Converts a standard `ET_EXEC` ELF (outputted by `arm-vita-eabi-gcc` for example) 22 to the Sony ELF format. 23 24 ### vita-elf-export 25 ``` 26 usage: vita-elf-export mod-type elf exports imports 27 mod-type: valid values: 'u'/'user' for user mode, else 'k'/'kernel' for kernel mode 28 elf: path to the elf produced by the toolchain to be used by vita-elf-create 29 exports: path to the config yaml file specifying the module information and exports 30 imports: path to write the import yaml generated by this tool 31 ``` 32 Creates an import database YAML from a Sony ELF and config YAML. This import 33 database is a YAML file (not to be confused with the config YAML file) which 34 defines the NID mappings for a given module. This can be used by other tools for 35 debugging and reversing purposes. 36 37 ### vita-libs-gen 38 ``` 39 usage: vita-libs-gen nids.yml [extra.yml ...] output-dir 40 -c: Generate CMakeLists.txt instead of a Makefile 41 ``` 42 Given a list of import database YAML files (either from `vita-elf-create` or 43 manually written by hackers for Sony owned modules), this will generate stub 44 libraries that can be linked to such that `vita-elf-create` can properly 45 generate a Sony ELF. After calling `vita-libs-gen` you need to run `make` or 46 `cmake` in the output directory to build the stubs. 47 48 ### vita-make-fself 49 ``` 50 usage: vita-make-fself [-s|-ss] [-c] input.velf output-eboot.bin 51 -s : Generate a safe eboot.bin. A safe eboot.bin does not have access 52 to restricted APIs and important parts of the filesystem. 53 -ss: Generate a secret-safe eboot.bin. Do not use this option if you don't know what it does. 54 -c : Enable compression. 55 ``` 56 Generates a FSELF (the format expected of `eboot.bin` loaded by Vita) which 57 wraps around the Sony ELF file. Optionally supports compression of the input 58 ELF. Also allows marking a homebrew as "safe", which prevents it from harming 59 the system. 60 61 ### vita-mksfoex 62 ``` 63 usage: mksfoex [options] TITLE output.sfo 64 -d NAME=VALUE Add a new DWORD value 65 -s NAME=STR Add a new string value 66 ```` 67 Generates a `param.sfo` file for a given title. `param.sfo` is required to 68 launch a homebrew from LiveArea. The `TITLE` id can be anything but it is 69 recommended that you use `XXXXYYYYY` where `XXXX` is an author specific 70 identifier and `YYYYY` is a unique number identifying your homebrew. For 71 example, molecularShell uses `MLCL00001`. 72 73 ### vita-pack-vpk 74 ``` 75 Usage: 76 vita-pack-vpk [OPTIONS] output.vpk 77 78 -s, --sfo=param.sfo sets the param.sfo file 79 -b, --eboot=eboot.bin sets the eboot.bin file 80 -a, --add src=dst adds the file src to the vpk as dst 81 -h, --help displays this help and exit 82 ``` 83 Generates a VPK homebrew package. `eboot.bin` and `param.sfo` are required. 84 85 ## Development 86 Required libraries are 87 [libelf](http://www.mr511.de/software/libelf-0.8.13.tar.gz), 88 [zlib](http://zlib.net/zlib-1.2.8.tar.gz), 89 [libzip](https://nih.at/libzip/libzip-1.1.3.tar.gz), and 90 [libyaml](http://pyyaml.org/download/libyaml/yaml-0.1.7.tar.gz). Please note 91 that there are some compatibility problems with built-in libelf so it is 92 recommended that you download it from the provided link. 93 94 After getting the dependencies, build with 95 ``` 96 mkdir build && cd build 97 cmake .. 98 make 99 ``` 100 101 ### Note on Naming 102 Early in the development, there was a confusion on the meaning of "module" and 103 "library" in context of the Vita. After the tools were written initially, we 104 decided to reverse the meaning of those two words. All user-facing usage of 105 those words have been changed (console outputs, messages, etc) but it is too 106 much word to change all internal usage of those words (function/variable names, 107 etc). Therefore you may be confused when reading the source since the meaning of 108 "module" and "library" is used inconsistently. It would be great if someone 109 could take the time to correct all the usages ("module" exports one or more 110 "libraries" and imports zero or more "libraries"; `eboot.bin` is a module).