ACT_U::ACT_U(std::shared_ptr<Module> act) : Module::Interface(std::move(act), "act:u") { static const FunctionInfo functions[] = { // clang-format off {0x00010084, nullptr, "Initialize"}, {0x00020040, nullptr, "GetErrorCode"}, {0x000600C2, nullptr, "GetAccountDataBlock"}, {0x000B0042, nullptr, "AcquireEulaList"}, {0x000D0040, nullptr, "GenerateUuid"}, // clang-format on }; RegisterHandlers(functions); }
CFG_I::CFG_I(std::shared_ptr<Module> cfg) : Module::Interface(std::move(cfg), "cfg:i", 23) { static const FunctionInfo functions[] = { // cfg common {0x00010082, &CFG_I::GetConfigInfoBlk2, "GetConfigInfoBlk2"}, {0x00020000, &CFG_I::D<&CFG_I::SecureInfoGetRegion, 0x0002>, "SecureInfoGetRegion"}, {0x00030040, &CFG_I::GenHashConsoleUnique, "GenHashConsoleUnique"}, {0x00040000, &CFG_I::GetRegionCanadaUSA, "GetRegionCanadaUSA"}, {0x00050000, &CFG_I::GetSystemModel, "GetSystemModel"}, {0x00060000, &CFG_I::GetModelNintendo2DS, "GetModelNintendo2DS"}, {0x00070040, nullptr, "WriteToFirstByteCfgSavegame"}, {0x00080080, nullptr, "GoThroughTable"}, {0x00090040, &CFG_I::GetCountryCodeString, "GetCountryCodeString"}, {0x000A0040, &CFG_I::GetCountryCodeID, "GetCountryCodeID"}, {0x000B0000, nullptr, "IsFangateSupported"}, // cfg:i {0x04010082, &CFG_I::D<&CFG_I::GetConfigInfoBlk8, 0x0401>, "GetConfigInfoBlk8"}, {0x04020082, &CFG_I::D<&CFG_I::SetConfigInfoBlk4, 0x0402>, "SetConfigInfoBlk4"}, {0x04030000, &CFG_I::D<&CFG_I::UpdateConfigNANDSavegame, 0x0403>, "UpdateConfigNANDSavegame"}, {0x04040042, nullptr, "GetLocalFriendCodeSeedData"}, {0x04050000, nullptr, "GetLocalFriendCodeSeed"}, {0x04060000, &CFG_I::D<&CFG_I::SecureInfoGetRegion, 0x0406>, "SecureInfoGetRegion"}, {0x04070000, nullptr, "SecureInfoGetByte101"}, {0x04080042, nullptr, "SecureInfoGetSerialNo"}, {0x04090000, nullptr, "UpdateConfigBlk00040003"}, {0x08010082, &CFG_I::D<&CFG_I::GetConfigInfoBlk8, 0x0801>, "GetConfigInfoBlk8"}, {0x08020082, &CFG_I::D<&CFG_I::SetConfigInfoBlk4, 0x0802>, "SetConfigInfoBlk4"}, {0x08030000, &CFG_I::D<&CFG_I::UpdateConfigNANDSavegame, 0x0803>, "UpdateConfigNANDSavegame"}, {0x080400C2, nullptr, "CreateConfigInfoBlk"}, {0x08050000, nullptr, "DeleteConfigNANDSavefile"}, {0x08060000, &CFG_I::FormatConfig, "FormatConfig"}, {0x08080000, nullptr, "UpdateConfigBlk1"}, {0x08090000, nullptr, "UpdateConfigBlk2"}, {0x080A0000, nullptr, "UpdateConfigBlk3"}, {0x080B0082, nullptr, "SetGetLocalFriendCodeSeedData"}, {0x080C0042, nullptr, "SetLocalFriendCodeSeedSignature"}, {0x080D0000, nullptr, "DeleteCreateNANDLocalFriendCodeSeed"}, {0x080E0000, nullptr, "VerifySigLocalFriendCodeSeed"}, {0x080F0042, nullptr, "GetLocalFriendCodeSeedData"}, {0x08100000, nullptr, "GetLocalFriendCodeSeed"}, {0x08110084, nullptr, "SetSecureInfo"}, {0x08120000, nullptr, "DeleteCreateNANDSecureInfo"}, {0x08130000, nullptr, "VerifySigSecureInfo"}, {0x08140042, nullptr, "SecureInfoGetData"}, {0x08150042, nullptr, "SecureInfoGetSignature"}, {0x08160000, &CFG_I::D<&CFG_I::SecureInfoGetRegion, 0x0816>, "SecureInfoGetRegion"}, {0x08170000, nullptr, "SecureInfoGetByte101"}, {0x08180042, nullptr, "SecureInfoGetSerialNo"}, }; RegisterHandlers(functions); }
SFDNSRES::SFDNSRES() : ServiceFramework("sfdnsres") { static const FunctionInfo functions[] = {{0, nullptr, "SetDnsAddressesPrivate"}, {1, nullptr, "GetDnsAddressPrivate"}, {2, nullptr, "GetHostByName"}, {3, nullptr, "GetHostByAddr"}, {4, nullptr, "GetHostStringError"}, {5, nullptr, "GetGaiStringError"}, {6, &SFDNSRES::GetAddrInfo, "GetAddrInfo"}, {7, nullptr, "GetNameInfo"}, {8, nullptr, "RequestCancelHandle"}, {9, nullptr, "CancelSocketCall"}}; RegisterHandlers(functions); }
NEWS_S::NEWS_S() : ServiceFramework("news:s", 2) { const FunctionInfo functions[] = { {0x000100C6, nullptr, "AddNotification"}, {0x00050000, &NEWS_S::GetTotalNotifications, "GetTotalNotifications"}, {0x00060042, nullptr, "SetNewsDBHeader"}, {0x00070082, nullptr, "SetNotificationHeader"}, {0x00080082, nullptr, "SetNotificationMessage"}, {0x00090082, nullptr, "SetNotificationImage"}, {0x000A0042, nullptr, "GetNewsDBHeader"}, {0x000B0082, nullptr, "GetNotificationHeader"}, {0x000C0082, nullptr, "GetNotificationMessage"}, {0x000D0082, nullptr, "GetNotificationImage"}, {0x000E0040, nullptr, "SetInfoLEDPattern"}, {0x00120082, nullptr, "GetNotificationHeaderOther"}, {0x00130000, nullptr, "WriteNewsDBSavedata"}, }; RegisterHandlers(functions); }
int main(int argc, char **argv) { struct NaClApp app; NaClHandleBootstrapArgs(&argc, &argv); NaClDebugExceptionHandlerStandaloneHandleArgs(argc, argv); /* Turn off buffering to aid debugging. */ setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); NaClAllModulesInit(); if (argc != 3) { NaClLog(LOG_FATAL, "Expected 2 arguments: <executable-filename> <crash-type>\n"); } g_crash_type = argv[2]; CHECK(NaClAppCtor(&app)); CHECK(NaClAppLoadFileFromFilename(&app, argv[1]) == LOAD_OK); NaClAppInitialDescriptorHookup(&app); if (TestWithUntrustedExceptionHandling()) { app.enable_exception_handling = 1; #if NACL_WINDOWS app.attach_debug_exception_handler_func = NaClDebugExceptionHandlerStandaloneAttach; #endif } NaClAddSyscall(NACL_sys_test_syscall_1, JumpToZeroCrashSyscall); NaClAddSyscall(NACL_sys_test_syscall_2, JumpIntoSandboxCrashSyscall); RegisterHandlers(); CHECK(NaClCreateMainThread(&app, argc - 1, argv + 1, NULL)); NaClWaitForMainThreadToExit(&app); NaClLog(LOG_ERROR, "We did not expect the test program to exit cleanly\n"); return 1; }
PTM_U::PTM_U(std::shared_ptr<Module> ptm) : Module::Interface(std::move(ptm), "ptm:u", 26) { static const FunctionInfo functions[] = { {0x00010002, nullptr, "RegisterAlarmClient"}, {0x00020080, nullptr, "SetRtcAlarm"}, {0x00030000, nullptr, "GetRtcAlarm"}, {0x00040000, nullptr, "CancelRtcAlarm"}, {0x00050000, &PTM_U::GetAdapterState, "GetAdapterState"}, {0x00060000, &PTM_U::GetShellState, "GetShellState"}, {0x00070000, &PTM_U::GetBatteryLevel, "GetBatteryLevel"}, {0x00080000, &PTM_U::GetBatteryChargeState, "GetBatteryChargeState"}, {0x00090000, &PTM_U::GetPedometerState, "GetPedometerState"}, {0x000A0042, nullptr, "GetStepHistoryEntry"}, {0x000B00C2, &PTM_U::GetStepHistory, "GetStepHistory"}, {0x000C0000, &PTM_U::GetTotalStepCount, "GetTotalStepCount"}, {0x000D0040, nullptr, "SetPedometerRecordingMode"}, {0x000E0000, nullptr, "GetPedometerRecordingMode"}, {0x000F0084, nullptr, "GetStepHistoryAll"}, }; RegisterHandlers(functions); }
APT_A::APT_A(std::shared_ptr<Module> apt) : Module::Interface(std::move(apt), "APT:A", MaxAPTSessions) { static const FunctionInfo functions[] = { {0x00010040, &APT_A::GetLockHandle, "GetLockHandle"}, {0x00020080, &APT_A::Initialize, "Initialize"}, {0x00030040, &APT_A::Enable, "Enable"}, {0x00040040, nullptr, "Finalize"}, {0x00050040, &APT_A::GetAppletManInfo, "GetAppletManInfo"}, {0x00060040, &APT_A::GetAppletInfo, "GetAppletInfo"}, {0x00070000, nullptr, "GetLastSignaledAppletId"}, {0x00080000, nullptr, "CountRegisteredApplet"}, {0x00090040, &APT_A::IsRegistered, "IsRegistered"}, {0x000A0040, nullptr, "GetAttribute"}, {0x000B0040, &APT_A::InquireNotification, "InquireNotification"}, {0x000C0104, &APT_A::SendParameter, "SendParameter"}, {0x000D0080, &APT_A::ReceiveParameter, "ReceiveParameter"}, {0x000E0080, &APT_A::GlanceParameter, "GlanceParameter"}, {0x000F0100, &APT_A::CancelParameter, "CancelParameter"}, {0x001000C2, nullptr, "DebugFunc"}, {0x001100C0, nullptr, "MapProgramIdForDebug"}, {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"}, {0x00130000, nullptr, "GetPreparationState"}, {0x00140040, nullptr, "SetPreparationState"}, {0x00150140, &APT_A::PrepareToStartApplication, "PrepareToStartApplication"}, {0x00160040, &APT_A::PreloadLibraryApplet, "PreloadLibraryApplet"}, {0x00170040, nullptr, "FinishPreloadingLibraryApplet"}, {0x00180040, &APT_A::PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, {0x00190040, nullptr, "PrepareToStartSystemApplet"}, {0x001A0000, nullptr, "PrepareToStartNewestHomeMenu"}, {0x001B00C4, nullptr, "StartApplication"}, {0x001C0000, nullptr, "WakeupApplication"}, {0x001D0000, nullptr, "CancelApplication"}, {0x001E0084, &APT_A::StartLibraryApplet, "StartLibraryApplet"}, {0x001F0084, nullptr, "StartSystemApplet"}, {0x00200044, nullptr, "StartNewestHomeMenu"}, {0x00210000, nullptr, "OrderToCloseApplication"}, {0x00220040, nullptr, "PrepareToCloseApplication"}, {0x00230040, nullptr, "PrepareToJumpToApplication"}, {0x00240044, nullptr, "JumpToApplication"}, {0x002500C0, &APT_A::PrepareToCloseLibraryApplet, "PrepareToCloseLibraryApplet"}, {0x00260000, nullptr, "PrepareToCloseSystemApplet"}, {0x00270044, &APT_A::CloseApplication, "CloseApplication"}, {0x00280044, &APT_A::CloseLibraryApplet, "CloseLibraryApplet"}, {0x00290044, nullptr, "CloseSystemApplet"}, {0x002A0000, nullptr, "OrderToCloseSystemApplet"}, {0x002B0000, nullptr, "PrepareToJumpToHomeMenu"}, {0x002C0044, nullptr, "JumpToHomeMenu"}, {0x002D0000, nullptr, "PrepareToLeaveHomeMenu"}, {0x002E0044, nullptr, "LeaveHomeMenu"}, {0x002F0040, nullptr, "PrepareToLeaveResidentApplet"}, {0x00300044, nullptr, "LeaveResidentApplet"}, {0x00310100, &APT_A::PrepareToDoApplicationJump, "PrepareToDoApplicationJump"}, {0x00320084, &APT_A::DoApplicationJump, "DoApplicationJump"}, {0x00330000, &APT_A::GetProgramIdOnApplicationJump, "GetProgramIdOnApplicationJump"}, {0x00340084, nullptr, "SendDeliverArg"}, {0x00350080, nullptr, "ReceiveDeliverArg"}, {0x00360040, nullptr, "LoadSysMenuArg"}, {0x00370042, nullptr, "StoreSysMenuArg"}, {0x00380040, nullptr, "PreloadResidentApplet"}, {0x00390040, nullptr, "PrepareToStartResidentApplet"}, {0x003A0044, nullptr, "StartResidentApplet"}, {0x003B0040, &APT_A::CancelLibraryApplet, "CancelLibraryApplet"}, {0x003C0042, nullptr, "SendDspSleep"}, {0x003D0042, nullptr, "SendDspWakeUp"}, {0x003E0080, nullptr, "ReplySleepQuery"}, {0x003F0040, nullptr, "ReplySleepNotificationComplete"}, {0x00400042, &APT_A::SendCaptureBufferInfo, "SendCaptureBufferInfo"}, {0x00410040, &APT_A::ReceiveCaptureBufferInfo, "ReceiveCaptureBufferInfo"}, {0x00420080, nullptr, "SleepSystem"}, {0x00430040, &APT_A::NotifyToWait, "NotifyToWait"}, {0x00440000, &APT_A::GetSharedFont, "GetSharedFont"}, {0x00450040, nullptr, "GetWirelessRebootInfo"}, {0x00460104, &APT_A::Wrap, "Wrap"}, {0x00470104, &APT_A::Unwrap, "Unwrap"}, {0x00480100, nullptr, "GetProgramInfo"}, {0x00490180, nullptr, "Reboot"}, {0x004A0040, nullptr, "GetCaptureInfo"}, {0x004B00C2, &APT_A::AppletUtility, "AppletUtility"}, {0x004C0000, nullptr, "SetFatalErrDispMode"}, {0x004D0080, nullptr, "GetAppletProgramInfo"}, {0x004E0000, nullptr, "HardwareResetAsync"}, {0x004F0080, &APT_A::SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, {0x00500040, &APT_A::GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, {0x00510080, &APT_A::GetStartupArgument, "GetStartupArgument"}, {0x00520104, nullptr, "Wrap1"}, {0x00530104, nullptr, "Unwrap1"}, {0x00550040, &APT_A::SetScreenCapPostPermission, "SetScreenCapPostPermission"}, {0x00560000, &APT_A::GetScreenCapPostPermission, "GetScreenCapPostPermission"}, {0x00570044, nullptr, "WakeupApplication2"}, {0x00580002, nullptr, "GetProgramID"}, {0x01010000, &APT_A::CheckNew3DSApp, "CheckNew3DSApp"}, {0x01020000, &APT_A::CheckNew3DS, "CheckNew3DS"}, {0x01040000, nullptr, "IsStandardMemoryLayout"}, {0x01050100, nullptr, "IsTitleAllowed"}, }; RegisterHandlers(functions); }
CAM_C::CAM_C(std::shared_ptr<Module> cam) : Module::Interface(std::move(cam), "cam:c", 1) { static const FunctionInfo functions[] = { {0x00010040, &CAM_C::StartCapture, "StartCapture"}, {0x00020040, &CAM_C::StopCapture, "StopCapture"}, {0x00030040, &CAM_C::IsBusy, "IsBusy"}, {0x00040040, &CAM_C::ClearBuffer, "ClearBuffer"}, {0x00050040, &CAM_C::GetVsyncInterruptEvent, "GetVsyncInterruptEvent"}, {0x00060040, &CAM_C::GetBufferErrorInterruptEvent, "GetBufferErrorInterruptEvent"}, {0x00070102, &CAM_C::SetReceiving, "SetReceiving"}, {0x00080040, &CAM_C::IsFinishedReceiving, "IsFinishedReceiving"}, {0x00090100, &CAM_C::SetTransferLines, "SetTransferLines"}, {0x000A0080, &CAM_C::GetMaxLines, "GetMaxLines"}, {0x000B0100, &CAM_C::SetTransferBytes, "SetTransferBytes"}, {0x000C0040, &CAM_C::GetTransferBytes, "GetTransferBytes"}, {0x000D0080, &CAM_C::GetMaxBytes, "GetMaxBytes"}, {0x000E0080, &CAM_C::SetTrimming, "SetTrimming"}, {0x000F0040, &CAM_C::IsTrimming, "IsTrimming"}, {0x00100140, &CAM_C::SetTrimmingParams, "SetTrimmingParams"}, {0x00110040, &CAM_C::GetTrimmingParams, "GetTrimmingParams"}, {0x00120140, &CAM_C::SetTrimmingParamsCenter, "SetTrimmingParamsCenter"}, {0x00130040, &CAM_C::Activate, "Activate"}, {0x00140080, &CAM_C::SwitchContext, "SwitchContext"}, {0x00150080, nullptr, "SetExposure"}, {0x00160080, nullptr, "SetWhiteBalance"}, {0x00170080, nullptr, "SetWhiteBalanceWithoutBaseUp"}, {0x00180080, nullptr, "SetSharpness"}, {0x00190080, nullptr, "SetAutoExposure"}, {0x001A0040, nullptr, "IsAutoExposure"}, {0x001B0080, nullptr, "SetAutoWhiteBalance"}, {0x001C0040, nullptr, "IsAutoWhiteBalance"}, {0x001D00C0, &CAM_C::FlipImage, "FlipImage"}, {0x001E0200, &CAM_C::SetDetailSize, "SetDetailSize"}, {0x001F00C0, &CAM_C::SetSize, "SetSize"}, {0x00200080, &CAM_C::SetFrameRate, "SetFrameRate"}, {0x00210080, nullptr, "SetPhotoMode"}, {0x002200C0, &CAM_C::SetEffect, "SetEffect"}, {0x00230080, nullptr, "SetContrast"}, {0x00240080, nullptr, "SetLensCorrection"}, {0x002500C0, &CAM_C::SetOutputFormat, "SetOutputFormat"}, {0x00260140, nullptr, "SetAutoExposureWindow"}, {0x00270140, nullptr, "SetAutoWhiteBalanceWindow"}, {0x00280080, nullptr, "SetNoiseFilter"}, {0x00290080, &CAM_C::SynchronizeVsyncTiming, "SynchronizeVsyncTiming"}, {0x002A0080, nullptr, "GetLatestVsyncTiming"}, {0x002B0000, &CAM_C::GetStereoCameraCalibrationData, "GetStereoCameraCalibrationData"}, {0x002C0400, nullptr, "SetStereoCameraCalibrationData"}, {0x002D00C0, nullptr, "WriteRegisterI2c"}, {0x002E00C0, nullptr, "WriteMcuVariableI2c"}, {0x002F0080, nullptr, "ReadRegisterI2cExclusive"}, {0x00300080, nullptr, "ReadMcuVariableI2cExclusive"}, {0x00310180, nullptr, "SetImageQualityCalibrationData"}, {0x00320000, nullptr, "GetImageQualityCalibrationData"}, {0x003302C0, &CAM_C::SetPackageParameterWithoutContext, "SetPackageParameterWithoutContext"}, {0x00340140, &CAM_C::SetPackageParameterWithContext, "SetPackageParameterWithContext"}, {0x003501C0, &CAM_C::SetPackageParameterWithContextDetail, "SetPackageParameterWithContextDetail"}, {0x00360000, &CAM_C::GetSuitableY2rStandardCoefficient, "GetSuitableY2rStandardCoefficient"}, {0x00370202, nullptr, "PlayShutterSoundWithWave"}, {0x00380040, &CAM_C::PlayShutterSound, "PlayShutterSound"}, {0x00390000, &CAM_C::DriverInitialize, "DriverInitialize"}, {0x003A0000, &CAM_C::DriverFinalize, "DriverFinalize"}, {0x003B0000, nullptr, "GetActivatedCamera"}, {0x003C0000, nullptr, "GetSleepCamera"}, {0x003D0040, nullptr, "SetSleepCamera"}, {0x003E0040, nullptr, "SetBrightnessSynchronization"}, }; RegisterHandlers(functions); }
BOSS_U::BOSS_U(std::shared_ptr<Module> boss) : Module::Interface(std::move(boss), "boss:U", DefaultMaxSessions) { static const FunctionInfo functions[] = { // clang-format off {0x00010082, &BOSS_U::InitializeSession, "InitializeSession"}, {0x00020100, &BOSS_U::SetStorageInfo, "SetStorageInfo"}, {0x00030000, &BOSS_U::UnregisterStorage, "UnregisterStorage"}, {0x00040000, &BOSS_U::GetStorageInfo, "GetStorageInfo"}, {0x00050042, &BOSS_U::RegisterPrivateRootCa, "RegisterPrivateRootCa"}, {0x00060084, &BOSS_U::RegisterPrivateClientCert, "RegisterPrivateClientCert"}, {0x00070000, &BOSS_U::GetNewArrivalFlag, "GetNewArrivalFlag"}, {0x00080002, &BOSS_U::RegisterNewArrivalEvent, "RegisterNewArrivalEvent"}, {0x00090040, &BOSS_U::SetOptoutFlag, "SetOptoutFlag"}, {0x000A0000, &BOSS_U::GetOptoutFlag, "GetOptoutFlag"}, {0x000B00C2, &BOSS_U::RegisterTask, "RegisterTask"}, {0x000C0082, &BOSS_U::UnregisterTask, "UnregisterTask"}, {0x000D0082, &BOSS_U::ReconfigureTask, "ReconfigureTask"}, {0x000E0000, &BOSS_U::GetTaskIdList, "GetTaskIdList"}, {0x000F0042, &BOSS_U::GetStepIdList, "GetStepIdList"}, {0x00100102, &BOSS_U::GetNsDataIdList, "GetNsDataIdList"}, {0x00110102, &BOSS_U::GetNsDataIdList1, "GetNsDataIdList1"}, {0x00120102, &BOSS_U::GetNsDataIdList2, "GetNsDataIdList2"}, {0x00130102, &BOSS_U::GetNsDataIdList3, "GetNsDataIdList3"}, {0x00140082, &BOSS_U::SendProperty, "SendProperty"}, {0x00150042, &BOSS_U::SendPropertyHandle, "SendPropertyHandle"}, {0x00160082, &BOSS_U::ReceiveProperty, "ReceiveProperty"}, {0x00170082, &BOSS_U::UpdateTaskInterval, "UpdateTaskInterval"}, {0x00180082, &BOSS_U::UpdateTaskCount, "UpdateTaskCount"}, {0x00190042, &BOSS_U::GetTaskInterval, "GetTaskInterval"}, {0x001A0042, &BOSS_U::GetTaskCount, "GetTaskCount"}, {0x001B0042, &BOSS_U::GetTaskServiceStatus, "GetTaskServiceStatus"}, {0x001C0042, &BOSS_U::StartTask, "StartTask"}, {0x001D0042, &BOSS_U::StartTaskImmediate, "StartTaskImmediate"}, {0x001E0042, &BOSS_U::CancelTask, "CancelTask"}, {0x001F0000, &BOSS_U::GetTaskFinishHandle, "GetTaskFinishHandle"}, {0x00200082, &BOSS_U::GetTaskState, "GetTaskState"}, {0x00210042, &BOSS_U::GetTaskResult, "GetTaskResult"}, {0x00220042, &BOSS_U::GetTaskCommErrorCode, "GetTaskCommErrorCode"}, {0x002300C2, &BOSS_U::GetTaskStatus, "GetTaskStatus"}, {0x00240082, &BOSS_U::GetTaskError, "GetTaskError"}, {0x00250082, &BOSS_U::GetTaskInfo, "GetTaskInfo"}, {0x00260040, &BOSS_U::DeleteNsData, "DeleteNsData"}, {0x002700C2, &BOSS_U::GetNsDataHeaderInfo, "GetNsDataHeaderInfo"}, {0x00280102, &BOSS_U::ReadNsData, "ReadNsData"}, {0x00290080, &BOSS_U::SetNsDataAdditionalInfo, "SetNsDataAdditionalInfo"}, {0x002A0040, &BOSS_U::GetNsDataAdditionalInfo, "GetNsDataAdditionalInfo"}, {0x002B0080, &BOSS_U::SetNsDataNewFlag, "SetNsDataNewFlag"}, {0x002C0040, &BOSS_U::GetNsDataNewFlag, "GetNsDataNewFlag"}, {0x002D0040, &BOSS_U::GetNsDataLastUpdate, "GetNsDataLastUpdate"}, {0x002E0040, &BOSS_U::GetErrorCode, "GetErrorCode"}, {0x002F0140, &BOSS_U::RegisterStorageEntry, "RegisterStorageEntry"}, {0x00300000, &BOSS_U::GetStorageEntryInfo, "GetStorageEntryInfo"}, {0x00310100, &BOSS_U::SetStorageOption, "SetStorageOption"}, {0x00320000, &BOSS_U::GetStorageOption, "GetStorageOption"}, {0x00330042, &BOSS_U::StartBgImmediate, "StartBgImmediate"}, {0x00340042, &BOSS_U::GetTaskProperty0, "GetTaskProperty0"}, {0x003500C2, &BOSS_U::RegisterImmediateTask, "RegisterImmediateTask"}, {0x00360084, &BOSS_U::SetTaskQuery, "SetTaskQuery"}, {0x00370084, &BOSS_U::GetTaskQuery, "GetTaskQuery"}, // clang-format on }; RegisterHandlers(functions); }
NWM_CEC::NWM_CEC() : ServiceFramework("nwm::CEC") { static const FunctionInfo functions[] = { {0x000D0082, nullptr, "SendProbeRequest"}, }; RegisterHandlers(functions); }
AM_NET::AM_NET(std::shared_ptr<Module> am) : Module::Interface(std::move(am), "am:net", 5) { static const FunctionInfo functions[] = { {0x00010040, &AM_NET::GetNumPrograms, "GetNumPrograms"}, {0x00020082, &AM_NET::GetProgramList, "GetProgramList"}, {0x00030084, &AM_NET::GetProgramInfos, "GetProgramInfos"}, {0x000400C0, &AM_NET::DeleteUserProgram, "DeleteUserProgram"}, {0x000500C0, nullptr, "GetProductCode"}, {0x000600C0, nullptr, "GetStorageId"}, {0x00070080, &AM_NET::DeleteTicket, "DeleteTicket"}, {0x00080000, &AM_NET::GetNumTickets, "GetNumTickets"}, {0x00090082, &AM_NET::GetTicketList, "GetTicketList"}, {0x000A0000, nullptr, "GetDeviceID"}, {0x000B0040, nullptr, "GetNumImportTitleContexts"}, {0x000C0082, nullptr, "GetImportTitleContextList"}, {0x000D0084, nullptr, "GetImportTitleContexts"}, {0x000E00C0, nullptr, "DeleteImportTitleContext"}, {0x000F00C0, nullptr, "GetNumImportContentContexts"}, {0x00100102, nullptr, "GetImportContentContextList"}, {0x00110104, nullptr, "GetImportContentContexts"}, {0x00120102, nullptr, "DeleteImportContentContexts"}, {0x00130040, nullptr, "NeedsCleanup"}, {0x00140040, nullptr, "DoCleanup"}, {0x00150040, nullptr, "DeleteAllImportContexts"}, {0x00160000, nullptr, "DeleteAllTemporaryPrograms"}, {0x00170044, nullptr, "ImportTwlBackupLegacy"}, {0x00180080, nullptr, "InitializeTitleDatabase"}, {0x00190040, nullptr, "QueryAvailableTitleDatabase"}, {0x001A00C0, nullptr, "CalcTwlBackupSize"}, {0x001B0144, nullptr, "ExportTwlBackup"}, {0x001C0084, nullptr, "ImportTwlBackup"}, {0x001D0000, nullptr, "DeleteAllTwlUserPrograms"}, {0x001E00C8, nullptr, "ReadTwlBackupInfo"}, {0x001F0040, nullptr, "DeleteAllExpiredUserPrograms"}, {0x00200000, nullptr, "GetTwlArchiveResourceInfo"}, {0x00210042, nullptr, "GetPersonalizedTicketInfoList"}, {0x00220080, nullptr, "DeleteAllImportContextsFiltered"}, {0x00230080, nullptr, "GetNumImportTitleContextsFiltered"}, {0x002400C2, nullptr, "GetImportTitleContextListFiltered"}, {0x002500C0, nullptr, "CheckContentRights"}, {0x00260044, nullptr, "GetTicketLimitInfos"}, {0x00270044, nullptr, "GetDemoLaunchInfos"}, {0x00280108, nullptr, "ReadTwlBackupInfoEx"}, {0x00290082, nullptr, "DeleteUserProgramsAtomically"}, {0x002A00C0, nullptr, "GetNumExistingContentInfosSystem"}, {0x002B0142, nullptr, "ListExistingContentInfosSystem"}, {0x002C0084, nullptr, "GetProgramInfosIgnorePlatform"}, {0x002D00C0, nullptr, "CheckContentRightsIgnorePlatform"}, {0x04010080, nullptr, "UpdateFirmwareTo"}, {0x04020040, &AM_NET::BeginImportProgram, "BeginImportProgram"}, {0x04030000, nullptr, "BeginImportProgramTemporarily"}, {0x04040002, nullptr, "CancelImportProgram"}, {0x04050002, &AM_NET::EndImportProgram, "EndImportProgram"}, {0x04060002, nullptr, "EndImportProgramWithoutCommit"}, {0x040700C2, nullptr, "CommitImportPrograms"}, {0x04080042, &AM_NET::GetProgramInfoFromCia, "GetProgramInfoFromCia"}, {0x04090004, &AM_NET::GetSystemMenuDataFromCia, "GetSystemMenuDataFromCia"}, {0x040A0002, &AM_NET::GetDependencyListFromCia, "GetDependencyListFromCia"}, {0x040B0002, &AM_NET::GetTransferSizeFromCia, "GetTransferSizeFromCia"}, {0x040C0002, &AM_NET::GetCoreVersionFromCia, "GetCoreVersionFromCia"}, {0x040D0042, &AM_NET::GetRequiredSizeFromCia, "GetRequiredSizeFromCia"}, {0x040E00C2, nullptr, "CommitImportProgramsAndUpdateFirmwareAuto"}, {0x040F0000, nullptr, "UpdateFirmwareAuto"}, {0x041000C0, &AM_NET::DeleteProgram, "DeleteProgram"}, {0x04110044, nullptr, "GetTwlProgramListForReboot"}, {0x04120000, nullptr, "GetSystemUpdaterMutex"}, {0x04130002, &AM_NET::GetMetaSizeFromCia, "GetMetaSizeFromCia"}, {0x04140044, &AM_NET::GetMetaDataFromCia, "GetMetaDataFromCia"}, {0x04150080, nullptr, "CheckDemoLaunchRights"}, {0x041600C0, nullptr, "GetInternalTitleLocationInfo"}, {0x041700C0, nullptr, "PerpetuateAgbSaveData"}, {0x04180040, nullptr, "BeginImportProgramForOverWrite"}, {0x04190000, nullptr, "BeginImportSystemProgram"}, {0x08010000, nullptr, "BeginImportTicket"}, {0x08020002, nullptr, "CancelImportTicket"}, {0x08030002, nullptr, "EndImportTicket"}, {0x08040100, nullptr, "BeginImportTitle"}, {0x08050000, nullptr, "StopImportTitle"}, {0x080600C0, nullptr, "ResumeImportTitle"}, {0x08070000, nullptr, "CancelImportTitle"}, {0x08080000, nullptr, "EndImportTitle"}, {0x080900C2, nullptr, "CommitImportTitles"}, {0x080A0000, nullptr, "BeginImportTmd"}, {0x080B0002, nullptr, "CancelImportTmd"}, {0x080C0042, nullptr, "EndImportTmd"}, {0x080D0042, nullptr, "CreateImportContentContexts"}, {0x080E0040, nullptr, "BeginImportContent"}, {0x080F0002, nullptr, "StopImportContent"}, {0x08100040, nullptr, "ResumeImportContent"}, {0x08110002, nullptr, "CancelImportContent"}, {0x08120002, nullptr, "EndImportContent"}, {0x08130000, nullptr, "GetNumCurrentImportContentContexts"}, {0x08140042, nullptr, "GetCurrentImportContentContextList"}, {0x08150044, nullptr, "GetCurrentImportContentContexts"}, {0x08160146, nullptr, "Sign"}, {0x08170146, nullptr, "Verify"}, {0x08180042, nullptr, "GetDeviceCert"}, {0x08190108, nullptr, "ImportCertificates"}, {0x081A0042, nullptr, "ImportCertificate"}, {0x081B00C2, nullptr, "CommitImportTitlesAndUpdateFirmwareAuto"}, {0x081C0100, nullptr, "DeleteTicketId"}, {0x081D0080, nullptr, "GetNumTicketIds"}, {0x081E0102, nullptr, "GetTicketIdList"}, {0x081F0080, nullptr, "GetNumTicketsOfProgram"}, {0x08200102, nullptr, "ListTicketInfos"}, {0x08210142, nullptr, "GetRightsOnlyTicketData"}, {0x08220000, nullptr, "GetNumCurrentContentInfos"}, {0x08230044, nullptr, "FindCurrentContentInfos"}, {0x08240082, nullptr, "ListCurrentContentInfos"}, {0x08250102, nullptr, "CalculateContextRequiredSize"}, {0x08260042, nullptr, "UpdateImportContentContexts"}, {0x08270000, nullptr, "DeleteAllDemoLaunchInfos"}, {0x082800C0, nullptr, "BeginImportTitleForOverWrite"}, }; RegisterHandlers(functions); }
void CCBServer::InitAndReconfig() { // construct the CCB address to be advertised by CCB listeners Sinful sinful(daemonCore->publicNetworkIpAddr()); // strip out <>'s, private address, and CCB listener info sinful.setPrivateAddr(NULL); sinful.setCCBContact(NULL); ASSERT( sinful.getSinful() && sinful.getSinful()[0] == '<' ); m_address.formatstr("%s",sinful.getSinful()+1); if( m_address[m_address.Length()-1] == '>' ) { m_address.setChar(m_address.Length()-1,'\0'); } m_read_buffer_size = param_integer("CCB_SERVER_READ_BUFFER",2*1024); m_write_buffer_size = param_integer("CCB_SERVER_WRITE_BUFFER",2*1024); m_last_reconnect_info_sweep = time(NULL); m_reconnect_info_sweep_interval = param_integer("CCB_SWEEP_INTERVAL",1200); CloseReconnectFile(); MyString old_reconnect_fname = m_reconnect_fname; char *fname = param("CCB_RECONNECT_FILE"); if( fname ) { m_reconnect_fname = fname; if( m_reconnect_fname.find(".ccb_reconnect") == -1 ) { // required for preen to ignore this file m_reconnect_fname += ".ccb_reconnect"; } free( fname ); } else { char *spool = param("SPOOL"); ASSERT( spool ); Sinful my_addr( daemonCore->publicNetworkIpAddr() ); m_reconnect_fname.formatstr("%s%c%s-%s.ccb_reconnect", spool, DIR_DELIM_CHAR, my_addr.getHost() ? my_addr.getHost() : "localhost", my_addr.getPort() ? my_addr.getPort() : "0"); free( spool ); } if( old_reconnect_fname != m_reconnect_fname && !old_reconnect_fname.IsEmpty() && !m_reconnect_fname.IsEmpty() ) { // reconnect filename changed // not worth freaking out on error here remove( m_reconnect_fname.Value() ); rename( old_reconnect_fname.Value(), m_reconnect_fname.Value() ); } if( old_reconnect_fname.IsEmpty() && !m_reconnect_fname.IsEmpty() && m_reconnect_info.getNumElements() == 0 ) { // we are starting up from scratch, so load saved info LoadReconnectInfo(); } Timeslice poll_slice; poll_slice.setTimeslice( // do not run more than this fraction of the time param_double("CCB_POLLING_TIMESLICE",0.05) ); poll_slice.setDefaultInterval( // try to run this often param_integer("CCB_POLLING_INTERVAL",20,0) ); poll_slice.setMaxInterval( // run at least this often param_integer("CCB_POLLING_MAX_INTERVAL",600) ); if( m_polling_timer != -1 ) { daemonCore->Cancel_Timer(m_polling_timer); } m_polling_timer = daemonCore->Register_Timer( poll_slice, (TimerHandlercpp)&CCBServer::PollSockets, "CCBServer::PollSockets", this); RegisterHandlers(); }
IManagerForApplication() : ServiceFramework("IProfile") { static const FunctionInfo functions[] = { {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, }; RegisterHandlers(functions); }
IProfile() : ServiceFramework("IProfile") { static const FunctionInfo functions[] = { {1, &IProfile::GetBase, "GetBase"}, }; RegisterHandlers(functions); }
int main(int argc, char **argv, char **envp) { struct Session session; time_t t1, t2; int tmp = 0; if(RegisterHandlers() == -1) { fprintf(stderr, "[!] Cannot register signal handlers, aborting\n"); goto cleanup; } InitSession(&session, envp, argv); if(ParseArguments(argc, argv, &session) == -1) { PrintHelp(argv[0]); goto cleanup; } if(OpenLogFile(&session) == -1) { fprintf(stderr, "[!] Cannot open %s for logging, aborting\n", session.logfilename); goto cleanup; } if(PrepareArgv(&session) == -1) { fprintf(stderr, "[!] Cannot parse arguments\n"); goto cleanup; } if(InitFuzzingStrings(&session) == -1) { fprintf(stderr, "[!] Error initializing fuzzing variables\n"); goto cleanup; } switch(session.mode) { /* Smart mode read the file structure from a file */ case MODE_SMART: { fprintf(stdout, "[%%] Reading headers structure from %s\n", session.headers); session.headercount = Extract_DataFields(&session); break; } /* ASCII mode read a file and tries to get the right file structure =) */ case MODE_ASCII: { fprintf(stdout, "[%%] Reading ASCII structure from %s\n", session.input); session.headercount = Extract_ASCII_Structure(&session); break; } } if((session.mode == MODE_ASCII) || (session.mode == MODE_SMART)) { if(!session.headercount) { fprintf(stderr, "[!] Error loading Offsets from input file\n"); goto cleanup; } session.range.low = 0; session.range.high = session.headercount; fprintf(stdout, "[%%] Loaded %d fields in headers\n", session.headercount); } tmp = CountFuzzingStrings(&session); fprintf(stdout, "[%%] Loaded %d fuzzing variables\n", tmp); fprintf(stdout, "[%%] Fuzzing from %d to %d\n", session.range.low, session.range.high); if(session.mode == MODE_BRUTE) { session.byte = session.range.low; tmp *= session.range.high - session.range.low + 1; } else { session.curfield = session.d; session.byte = session.curfield->offset; tmp *= session.headercount; } PrintLogHeader(&session); fprintf(stdout, "[%%] Number of files to be generated %d\n", tmp); fprintf(stdout, "[%%] Proceding with fuzzing\n"); time(&t1); StartSession(&session); time(&t2); fprintf(stdout, "[%%] Time elapsed %f\n", difftime(t2, t1)); fprintf(stdout, "[%%] Number of succesful executions %d\n", session.exec); fprintf(stdout, "[%%] Skipped executions due to fuzzing string size %d\n", session.skipped); fprintf(stdout, "[%%] Number of \"bugs\" found: %d\n", session.bugs); /* Cleanup Resources */ cleanup: { FreeFuzzingList(session.f); FreeMaps(session.maps); CloseLogFile(&session); } return 0; }
MainMenu::MainMenu() : GameMenu( "MainMenu.layout", "MainMenu" ) { RegisterHandlers(); }