-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
W.I.P changes include friend code, and device cert. Device cert doesn't print anything as of now. The NNID is displayed properly. This time it shows both your username and ID. Fixed a problem that caused crashes when de-initializing actu.
- Loading branch information
Showing
8 changed files
with
267 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
#include <3ds.h> | ||
#include <malloc.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
Result actInit(void); | ||
Result actExit(void); | ||
Handle actHandle; | ||
int actRefCount; | ||
|
||
u32 *act_shareMemAddr; | ||
u32 act_shareMemSize; | ||
Handle act_shareMemHandle; | ||
|
||
Result actInit(u32 sdkVer, u32 sharedMemSize); | ||
void actExit(void); | ||
Result ACT_Initialize(u32 sdkVer, void *addr, u32 memSize); | ||
Result ACT_GetAccountInfo(void *buffer, u32 size, u32 blkId); | ||
Result actuInit(void); | ||
Result actuExit(void); | ||
Result ACTU_Initialize(u32 sdkVersion, u32 unknown, Handle handle); | ||
Result ACTU_GetAccountDataBlock(u32 unknown, u32 size, u32 blockId, void* output); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
#include <3ds.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
Handle amHandle; | ||
|
||
Result AMNet_GetDeviceCert(u8 *buffer); | ||
char * base64encode(const char * input); | ||
Result amNetGetDeviceCert(u8 const * buffer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "utils.h" | ||
|
||
char * base64Encode(u8 const * input) | ||
{ | ||
int len = strlen((const char *)input); | ||
int leftover = len % 3; | ||
char *ret = malloc(((len/3) * 4) + ((leftover)?4:0) + 1); | ||
int n = 0; | ||
int outlen = 0; | ||
uint8_t i = 0; | ||
uint8_t *inp = (uint8_t *) input; | ||
const char *index = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | ||
"abcdefghijklmnopqrstuvwxyz" | ||
"0123456789+/"; | ||
|
||
if (ret == NULL) | ||
return NULL; | ||
|
||
// Convert each 3 bytes of input to 4 bytes of output. | ||
len -= leftover; | ||
for (n = 0; n < len; n+=3) { | ||
i = inp[n] >> 2; | ||
ret[outlen++] = index[i]; | ||
|
||
i = (inp[n] & 0x03) << 4; | ||
i |= (inp[n+1] & 0xf0) >> 4; | ||
ret[outlen++] = index[i]; | ||
|
||
i = ((inp[n+1] & 0x0f) << 2); | ||
i |= ((inp[n+2] & 0xc0) >> 6); | ||
ret[outlen++] = index[i]; | ||
|
||
i = (inp[n+2] & 0x3f); | ||
ret[outlen++] = index[i]; | ||
} | ||
|
||
// Handle leftover 1 or 2 bytes. | ||
if (leftover) { | ||
i = (inp[n] >> 2); | ||
ret[outlen++] = index[i]; | ||
|
||
i = (inp[n] & 0x03) << 4; | ||
if (leftover == 2) { | ||
i |= (inp[n+1] & 0xf0) >> 4; | ||
ret[outlen++] = index[i]; | ||
|
||
i = ((inp[n+1] & 0x0f) << 2); | ||
} | ||
ret[outlen++] = index[i]; | ||
ret[outlen++] = '='; | ||
if (leftover == 1) | ||
ret[outlen++] = '='; | ||
} | ||
ret[outlen] = '\0'; | ||
return ret; | ||
} |
Oops, something went wrong.