Data Structures | Defines | Functions | Variables

mksfoex.c File Reference

#include <stdio.h>
#include <stdint.h>
#include <getopt.h>
#include <string.h>
#include <stdlib.h>
#include "types.h"
Include dependency graph for mksfoex.c:

Data Structures

struct  SfoHeader
struct  SfoEntry
struct  EntryContainer

Defines

#define PSF_MAGIC   0x46535000
#define PSF_VERSION   0x00000101
#define PSF_TYPE_BIN   0
#define PSF_TYPE_STR   2
#define PSF_TYPE_VAL   4
#define MAX_OPTIONS   (256)

Functions

struct SfoHeader __attribute__ ((packed))
struct EntryContainerfind_free ()
struct EntryContainerfind_name (const char *name)
int add_string (char *str)
int add_dword (char *str)
int process_args (int argc, char **argv)
int main (int argc, char **argv)

Variables

uint32_t magic
uint32_t version
uint32_t keyofs
uint32_t valofs
uint32_t count
uint16_t nameofs
uint8_t alignment
uint8_t type
uint32_t valsize
uint32_t totalsize
uint32_t dataofs
struct EntryContainer __attribute__
struct EntryContainer g_defaults []

Define Documentation

#define MAX_OPTIONS   (256)
#define PSF_MAGIC   0x46535000

Referenced by main().

#define PSF_TYPE_BIN   0
#define PSF_TYPE_STR   2
#define PSF_TYPE_VAL   4

Referenced by main().

#define PSF_VERSION   0x00000101

Referenced by main().


Function Documentation

struct SfoHeader __attribute__ ( (packed)   ) 
int add_dword ( char *  str  ) 
int add_string ( char *  str  ) 
struct EntryContainer* find_free (  )  [read]

References i, name, and NULL.

Referenced by add_dword(), add_string(), and main().

struct EntryContainer* find_name ( const char *  name  )  [read]

References i, NULL, and strcmp().

Referenced by main().

int main ( int  argc,
char **  argv 
)
int process_args ( int  argc,
char **  argv 
)

References add_dword(), add_string(), getopt_long(), NULL, optarg, and optind.

Referenced by main().


Variable Documentation

uint8_t alignment
uint32_t count
uint32_t dataofs
Initial value:
 {
        { "BOOTABLE", PSF_TYPE_VAL, 1, NULL },
        { "CATEGORY", PSF_TYPE_STR, 0, "MG" },
        { "DISC_ID",  PSF_TYPE_STR, 0, "UCJS10041" },
        { "DISC_VERSION", PSF_TYPE_STR, 0, "1.00" },
        { "PARENTAL_LEVEL", PSF_TYPE_VAL, 1, NULL },
        { "PSP_SYSTEM_VER", PSF_TYPE_STR, 0, "1.00" },
        { "REGION", PSF_TYPE_VAL, 0x8000, NULL },
}
uint32_t keyofs

Referenced by main().

uint32_t magic
uint16_t nameofs
uint32_t totalsize

Referenced by main().

uint8_t type
uint32_t valofs
uint32_t valsize

Referenced by main().

uint32_t version