MCPcopy Create free account
hub / github.com/TheOfficialFloW/VitaShell / getSfoString

Function getSfoString

sfo.c:49–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49int getSfoString(void *buffer, const char *name, char *string, int length) {
50 SfoHeader *header = (SfoHeader *)buffer;
51 SfoEntry *entries = (SfoEntry *)((uint32_t)buffer + sizeof(SfoHeader));
52
53 if (header->magic != SFO_MAGIC)
54 return VITASHELL_ERROR_INVALID_MAGIC;
55
56 int i;
57 for (i = 0; i < header->count; i++) {
58 if (strcmp(buffer + header->keyofs + entries[i].nameofs, name) == 0) {
59 memset(string, 0, length);
60 strncpy(string, buffer + header->valofs + entries[i].dataofs, length);
61 string[length - 1] = '\0';
62 return 0;
63 }
64 }
65
66 return VITASHELL_ERROR_NOT_FOUND;
67}
68
69int setSfoValue(void *buffer, const char *name, uint32_t value) {
70 SfoHeader *header = (SfoHeader *)buffer;

Callers 3

makeHeadBinFunction · 0.85
refreshNeededFunction · 0.85
refreshAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected