mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@223 385bec56-5757-e545-9c3a-d8741f4650f1
111 lines
2.6 KiB
C++
111 lines
2.6 KiB
C++
/*---------------------------------------------------------------------------*
|
|
Project: Horizon
|
|
File: Util.h
|
|
|
|
Copyright 2009 Nintendo. All rights reserved.
|
|
|
|
These coded instructions, statements, and computer programs contain
|
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
|
Company Ltd., and are protected by Federal copyright law. They may
|
|
not be disclosed to third parties or copied or duplicated in any form,
|
|
in whole or in part, without the prior written consent of Nintendo.
|
|
|
|
$Rev$
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
#ifndef UTIL_H_
|
|
#define UTIL_H_
|
|
|
|
#include <string>
|
|
#include <nn.h>
|
|
#include <nn/cfg/CTR/cfg_ApiSys.h>
|
|
#include <nn/mcu.h>
|
|
#include <nn/nwm.h>
|
|
|
|
#include "VersionDetect.h"
|
|
|
|
namespace common
|
|
{
|
|
|
|
class Util
|
|
{
|
|
public:
|
|
Util();
|
|
virtual ~Util();
|
|
|
|
void Initialize();
|
|
void Finalize();
|
|
|
|
static void AddCheckDigit(char* serial);
|
|
static void GetSaveDataDirectoryRoot(::std::string& sysSaveRoot, void* ivs, size_t size);
|
|
|
|
bool IsAdapterConnected();
|
|
bool IsBatteryLower();
|
|
bool CanReadIVS();
|
|
bool CanReadSerialNumber();
|
|
void GetSerialNumber(u8** serial, size_t* size);
|
|
u8* GetSerialNumber();
|
|
void GetIvs(void** ivs, size_t* size);
|
|
bit32 GetDeviceId();
|
|
u8 GetCupMajorVersion();
|
|
u8 GetCupMinorVersion();
|
|
u8 GetCupMicroVersion();
|
|
u8 GetNupVersion();
|
|
nn::Handle GetMcuHandle();
|
|
u32 GetBatteryRemain();
|
|
u64 GetInfraDeviceId();
|
|
u64 GetFriendcode();
|
|
char8* GetMacAddress();
|
|
nn::cfg::CTR::CfgRegionCode GetRegion();
|
|
const char* GetRegionCodeA3();
|
|
void GetVersionData(common::VerDef* version);
|
|
|
|
|
|
private:
|
|
NN_PADDING4;
|
|
// フレンドコード
|
|
u64 m_FriendCode;
|
|
|
|
// バージョン情報
|
|
common::VerDef m_VerData;
|
|
|
|
// mcu接続のためのハンドル
|
|
nn::Handle m_McuSession;
|
|
|
|
// デバイスID
|
|
bit32 m_DeviceId;
|
|
|
|
// IVSへのポインタ
|
|
void* mp_Ivs;
|
|
|
|
// IVSのサイズ
|
|
size_t m_SizeofIvs;
|
|
NN_PADDING4;
|
|
|
|
// MCUへのポインタ
|
|
nn::mcu::CTR::HwCheck* mp_Mcu;
|
|
|
|
// リージョン
|
|
nn::cfg::CTR::CfgRegionCode m_Region;
|
|
|
|
// バッテリ残量
|
|
u8 m_BatteryRemain;
|
|
|
|
// シリアルナンバーが読めるかどうか
|
|
bool m_CanReadSerialNumber;
|
|
|
|
// IVSが読めるかどうか
|
|
bool m_CanReadIvs;
|
|
|
|
// シリアルナンバー
|
|
u8 m_SerialNo[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN];
|
|
|
|
// MACアドレス
|
|
char8 m_MacAddress[nn::nwm::Mac::MAC_STRING_SIZE];
|
|
NN_PADDING3;
|
|
};
|
|
|
|
}
|
|
|
|
#endif /* UTIL_H_ */
|