mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-04 15:48:48 +00:00 
			
		
		
		
	Implement SeedDB & Seed Crypto
This commit is contained in:
		
							parent
							
								
									fb720c00b7
								
							
						
					
					
						commit
						b067b5aa5a
					
				
					 6 changed files with 229 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -11,6 +11,7 @@
 | 
			
		|||
#include "common/string_util.h"
 | 
			
		||||
#include "core/core.h"
 | 
			
		||||
#include "core/file_sys/errors.h"
 | 
			
		||||
#include "core/file_sys/seed_db.h"
 | 
			
		||||
#include "core/hle/ipc.h"
 | 
			
		||||
#include "core/hle/ipc_helpers.h"
 | 
			
		||||
#include "core/hle/kernel/client_port.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -685,14 +686,18 @@ void FS_USER::ObsoletedDeleteExtSaveData(Kernel::HLERequestContext& ctx) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void FS_USER::GetNumSeeds(Kernel::HLERequestContext& ctx) {
 | 
			
		||||
    IPC::RequestParser rp(ctx, 0x87D, 0, 0);
 | 
			
		||||
 | 
			
		||||
    LOG_WARNING(Service_FS, "(STUBBED) called");
 | 
			
		||||
 | 
			
		||||
    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
 | 
			
		||||
 | 
			
		||||
    IPC::RequestBuilder rb{ctx, 0x87D, 2, 0};
 | 
			
		||||
    rb.Push(RESULT_SUCCESS);
 | 
			
		||||
    rb.Push<u32>(FileSys::GetSeedCount());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void FS_USER::AddSeed(Kernel::HLERequestContext& ctx) {
 | 
			
		||||
    IPC::RequestParser rp{ctx, 0x87A, 6, 0};
 | 
			
		||||
    u64 title_id{rp.Pop<u64>()};
 | 
			
		||||
    FileSys::Seed::Data seed{rp.PopRaw<FileSys::Seed::Data>()};
 | 
			
		||||
    FileSys::AddSeed({title_id, seed, {}});
 | 
			
		||||
    IPC::RequestBuilder rb{rp.MakeBuilder(1, 0)};
 | 
			
		||||
    rb.Push(RESULT_SUCCESS);
 | 
			
		||||
    rb.Push<u32>(0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void FS_USER::SetSaveDataSecureValue(Kernel::HLERequestContext& ctx) {
 | 
			
		||||
| 
						 | 
				
			
			@ -846,7 +851,7 @@ FS_USER::FS_USER() : ServiceFramework("fs:USER", 30) {
 | 
			
		|||
        {0x08680000, nullptr, "GetMediaType"},
 | 
			
		||||
        {0x08690000, nullptr, "GetNandEraseCount"},
 | 
			
		||||
        {0x086A0082, nullptr, "ReadNandReport"},
 | 
			
		||||
        {0x087A0180, nullptr, "AddSeed"},
 | 
			
		||||
        {0x087A0180, &FS_USER::AddSeed, "AddSeed"},
 | 
			
		||||
        {0x087D0000, &FS_USER::GetNumSeeds, "GetNumSeeds"},
 | 
			
		||||
        {0x088600C0, nullptr, "CheckUpdatedDat"},
 | 
			
		||||
    };
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -485,6 +485,18 @@ private:
 | 
			
		|||
     */
 | 
			
		||||
    void GetNumSeeds(Kernel::HLERequestContext& ctx);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * FS_User::AddSeed service function.
 | 
			
		||||
     *  Inputs:
 | 
			
		||||
     *      0 : 0x087A0180
 | 
			
		||||
     *    1-2 : u64, Title ID
 | 
			
		||||
     *    3-6 : Seed
 | 
			
		||||
     *  Outputs:
 | 
			
		||||
     *      0 : 0x087A0180
 | 
			
		||||
     *      1 : Result of function, 0 on success, otherwise error code
 | 
			
		||||
     */
 | 
			
		||||
    void AddSeed(Kernel::HLERequestContext& ctx);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * FS_User::SetSaveDataSecureValue service function.
 | 
			
		||||
     *  Inputs:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue