Skip to content

Commit

Permalink
Update v0.7.4
Browse files Browse the repository at this point in the history
Now displays local friend code seed.
Storage sizes now display appropriately according to your
available/total storage. MB is no longer the default unit.
Also cleaned up main.c, now uses separate headers like 3DSident-GUI
  • Loading branch information
joel16 committed Jun 2, 2017
1 parent 594c212 commit f98a367
Show file tree
Hide file tree
Showing 20 changed files with 463 additions and 260 deletions.
21 changes: 21 additions & 0 deletions include/actu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <3ds.h>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

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);
8 changes: 8 additions & 0 deletions include/am.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <3ds.h>
#include <stdlib.h>
#include <string.h>

Handle amHandle;

char * base64encode(const char * input);
Result amNetGetDeviceCert(u8 const * buffer);
8 changes: 8 additions & 0 deletions include/cfgs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <3ds.h>

Handle cfgHandle;

Result cfgsInit();
Result cfgsExit();
Result CFG_GetConfig(u32 size, u32 blkID, u8* outData);
Result cfgsSecureInfoGetSerialNo(char *serial);
25 changes: 25 additions & 0 deletions include/frd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <3ds.h>
#include <string.h>

Handle frdHandle;

typedef struct
{
u32 principalId;
u64 localFriendCode;
} FriendKey;

typedef struct
{
u8 region;
u8 country;
u8 area;
u8 language;
u8 platform;
} FrdProfile;

Result frdInit();
Result frdExit();
Result frdSetClientSdkVersion(u32 sdkVer);
u64 frdPrincipalIdToFriendCode(u64 *fc, u64 pid);
Result frdGetMyFriendKey(FriendKey *key);
13 changes: 13 additions & 0 deletions include/fs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <3ds.h>
#include <stdbool.h>
#include <stdio.h>
#include <sys/stat.h>

FS_Archive sdmcArchive;

void openSdArchive();
void closeSdArchive();
int makeDir(const char * path);
bool fileExists(char * path);
bool dirExists(const char * path);
bool deleteFile(const char *path);
5 changes: 5 additions & 0 deletions include/gsplcd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <3ds.h>

Handle gspLcdHandle;

Result GSPLCD_GetBrightness(u32 screen, u32 *brightness);
11 changes: 11 additions & 0 deletions include/mcu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <3ds.h>

Handle mcuhwcHandle;

Result mcuInit();
Result mcuExit();
Result mcuGetBatteryLevel(u8* out);
Result mcuGetBatteryVoltage(u8* out);
Result mcuGetVolume(u8* out);
Result GetMcuFwVerHigh(u8* out);
Result GetMcuFwVerLow(u8* out);
4 changes: 4 additions & 0 deletions include/misc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include <3ds.h>

u32 titleCount(FS_MediaType mediaType);
bool detectSD();
3 changes: 3 additions & 0 deletions include/power.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <3ds.h>

const char * batteryStatus();
17 changes: 17 additions & 0 deletions include/screenshot.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <png.h>
#include <zlib.h>
#include <3ds.h>

#define NUM_LEVELS (Z_BEST_COMPRESSION - Z_NO_COMPRESSION + 1)

char fileName[256];

int level, screenCapture;
unsigned int format_choice;
GSPGPU_FramebufferFormats format; // = GSP_RGBA8_OES
void captureScreenshot();
17 changes: 17 additions & 0 deletions include/system.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <3ds.h>

const char * getModel();
const char * getRegion();
const char * getLang();
char * getMacAddress();
char * getScreenType();
u64 principalIdToFriendCode(u64 pid);
u64 getLocalFriendCodeSeed();
FriendKey getMyFriendKey(void);
char * getSerialNum(void);
u32 getDeviceId(void);
u64 getSoapId(void);
char * getDeviceCert(void);
char * getNNID(void);
char * isDebugModeEnabled();
char * getBrightness(u32 screen);
7 changes: 7 additions & 0 deletions include/utils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <3ds.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

void getSizeString(char *string, uint64_t size);
char * base64Encode(u8 const * input);
2 changes: 1 addition & 1 deletion resources/cia.rsf
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ AccessControlInfo:
- hid:USER
- mcu::HWC
- ndm:u
- news:s
- ps:ps
- nwm::UDS
- ptm:u
- pxi:dev
Expand Down
16 changes: 16 additions & 0 deletions source/cfgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ Result cfgsExit()
return svcCloseHandle(cfgHandle);
}

Result CFG_GetConfig(u32 size, u32 blkID, u8* outData)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();

cmdbuf[0] = IPC_MakeHeader(0x1,2,2); // 0x10082
cmdbuf[1] = size;
cmdbuf[2] = blkID;
cmdbuf[3] = IPC_Desc_Buffer(size,IPC_BUFFER_W);
cmdbuf[4] = (u32)outData;

if(R_FAILED(ret = svcSendSyncRequest(cfgHandle)))return ret;

return (Result)cmdbuf[1];
}

Result cfgsSecureInfoGetSerialNo(char *serial)
{
Result ret = 0;
Expand Down
Loading

0 comments on commit f98a367

Please sign in to comment.