Commit Graph

356 Commits

Author SHA1 Message Date
misson20000
18f51e9b2e loader: add NpdmUtils function for invalidating the cache for a specific title 2018-10-29 07:11:16 +09:00
misson20000
376feb63bd loader: make ShouldOverrideContents take a tid argument 2018-10-29 07:11:16 +09:00
Michael Scire
c0fe4f7af7 fs.mitm: Intercept qlaunch sysver request 2018-10-24 14:16:39 -07:00
Michael Scire
e1d884960d fs.mitm: Improve configuration refresh file semantics. 2018-10-22 23:00:22 -07:00
Michael Scire
db97dd8d75 Loader: clean up orphaned function prototype 2018-10-22 22:56:26 -07:00
Michael Scire
f96e1d5074 loader/fs.mitm: Support override config changes at runtime 2018-10-22 22:53:40 -07:00
SciresM
85540d4ad2
fs.mitm: Fix correctness bug in LayeredRomfs::Read(). 2018-10-19 12:15:18 +09:00
Michael Scire
06accd00f9 pm: steal memory from 4.0.0+ ? applet : application 2018-10-17 16:28:53 -07:00
Michael Scire
5dc31f001e Stratosphere: Fix FS permissions for <4.0.0 KIPs 2018-10-17 16:26:36 -07:00
Michael Scire
781f2597e5 libstratosphere: Fix receive for multi-static IPC buffers 2018-10-17 03:49:05 -07:00
Michael Scire
4944986814 fs.mitm: Allow for disabling mitm for a title via flag. 2018-10-16 20:41:19 -07:00
Michael Scire
55ad57a02d fs.mitm: Use same override button semantics as loader. 2018-10-16 19:01:41 -07:00
Michael Scire
6711cd93a8 atmosphere: extract API version management to common folder 2018-10-16 17:54:50 -07:00
Michael Scire
f603dbfc98 fs.mitm: Add domain support (closes #202) 2018-10-16 13:33:45 -07:00
Pika
9ae62a27dd Fix ProcesState enum field names 2018-10-16 20:29:48 +09:00
Michael Scire
20faa7f00b Loader: fix automatic apptype patching. 2018-10-05 09:13:00 -07:00
misson20000
2d6aba7a70 pm: add AtmosphereGetCurrentLimitInfo command to pm:dmnt 2018-10-05 13:55:27 +09:00
roblabla
0938057d67 Use new npdm-json format 2018-09-29 02:37:25 +00:00
Michael Scire
532b4f4de2 Loader: Fix HBL pool partition ID copy 2018-09-19 16:30:11 -07:00
Michael Scire
6afbcd12d9 Loader: Button override + first-class HBL support 2018-09-19 16:21:46 -07:00
TuxSH
d8391078c8 Fix creport according to latest libnx release changes 2018-09-19 15:03:50 +02:00
Michael Scire
0cad1935dd libstratosphere: Fix condvar wrapper primitives 2018-09-09 07:04:16 -07:00
Michael Scire
488fc0f119 pm: Support for 6.0.0 2018-09-08 23:47:15 -07:00
hexkyz
28e4d4411d Add and fix copyright notices for better GPL compliance (thanks @naehrwert and @CTCaer). 2018-09-07 16:00:13 +01:00
SciresM
bb0f3ac024
loader: Add support for 6.0.0. 2018-09-06 11:57:57 +09:00
Michael Scire
de49cfefac creport: Print Break information on UserBreak 2018-08-11 19:16:29 -07:00
Michael Scire
326d58e28c creport: tabs -> spaces 2018-08-11 19:02:12 -07:00
Michael Scire
6c8a1a39e1 creport: fix various issues, improve support (closes #187)
-Fixes a NULL deref in thread info parsing
-Heuristically uses [<buildid>] instead of rodata contents if NSO has no
name segment
-Adds full thread/code region dump for all firmwares, instead of just
5.x.
2018-08-11 18:46:41 -07:00
Michael Scire
761ab4fcfe Creport: Update makefile to build npdm/nsp 2018-08-10 19:52:32 -07:00
Pika
294f05ea56 make all (working) sysmodules compile 2018-08-03 02:20:52 -07:00
Michael Scire
441e58be56 anti-telemetry: Do not boot Error Collection sysmodule 2018-08-01 23:15:52 -07:00
Michael Scire
cb4089e49c Stratosphere: use isxdigit to check if char is hex. 2018-07-29 17:27:30 -07:00
Michael Scire
c70420d996 creport: Actually change report paths. 2018-07-29 16:54:15 -07:00
Michael Scire
84bcaf8dc6 creport: Change report path to crash_reports 2018-07-29 16:48:33 -07:00
Michael Scire
c547ed50aa Loader: Fix exefs nsp support. Works on hardware. 2018-07-29 16:45:29 -07:00
Michael Scire
3a2520a3b7 Loader: Add support for exefs redirection to code nsp on SD. 2018-07-29 16:35:43 -07:00
Michael Scire
44e2412ae6 Loader: Change ips patch location to ease patch distribution 2018-07-29 11:27:19 -07:00
Michael Scire
e697f6bdd0 fs.mitm: Fix flag detection. 2018-07-29 11:21:42 -07:00
Michael Scire
de05685e3d fs.mitm: Remove shim for fsStorageGetSize, which was added to libnx 2018-07-29 11:07:05 -07:00
Michael Scire
674a91db8c Loader/ips: Fix more bugs, now works with simple test on hw. 2018-07-28 21:06:50 -07:00
Michael Scire
08275240c6 Loader/ips: fix compile error 2018-07-28 20:41:13 -07:00
Michael Scire
75916001a2 Loader: Fix IPS edge condition, change ips location 2018-07-28 20:36:30 -07:00
Michael Scire
0f5f3c2ad0 Loader: Implement IPS/IPS32 patching. 2018-07-28 20:28:17 -07:00
Michael Scire
c1fd2eda20 Loader: Skeleton IPS/IPS32 patching support. 2018-07-28 20:01:09 -07:00
Michael Scire
cd42f6dc18 fs.mitm: Allow fsmitm.flag specification for mitm 2018-07-28 12:29:54 -07:00
Michael Scire
a811b447ce creport: Pretty-print addresses whenever possible. 2018-07-27 20:34:09 -07:00
Michael Scire
5993614c2e fs.mitm: Try to MitM titles that have override RomFS content on the SD card 2018-07-27 20:15:06 -07:00
Michael Scire
2a6348cd73 creport: add fsp-srv access to npdm 2018-07-27 19:57:32 -07:00
Michael Scire
b365065a2d Loader: Support loading FsStorageId_None content from SD. 2018-07-27 19:53:20 -07:00
Michael Scire
5a63f4e304 PM: Make boot2 launch SD card content with StorageId_None 2018-07-27 19:34:22 -07:00
Michael Scire
2667266aad pm.boot2: Skeleton hook for SD-mandated launches 2018-07-27 03:22:06 -07:00
Michael Scire
c079803189 PM: Use enum in EmbeddedBoot2 2018-07-27 02:37:45 -07:00
Michael Scire
9f16062767 PM: Embed boot2 logic in PM. 2018-07-27 02:23:53 -07:00
misson20000
6adcb483e5 pm: remove magic flag/event numbers to improve readability and understandability 2018-07-27 02:03:28 -07:00
Michael Scire
9d0d9d95e1 Stratosphere: Give more memory to SYSTEM, use less memory. 2018-07-27 01:44:34 -07:00
hexkyz
7836609839 Fix multiple issues reported by Coverity Scan 2018-07-26 18:45:18 +01:00
Michael Scire
dd4993dfda Loader: Use HW-acceleration for SHA256 2018-07-24 01:26:37 -07:00
Michael Scire
eaa282b915 Fix additional UAF in DirEntry building 2018-07-19 21:21:50 -06:00
Michael Scire
a46e796f4d fs.mitm: Fix UAF in every DirEntry processed.
How on earth did this code ever work?
2018-07-19 21:17:57 -06:00
Léo Lam
49ba91a8f3 fs_istorage: Default IStorage destructor in cpp
Prevents a -Wweak-vtables warning.
2018-07-10 09:38:18 -07:00
Léo Lam
e088a2f414 stratosphere: In-class initialize members
Same thing, less code, less boilerplate.
2018-07-10 09:38:18 -07:00
Léo Lam
5b3e8e1c5d stratosphere: Use RAII for locks
This renames the Mutex class member functions so that the mutex types
satisfy Lockable.

This makes them usable with standard std::scoped_lock
and std::unique_lock, which lets us use RAII and avoids the need
for a custom RAII wrapper :)
2018-07-10 09:38:18 -07:00
Léo Lam
18153713d9 pm: Fix missing include 2018-07-10 09:38:18 -07:00
Léo Lam
a28b40866a stratosphere: Remove an unneeded constructor
domain_objects is already an array of empty std::shared_ptrs (since
std::shared_ptr has a sane default constructor).
2018-07-10 09:38:18 -07:00
Michael Scire
83c9747e5f fs.mitm: Save memory+time in sibling reconstruction via reverse iteration 2018-06-29 00:34:18 -06:00
Michael Scire
4c920dfe92 fs.mitm: Optimize out remaining O(n^2) op. BotW is very fast. 2018-06-28 23:24:08 -06:00
Michael Scire
90226ec438 fs.mitm: Fix typo. map impl takes 2-3 seconds to boot botw. 2018-06-28 23:18:35 -06:00
Michael Scire
c536665fe9 fs.mitm: Use std::map for RomFS building 2018-06-28 22:40:18 -06:00
Michael Scire
fb0c1b1ac7 fs.mitm: Fix debug-commented-out command 2018-06-28 20:42:27 -06:00
Michael Scire
caac5f9078 fs.mitm: Simplify source merging condition thanks to padding guarantees 2018-06-28 20:41:36 -06:00
Michael Scire
a95836552e fs.mitm: Use less path memory, fix source concat. (Fixes BotW, probably others) 2018-06-28 20:39:23 -06:00
Michael Scire
8da27723fc fs.mitm: Fix c++ modernization breaking changes 2018-06-27 23:02:06 -06:00
Michael Scire
6fd82b7947 creport: Add dying message to output report, if relevant. 2018-06-26 00:51:53 -06:00
Michael Scire
4eadeb021b creport: Complete crash report saving. 2018-06-26 00:44:58 -06:00
Michael Scire
d5b303f852 creport: Clean up bugs, now saves (empty) reports to the SD successfully 2018-06-25 22:27:33 -06:00
Michael Scire
12236eae9e creport: Fix bad constructor for ThreadInfo 2018-06-25 20:40:33 -06:00
Michael Scire
71e87e9e35 creport: fix a bunch of trivial errors 2018-06-25 10:25:14 -06:00
Michael Scire
fc36429b99 creport: fix typo in json 2018-06-25 10:23:37 -06:00
Michael Scire
b8e0c2855f creport: Further Skeleton Report saving. 2018-06-25 10:22:37 -06:00
Michael Scire
92bc396972 creport: Implement reading name/build id from .rodata 2018-06-25 09:50:36 -06:00
Michael Scire
f189610af8 creport: Skeleton reading of Code Regions. 2018-06-25 04:38:54 -06:00
Michael Scire
fd6fa89122 creport: fix thread_list access style 2018-06-25 04:08:42 -06:00
Michael Scire
d65255acb8 creport: Implement reading info about all threads. 2018-06-25 04:07:44 -06:00
Michael Scire
5268a9f9f3 creport: Implement reading a dying message 2018-06-25 03:40:32 -06:00
Michael Scire
e6b7793916 creport: Parse info for crashed thread 2018-06-25 03:04:17 -06:00
Michael Scire
7cd44e8980 creport: Read exception info properly (except for crashed thread info) 2018-06-25 02:18:26 -06:00
Michael Scire
4e7fcc1a50 creport: Solidify main() logic. 2018-06-25 01:58:44 -06:00
Michael Scire
851d21a276 creport: Implement process open, stub exception parsing. 2018-06-25 01:45:25 -06:00
Michael Scire
6ffc9bd8e0 creport: Further skeleton the CrashReport object. 2018-06-25 00:42:26 -06:00
Michael Scire
af4485d533 creport: Add skeleton. Doesn't actually generate reports yet. 2018-06-24 22:46:20 -06:00
Michael Scire
bcf81fe957 Loader: Fix argument passing. 2018-06-24 21:39:05 -06:00
Michael Scire
284677c486 libstratosphere: Cleanup resources when doing OutSession for domains. 2018-06-24 12:39:09 -06:00
Tony Wasserka
ad636f7216 Modernize C++ usage (#144)
* Stratosphere: Use modern C++ idioms in some places

* algorithms like std::for_each are used instead of raw loops

* Stratosphere: Replace more raw loops with algorithms

* Stratosphere: Add a utility predicate function to test for equality with a reference element

This can be used to rewrite some common raw loops using algorithms instead

* fs.mitm: Use variant

* fs.mitm: Use enum class

* fs.mitm: Turn RomFSSourceInfo::Cleanup into a destructor

This obsoletes the need for a custom deleter in other places

* fs.mitm: Use enum class some more

* fs.mitm: Use unique_ptr

* fs.mitm: Simplify initialization

* Stratosphere: Simplify initialization

* fs.mitm: Use unique_ptr (fix memory leak along the way)

The previous code was using "delete" rather than "delete[]"

* fs.mitm: Use vector::emplace_back rather than push_back

emplace_back constructs elements in-place, hence avoiding a redundant element copy.

* Stratosphere: Replace more raw loops with algorithms

* Stratosphere: Use unique_ptr

* fs.mitm: Replace more raw loops with algorithms

* Stratosphere: Prefer move-construction over copy-construction when moving sink parameters around
2018-06-19 11:07:31 -07:00
Michael Scire
f41b780c0a PM: Fix remaining issues, now works properly again. 2018-06-15 00:47:07 -06:00
Michael Scire
4d36697080 Make PM Compile. Note: Currently broken. 2018-06-14 23:32:01 -06:00
Michael Scire
c2d9ac8f5c fs.mitm: WIP LayeredFS impl (NOTE: UNUSABLE ATM)
Also greatly refactors libstratosphere, and does a lot of other things.
There is a lot of code in this one.
2018-06-14 17:51:18 -06:00
Michael Scire
237ff0d1e7 libstratosphere/fs.mitm: Push WIP support for Domains. Not yet fully working. 2018-06-12 16:01:04 -06:00
Michael Scire
5c80016c81 fs.mitm: Add HANS-style redirection for System Data Archives. 2018-06-10 11:11:23 -06:00
Michael Scire
931e38742b fs.mitm: Fix sm^H^Hfshax 2018-06-10 03:12:34 -06:00
Michael Scire
3cbdf0b2b9 fs.mitm: Get Title ID on fsp-srv init, Add worker to handle subinterfaces. 2018-06-10 03:07:15 -06:00
misson20000
ec78fa5977 sm: add compile-time option to put a lower bound on session limits, which lets us do things like accessing fsp-ldr without killing ldr. (#136)
This time with style fixes.
2018-06-10 00:29:42 -07:00
Michael Scire
548903e3fb fs.mitm: Remove debugging test, fix postprocessing. 2018-06-10 01:19:29 -06:00
Michael Scire
ff9412feef fs.mitm: Add hook for postprocessing mitm messages. 2018-06-10 01:17:00 -06:00
Michael Scire
40a6b7bb54 fs.mitm: Fix pointer buffer size passed to mitm'd commands 2018-06-09 19:36:01 -06:00
Michael Scire
6a58307d83 fs.mitm: Remove unnecessary permissions from json. 2018-06-09 19:34:25 -06:00
Michael Scire
c1c211f542 fs.mitm: Implement basic passthrough framework for input commands. 2018-06-09 19:33:22 -06:00
misson20000
28d630a23e pm: add Atmosphere GetProcessHandle command to pm:dmnt (#133) 2018-06-07 23:32:45 -07:00
Tony Wasserka
0359d6535b Build fix 2018-06-03 18:31:03 +02:00
Tony Wasserka
edc099f026 Use "final" and "override" where appropriate (#117) 2018-06-02 22:46:27 -07:00
Michael Scire
bb636dc05a SM: Make Mitm compile-time toggleable, to forestall whining. 2018-06-02 23:42:01 -06:00
Michael Scire
80f40caf67 SM: Add IPC commands for first-class MITM installation. 2018-06-02 23:38:01 -06:00
hexkyz
7a27322044
Boot: Fully implemented GPIO and PINMUX handling 2018-06-02 22:32:51 +01:00
hexkyz
b777844d2d
Boot: Implement PMC wake pin events 2018-05-21 21:32:57 +01:00
TuxSH
b4eeddd7e1 Revamp all the Makefiles (thanks @fincs @WinterMute)
... dependencies are now properly handled (e.g. header changes, etc.)
2018-05-19 01:07:27 +02:00
hexkyz
bf3eea7031
Boot: Implement pinmux drive pad configuration 2018-05-15 21:25:40 +01:00
TuxSH
6efe91b083 boot: build as KIP (thanks @fincs !) 2018-05-15 19:38:04 +02:00
TuxSH
40521a8f63 Fix the syntax errors in the boot JSON files 2018-05-15 19:23:22 +02:00
TuxSH
4e12d55993 loader, pm, sm: build kip as only taget (thanks @fincs !) 2018-05-15 02:28:41 +02:00
TuxSH
d9c2a54464 Make a top-level make build everything in order 2018-05-15 01:30:56 +02:00
TuxSH
cae107557d Fix the remaining warnings in stratosphère 2018-05-15 00:54:12 +02:00
TuxSH
52114760b3 Ignore unused-but-set-variable in ipc_templating.h 2018-05-15 00:44:10 +02:00
TuxSH
ce891c990f Fix latest commit not building 2018-05-15 00:37:07 +02:00
hexkyz
a28924fa10
Boot: Implement pinmux setup 2018-05-14 22:02:40 +01:00
hexkyz
3273cc5357
Merge pull request #84 from leoetlino/printf-format
ldr: Fix printf format string for size_t
2018-05-09 22:49:01 +01:00
Luke Street
96391ffca6 boot: Use fsdevMountSdmc & fsdevUnmountAll 2018-05-09 12:07:53 -04:00
Michael Scire
ba7d0c2cb6 Exosphere: Add API for retrieving versioning info. 2018-05-09 06:29:56 -06:00
Michael Scire
173e6c8c0f PM: Fix missing flags set/missing wait. Now works on 5.x. 2018-05-08 18:46:49 -06:00
hexkyz
a39ad22841
Boot: Fleshing out more low level stuff
Add register read/write for 2.0.0+ (with svcReadWriteRegister)
Add hardware type recognition
Implement PMC clock out configuration
Implement PINMUX park updating
2018-05-08 22:48:43 +01:00
Michael Scire
c800421a36 Loader: Fix char * const correctness. 2018-05-08 04:43:07 -06:00
Michael Scire
5c6f0fc14c SM: Match official SAC validation behavior. 2018-05-08 03:02:57 -06:00
Michael Scire
aa158dbb5a Loader: Fix game update content loading, fix SD card mounting on newer firmwares. Closes #61. 2018-05-08 02:59:18 -06:00
Michael Scire
44127faa17 SM: Fix svcGetSystemInfo bug, now works on 5.0.2. 2018-05-07 22:48:08 -06:00
Michael Scire
b346c8f375 Fix minor bugs in loader/sm 2018-05-07 07:31:36 -06:00
Michael Scire
9e558dafee libstratosphere: Make boolean autoparsing match official semantics. 2018-05-07 07:22:41 -06:00
Michael Scire
ae78ee22da ProcessManager: Fully implement pm:dmnt. Remove debug logging. 2018-05-07 04:45:44 -06:00
Michael Scire
6dc8ab6f17 ProcessManager: Refactor resource limits, complete pm:shell. 2018-05-07 03:50:45 -06:00
Michael Scire
700f92162d ProcessManager: Fix Synchronization. Now works on 1.0.0 hardware. 2018-05-06 23:00:05 -06:00
Léo Lam
bd42514af0 ldr: Fix printf format string for size_t
%z should be used for size_t, otherwise the wrong value may be printed.

Fixes two -Wformat warnings.
2018-05-06 21:07:34 +02:00
Léo Lam
999a15c887 boot: Make gpio helper functions internally linked 2018-05-06 13:09:33 +02:00
Léo Lam
555ed96e80 boot: Fix missing argument for gpio_base_vaddr 2018-05-06 13:09:33 +02:00
Léo Lam
d1e9de50e8 boot: Fix invalid usage of svcQueryIoMapping 2018-05-06 13:09:33 +02:00
Michael Scire
6d6ecb503a ProcessManager: Fix svcCreateEvent handle inversion bug, and others.
NOTE: Debugging logs have been left in, and will be cleaned up once PM
is working.
2018-05-06 02:23:47 -06:00
Léo Lam
a097babe18 Replace std::make_tuple with simpler syntax (#77)
* boot2: Simplify g_additional_launch_programs

It appears that Stratosphère is targeting C++17. In C++17,
std::make_tuple is not required for initialisating a tuple anymore.
Same thing, but less typing

* Replace std::make_tuple with {}

More readable and less noise. Also fixes two missing return statements.
2018-05-05 11:41:39 -07:00
Léo Lam
cf50bad36c ipc_templating: Avoid depending on order of evaluation (#83)
f(x, x++) is unspecified behaviour in C++. An implementation could
evaluate arguments from left to right or from right to left.

`T(r.Buffers[a_index], r.BufferSizes[a_index++])` might
access the wrong buffer if `a_index++` is evaluated before the first
argument.

Fixes -Wsequence-point warnings
2018-05-05 11:41:08 -07:00
Michael Scire
772401b81f ProcessManager: Add pm:info, fix pm:shell missing qualifiers 2018-05-04 20:16:40 -06:00
Michael Scire
e596fd0de5 ProcessManager: Implement almost all of pm:shell 2018-05-04 19:57:11 -06:00
Michael Scire
ae830fea95 Process Manager: Add stub for pm:shell 2018-05-04 18:25:26 -06:00
Michael Scire
5d215ef299 Process Manager: Make process flag updating version agnostic, handle 5.x dead process semantics. 2018-05-04 17:55:48 -06:00
Michael Scire
c19750a0d5 ProcessManager: Make launch flag parsing version agnostic. 2018-05-04 01:01:53 -06:00
Michael Scire
d6cf7c605f ProcessManager: Implement core process management logic. 2018-05-03 23:58:37 -06:00