mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
UNIVERSAL-UPDATER IS BACK! Lmao.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
Result installCia(const char * ciaPath);
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019 VoltZ, Epicpkmn11, Flame, RocketRobz, TotallyNotGuy
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
|
||||
* * Requiring preservation of specified reasonable legal notices or
|
||||
* author attributions in that material or in the Appropriate Legal
|
||||
* Notices displayed by works containing it.
|
||||
* * Prohibiting misrepresentation of the origin of that material,
|
||||
* or requiring that modified versions of such material be marked in
|
||||
* reasonable ways as different from the original version.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <3ds.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "utils/files.h"
|
||||
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
#include "utils/json.hpp"
|
||||
#include "utils/stringutils.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <regex>
|
||||
#include <curl/curl.h>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
#endif
|
||||
|
||||
extern char * arg0;
|
||||
|
||||
#define WORKING_DIR "/3ds/"
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019 VoltZ, Epicpkmn11, Flame, RocketRobz, TotallyNotGuy
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
|
||||
* * Requiring preservation of specified reasonable legal notices or
|
||||
* author attributions in that material or in the Appropriate Legal
|
||||
* Notices displayed by works containing it.
|
||||
* * Prohibiting misrepresentation of the origin of that material,
|
||||
* or requiring that modified versions of such material be marked in
|
||||
* reasonable ways as different from the original version.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
enum ExtractError {
|
||||
EXTRACT_ERROR_NONE = 0,
|
||||
EXTRACT_ERROR_ARCHIVE,
|
||||
EXTRACT_ERROR_ALLOC,
|
||||
EXTRACT_ERROR_FIND,
|
||||
EXTRACT_ERROR_READFILE,
|
||||
EXTRACT_ERROR_OPENFILE,
|
||||
EXTRACT_ERROR_WRITEFILE,
|
||||
};
|
||||
|
||||
Result extractArchive(std::string archivePath, std::string wantedFile, std::string outputPath);
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef FILE_BROWSE_H
|
||||
#define FILE_BROWSE_H
|
||||
|
||||
#include <dirent.h>
|
||||
#include <string>
|
||||
#include <sys/stat.h>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct DirEntry {
|
||||
std::string name;
|
||||
std::string path;
|
||||
bool isDirectory;
|
||||
char tid[5];
|
||||
off_t size;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
char gameTitle[12]; //!< 12 characters for the game title.
|
||||
char gameCode[4]; //!< 4 characters for the game code.
|
||||
} sNDSHeadertitlecodeonly;
|
||||
|
||||
void findNdsFiles(vector<DirEntry>& dirContents);
|
||||
|
||||
bool nameEndsWith(const std::string& name, const std::vector<std::string> extensionList);
|
||||
void getDirectoryContents(std::vector<DirEntry>& dirContents, const std::vector<std::string> extensionList);
|
||||
void getDirectoryContents(std::vector<DirEntry>& dirContents);
|
||||
|
||||
#endif //FILE_BROWSE_H
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019 VoltZ, Epicpkmn11, Flame, RocketRobz, TotallyNotGuy
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
|
||||
* * Requiring preservation of specified reasonable legal notices or
|
||||
* author attributions in that material or in the Appropriate Legal
|
||||
* Notices displayed by works containing it.
|
||||
* * Prohibiting misrepresentation of the origin of that material,
|
||||
* or requiring that modified versions of such material be marked in
|
||||
* reasonable ways as different from the original version.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
Result openFile(Handle* fileHandle, const char * path, bool write);
|
||||
Result deleteFile(const char * path);
|
||||
@@ -0,0 +1,46 @@
|
||||
#ifndef _INIFILE_H_
|
||||
#define _INIFILE_H_
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class CIniFile
|
||||
{
|
||||
public:
|
||||
CIniFile();
|
||||
CIniFile(const std::string& filename);
|
||||
virtual ~CIniFile();
|
||||
|
||||
public:
|
||||
bool LoadIniFile(const std::string& FileName);
|
||||
bool SaveIniFile(const std::string& FileName);
|
||||
bool SaveIniFileModified(const std::string& FileName);
|
||||
|
||||
std::string GetString(const std::string& Section,const std::string& Item,const std::string& DefaultValue);
|
||||
void SetString(const std::string& Section,const std::string& Item,const std::string& Value);
|
||||
int GetInt(const std::string& Section,const std::string& Item,int DefaultValue);
|
||||
void SetInt(const std::string& Section,const std::string& Item,int Value);
|
||||
void GetStringVector(const std::string& Section,const std::string& Item,std::vector<std::string>& strings,char delimiter=',');
|
||||
void SetStringVector(const std::string& Section,const std::string& Item,std::vector<std::string>& strings,char delimiter=',');
|
||||
protected:
|
||||
std::string m_sFileName;
|
||||
typedef std::vector<std::string> cStringArray;
|
||||
cStringArray m_FileContainer;
|
||||
bool m_bLastResult;
|
||||
bool m_bModified;
|
||||
bool m_bReadOnly;
|
||||
typedef std::map<std::string,size_t> cSectionCache;
|
||||
cSectionCache m_Cache;
|
||||
|
||||
bool InsertLine(size_t line,const std::string& str);
|
||||
bool ReplaceLine(size_t line,const std::string& str);
|
||||
|
||||
void SetFileString(const std::string& Section,const std::string& Item,const std::string& Value);
|
||||
std::string GetFileString(const std::string& Section,const std::string& Item);
|
||||
|
||||
std::string GetString(const std::string& Section,const std::string& Item);
|
||||
int GetInt(const std::string& Section,const std::string& Item);
|
||||
};
|
||||
|
||||
#endif // _INIFILE_H_
|
||||
+22684
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
bool matchPattern(std::string pattern, std::string tested);
|
||||
|
||||
namespace StringUtils
|
||||
{
|
||||
std::string format(const std::string& fmt_str, ...);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef THREAD_HPP
|
||||
#define THREAD_HPP
|
||||
|
||||
#include <3ds.h>
|
||||
#include <vector>
|
||||
|
||||
namespace Threads {
|
||||
void create(ThreadFunc entrypoint);
|
||||
void destroy(void);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user