Skip to content
This repository was archived by the owner on Mar 2, 2022. It is now read-only.

Beta 0.6 #14

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3ea4790
Implemented first part of the patchlayout(still work in progress)
Hartie95 Jul 31, 2015
02956aa
rewrite part 1(use more classes, Menu not finished, no patch selection
Hartie95 Aug 4, 2015
34dca23
Rewrite part2(basic menu navigation and entrytypes)
Hartie95 Aug 20, 2015
5367c25
Updated Menu Patch to work with more firmware version wenn used from …
Hartie95 Aug 24, 2015
b5032fc
added the ability to list the loaded patches, and to enable/disable them
Hartie95 Aug 25, 2015
5384042
added the ability to notify the user about updates(notifikation area …
Hartie95 Aug 26, 2015
546fb3a
some minor changes like adding some files to the gitignore and fixing…
Hartie95 Aug 27, 2015
8b6638f
added the ability to check the kernel version, changed the name length
Hartie95 Aug 30, 2015
e6838be
added firmware version field for patches(not checked at the moment)
Hartie95 Sep 2, 2015
e27d8c9
added patch collection(will be loaded and applied, but they wont show up
Hartie95 Sep 3, 2015
fec5cd2
Fixed a bug in the kernel version detection
Hartie95 Sep 3, 2015
3e0b176
removed some unused functions and variables, some code formating chan…
Hartie95 Sep 4, 2015
a896b24
added collectionsEntrys to the menu
Hartie95 Sep 7, 2015
de85bcb
some code cleaning, moved patchManager into a class, added 2 patchtype
Hartie95 Sep 7, 2015
92ffdad
added offset field to the patch layout, added some comments
Hartie95 Sep 8, 2015
a0a0bf6
moved binarylayouts to its own header, removed debug menus from main …
Hartie95 Sep 9, 2015
a3b5b35
added device check to patches, added some additional checks(NS Patchi…
Hartie95 Sep 18, 2015
b76abe9
cleanup functuin will now be used at closing, some minor changes(NS
Hartie95 Sep 21, 2015
f72350e
patch offset will now no longer have a random value from memory, instead
Hartie95 Sep 21, 2015
5087a5f
fixed a spelling mistake
Hartie95 Sep 21, 2015
2f5fac3
added firmware version and region checks, added functions and variabl…
Hartie95 Oct 1, 2015
b6fa185
added settings(hacky, old settings need to be removed)
Hartie95 Oct 8, 2015
436668c
updated patch dependencies to FW 10.1, ns patch no longer depends on …
Hartie95 Oct 8, 2015
49bd017
the settings now are a bit less hacky and dont have a fixed size ánym…
Hartie95 Oct 9, 2015
0191275
application fodler will now be created at first start
Hartie95 Oct 12, 2015
608707f
added version string
Hartie95 Oct 12, 2015
aba059c
Added type char to the menu elements
Hartie95 Nov 26, 2015
7764572
set the defauld patches maxFirmware fields to 0xff
Hartie95 Nov 26, 2015
28415c0
fixed building with the ctrulib refactor branche
Hartie95 Nov 26, 2015
4593092
change the layout on the topscreen
Hartie95 Nov 26, 2015
8fd45c5
added an auto updater which installes the newest version, the version
Hartie95 Nov 28, 2015
6193139
added Beta build to the release folder
Hartie95 Nov 28, 2015
4bfbbe6
get cver and nver using osGetSystemVersion
Hartie95 Jan 19, 2016
adcb749
added development build support(builds could be broken)
Hartie95 Jan 20, 2016
39f1aa2
notifikation messages will now include a changelog(if available)
Hartie95 Jan 20, 2016
b5460f5
incremented beta-version number
Hartie95 Jan 20, 2016
ab8b483
migrated to citrus, fixed a spelling mistake in a function name
Hartie95 Jan 20, 2016
141081c
remove last ctrcommon include
Hartie95 Jan 22, 2016
b035a46
added autopatch support(hold L to ignore autopatch)
Hartie95 Jan 22, 2016
effd7f7
fixed versioncheck inside of the updater
Hartie95 Jan 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
output
build
*.cia
# ignore visual studio project files
*.opensdf
*.sdf
*.sln
*.suo
*.vcxproj
*.vcxproj.filters
*.vcxproj.user

*.log
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ endif
# ENABLE_EXCEPTIONS: Enable C++ exceptions.
#---------------------------------------------------------------------------------

include $(DEVKITPRO)/ctrcommon/tools/make_base
include $(DEVKITPRO)/citrus/tools/make_base
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Free multi Patcher
==================================

This application for the 3DS allows to patch systemmodules while using system or emunand,and with and without using firmlaunch. Because of this it allows E-Shop access on all 9.x firmware verions and regionfree cias in Pasta and other CFWs
This application for the 3DS allows to patch systemmodules while using system or emunand and with and without using firmlaunch. Because of this it allows E-Shop access on all 9.x firmware verions and regionfree in Pasta and other CFWs.
It also allows other peoples to create, add and share own patches using the patchlayout defined by this [wiki page](https://github.com/hartmannaf/Free-multi-Patcher/wiki/patchlayout)

### Dependencies

Expand All @@ -11,4 +12,5 @@ This application for the 3DS allows to patch systemmodules while using system or

### Credits
* base application: [YGW Eshop Spoofer (Y a Gateway!?)](https://github.com/felipejfc/ygw-eshop-spoofer) by [felipejfc](https://github.com/felipejfc)
* region free: [rxtools](https://github.com/roxas75/rxTools) by [roxas](https://github.com/roxas75/rxTools)
* region free: [rxtools](https://github.com/roxas75/rxTools) by [roxas](https://github.com/roxas75)
* CVer and NVER reading [3ds_homemenuhax](https://github.com/yellows8/3ds_homemenuhax) by [yellows8](https://github.com/yellows8)
61 changes: 61 additions & 0 deletions include/binaryLayouts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#pragma once

#include <3ds.h>
#include "constants.h"
#include "device.h"

/*Patchlayout defined by https://github.com/hartmannaf/Free-multi-Patcher/wiki/patchlayout */

//placeholder for possible later types of emunand
typedef struct nandTypesStruct
{
u32 System : 1;
u32 Emu : 1;
u32 placeholder : 6;
} nands;

typedef struct patchStruct
{
u32 version; //0 for development, 1 after first release
u32 patchSize;
u32 patchNameSize;
u32 descriptionSize;
u32 processNameSize;
u32 originalcodeSize;
u32 patchcodeSize;
u32 processType; //ARM9 = 0, ARM11 = 1
kernelVersion minKernelVersion;
kernelVersion maxKernelVersion;
firmwareVersion minFirmwareVersion;
firmwareVersion maxFirmwareVersion;
devices devicesSupported;
regions regionsSupported;
nands nandCompability;
u32 patchType; //0->search code, 1->overwrite code, 2->search String, 3->overwrite string
u32 startAddressProcess;
u32 startAddressGlobal;
u32 searchAreaSize; //0 overwrite all apearences
u32 patchOffset; //strings offset between each character, code offset where to patch based on originalcode
u32 numberOfReplacements;
char binaryData[];
} binPatch;


/*PatchCollectionlayout defined by https://github.com/hartmannaf/Free-multi-Patcher/wiki/patchCollectionlayout */

typedef struct patchCollectionStruct
{
u32 version;
u32 collectionNameSize;
u32 descriptionSize;
u32 numberOfPatches;
u32 processType;
kernelVersion minKernelVersion;
kernelVersion maxKernelVersion;
firmwareVersion minFirmwareVersion;
firmwareVersion maxFirmwareVersion;
devices devicesSupported;
regions regionsSupported;
nands nandCompability;
char binaryData[];
} binPatchCollection;
15 changes: 15 additions & 0 deletions include/collectionEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once

#include "patchCollections.h"
#include "defaultMenuEntrys.h"


class CollectionEntry : protected YesNoMenuEntry, protected NavigationMenuEntry
{
protected:
PatchCollection* collection;
public:
CollectionEntry(PatchCollection* collection, MenuManagerM* manager,MenuM* parentMenu);
int sideAction();
virtual std::string getRow();
};
28 changes: 27 additions & 1 deletion include/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,37 @@

#include <3ds.h>

#include <string>
#include <stdio.h>
#include <string.h>

extern u32 curr_kproc_addr;
extern u32 kproc_start;
extern u32 kproc_size;
extern u32 kproc_num;
extern u32 kproc_codeset_offset;
extern u32 kproc_pid_offset;

void SaveVersionConstants();
void SaveVersionConstants();

//Application Constands
static const std::string applicationFolder = "sdmc:/fmp/";

static const std::string patchesFolder = applicationFolder+"patches/";
static const std::string patchExtension = ".patch";
static const std::string patchCollectionExtension = ".collection";

static const std::string settingsFolder=applicationFolder+"settings/";
static const std::string settingsExtension =".cfg";
static const std::string globalSettingsFileName = "settings";

static const std::string mainUrl = "http://fmp.hartie95.de/";
static const std::string mainDownloadUrl = mainUrl + "updates/";
static const std::string versionCheckUrl = mainUrl + "version.txt";

static const std::string mainDownloadUrlDev = mainUrl + "devUpdates/";
static const std::string VersionCheckUrlDev = mainUrl + "devVersion.txt";

static const u32 version=0x00060471;

std::string generateVersionString(u32 version);
69 changes: 69 additions & 0 deletions include/defaultMenuEntrys.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#pragma once

#include <3ds.h>
#include <stdio.h>

#include <string>
#include "workaround.h"

#define MAXNAMELENGTH 29

class MenuEntry
{
private:
protected:
std::string name;
char type;
std::string description;
u32 maxNameLength = MAXNAMELENGTH;
u32 maxDescriptionLength = 40;
MenuEntry(){

}
public:
MenuEntry(std::string name, std::string description);
virtual int sideAction();
virtual int aAction();
virtual std::string getRow();
void setName(std::string name);
void setDescription(std::string description);
std::string getName();
std::string getDescription();
};

class BackMenuEntry : protected MenuEntry
{
private:
MenuManagerM* manager;
public:
BackMenuEntry(MenuManagerM* manager,std::string name, std::string description);
int aAction();
void back();
};

class NavigationMenuEntry : virtual protected MenuEntry
{
protected:
MenuM* menu;
MenuManagerM* manager;
NavigationMenuEntry(){};
public:
NavigationMenuEntry(MenuManagerM* manager,MenuM* menu,std::string name, std::string description);
int aAction();
void navigate();
};

class YesNoMenuEntry : virtual protected MenuEntry
{
private:
protected:
bool* value;
std::string getValueString(bool value);
YesNoMenuEntry(){

}
public:
YesNoMenuEntry(bool* value,std::string name, std::string description);
virtual int sideAction();
virtual std::string getRow();
};
60 changes: 60 additions & 0 deletions include/device.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#pragma once

#include <3ds.h>

typedef struct kernelVersionStruct
{
u8 unknown;
u8 revision;
u8 minor;
u8 major;
}kernelVersion;

typedef struct firmwareVersionStruct
{
u8 major;
u8 minor;
u8 revision;
u8 nver;
}firmwareVersion;

typedef struct devicesStruct
{
u32 old3DS : 1;
u32 old3DSXL : 1;
u32 old2DS : 1;
u32 new3DS : 1;
u32 new3DSXL : 1;
u32 placeholder : 3;
} devices;

//Australia is not used, instead it uses European region
typedef struct regionsStruct
{
u32 japan : 1;
u32 northAmerica : 1;
u32 europe : 1;
u32 australia : 1;
u32 china : 1;
u32 korea : 1;
u32 taiwan : 1;
u32 placeholder : 1;
} regions;

typedef struct deviceInformationsStruct
{
u8 modelID;
u8 region;
kernelVersion kernelversion;
firmwareVersion firmwareversion;
} deviceInformations;


extern deviceInformations device;

int initDeviceInformations();

int setModelID();
int setDeviceRegion();
int setFirmwareVersion();
int setKernelVersion();
9 changes: 9 additions & 0 deletions include/helpers.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#include <3ds.h>
#include <stdio.h>
#include <sstream>

void* loadFile(FILE* file, size_t minSize, size_t* fileSize);
bool checkFolder(std::string name);
std::string getStringFromDownload(size_t downloadSize, u8* downloadResult);
61 changes: 31 additions & 30 deletions include/menu.h
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
#pragma once

#ifndef MENU_H
#define MENU_H

#include <3ds.h>

#include <ctrcommon/input.hpp>
#include <ctrcommon/service.hpp>
#include <string>
#include "constants.h"
#include <stdio.h>
#include <vector>
#include <memory>

#include "defaultMenuEntrys.h"

class MenuManager;

#define SETTING 0
#define SAVE 1
#define PLACEHOLDER 254
#define EXIT 255
class Menu : MenuM
{
private:
Menu* parentMenu;
MenuManager* parentManager;
unsigned int currentSelection;
std::vector<MenuEntry*> menuEntrys;
public:
Menu(MenuManager* parentManager,Menu* parentMenu);
MenuManager* getParentManager();
Menu* getParentMenu();
void addEntry(MenuEntry* entry);

#define ESHOPSPOOF 0
#define REGIONFREE 1
#define NOAUTODL 2
#define SERIALCHANGE 3
void menuChangeSelection(std::string direction);
short getNumberOfEntrys();
void selectionDoSiteAction();
void selectionDoAAction();
Menu* back();

struct menuEntry{
std::string name;
std::string description;
short type;
void drawMenu();
};

static const menuEntry menu[]={ {"e-shop spoof ", "Patches nim for E-Shop access ", SETTING},
{"region patch ", "Patches the home menu to show out of\nregion games and nim to ignore out of\nregion Updates", SETTING},
{"no auto download ", "Patches nim to stop automatic update\ndownload\n(Might be unstable)", SETTING},
{"serial patch ", "Patches the serial to allow E-Shop \nacces after region change\n(not implemented)", PLACEHOLDER},
{"save", "Save current selection for later use", SAVE},
{"exit", "Exit without applying patches ", EXIT}
};

static const short numberOfEntries = sizeof(menu)/sizeof(menuEntry);

void menuChageSelection(std::string direction);
void menuChangeStatusOfSelection(bool patchlist[]);
short getSelectionType();
short getNumberOfPatches();
void drowTop();
void drawMenu(bool patchlist[]);
#endif
Loading