|
| 1 | +/* |
| 2 | +# _____ ___ ____ ___ ____ |
| 3 | +# ____| | ____| | | |____| |
| 4 | +# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
| 5 | +#----------------------------------------------------------------------- |
| 6 | +# (c) 2020 Francisco Javier Trujillo Mata <[email protected]> |
| 7 | +# Licenced under Academic Free License version 2.0 |
| 8 | +# Review ps2sdk README & LICENSE files for further details. |
| 9 | +*/ |
| 10 | + |
| 11 | +/** |
| 12 | + * @file |
| 13 | + * ELF Loader functions. |
| 14 | + */ |
| 15 | + |
| 16 | +#ifndef __ELFLOADER_H__ |
| 17 | +#define __ELFLOADER_H__ |
| 18 | + |
| 19 | +#ifdef __cplusplus |
| 20 | +extern "C" { |
| 21 | +#endif |
| 22 | + |
| 23 | +// Before call this method be sure that you have previously called sbv_patch_disable_prefix_check(); |
| 24 | +extern int LoadELFFromFile(const char *filename, int argc, char *argv[]); |
| 25 | + |
| 26 | +/** Modify argv[0] when partition info should be kept |
| 27 | + * |
| 28 | + * @param filename path to the file itself |
| 29 | + * @param partition block device + partition name |
| 30 | + * @param argc Number of arguments. |
| 31 | + * @param argv Pointer to array of arguments. |
| 32 | + * @returns positive on success, zero value on failure |
| 33 | + * |
| 34 | + * You should prepare filename and partition before parsing in function |
| 35 | + * |
| 36 | + * filename should be changed to <fs_type>:/path_to_file_without_mountpoint |
| 37 | + * for example `pfs3:/TEST.ELF` (where `pfs3` is mountpoint name) will become |
| 38 | + * `pfs:/TEST.ELF` (where `pfs` - filesystem type) |
| 39 | + * |
| 40 | + * partition should be in form <block_device><partition_name>: |
| 41 | + * for example `hdd0:__common:` |
| 42 | + * block_device - can be `hdd0:`, `hdd1:` , `dvr_hdd0:` |
| 43 | + * <partition_name> - name of APA partition on particular block device |
| 44 | + * dont forget about leading ":" |
| 45 | + * |
| 46 | + * It is not necessary that filename should be on that partition |
| 47 | + * filename - mass:/TEST.ELF |
| 48 | + * partition - pfs:/__common |
| 49 | + * will be valid usage |
| 50 | + */ |
| 51 | +extern int LoadELFFromFileWithPartition(const char *filename, const char *partition, int argc, char *argv[]); |
| 52 | + |
| 53 | +#ifdef __cplusplus |
| 54 | +} |
| 55 | +#endif |
| 56 | + |
| 57 | +#endif /* __ELFLOADER_H__ */ |
0 commit comments