Commit Graph

208 Commits

Author SHA1 Message Date
emoose
9185cdcc79 [Kernel] Fix wide-printf functions not processing %ws format correctly
This would break format strings like memory://%.*ws (that dashboard tries using), because the "ws" part would set FF_IsWide, but FF_IsWide actually seemed to be used as an "is opposite encoding" flag.
Since the format string is wide that'd make it treat the param as ASCII, but in dashboards case the param string provided is actually a wide string.
(in other words, it seems %ws is supposed to mean that the param is always a wide string, not that the param is just opposite encoding)

This changes the old FF_IsWide to FF_InvertWide, and adds a new FF_IsWide that means that the param is always wide.
2020-02-24 14:58:09 -06:00
emoose
ac5d548e90 [Kernel] *FormatData: make peek() match get() endian, fix skip() not advancing pointer 2020-02-24 14:58:09 -06:00
gibbed
a6e6f0f7bf Lint cleanup. 2020-02-22 13:29:07 -06:00
Triang3l
f858631245 [Kernel] Trigger memory callbacks after file read 2020-02-22 18:06:56 +03:00
Triang3l
028c784c5c [Memory] Make heap_size actually mean size rather than high address 2020-02-22 14:55:28 +03:00
Triang3l
8ec813de82 [Memory, D3D12] Various refactoring from data provider development 2020-02-15 21:35:24 +03:00
Gliniak
d241a98189 [Kernel] Rewrote ObReferenceObjectByHandle 2020-02-10 20:52:23 -06:00
gibbed
74c95c64d2 [Kernel] Ignore page size with base addr allocs.
Changes NtAllocateVirtualMemory so that it ignores specified page size when a
base address is specified.

Fixes a crash seen in N3 demo boot.
2020-02-09 06:54:27 -06:00
Silent
38bf6c8822 [Kernel] Make XexUnloadImage fully release the image
Previously XexUnloadImage did not cleanup the image fully,
and if XexLoadImage was to be called again on the same module,
it was not initialized fully, leading to a crash when using it.
2020-01-27 06:35:10 -06:00
Silent
9d48e904da [Kernel] (Partially) fix module refcounting
.xex module handles were retained twice in several places,
possibly causing them to leak.
More placed may have to be fixed too.
2020-01-27 06:35:10 -06:00
Silent
f278e30d21 [Kernel] Fix SHA1 and SHA256 state endianness
Fixes malfunctioning SHA256 hash,
corrupting its state between Update and Finish calls.
2020-01-27 06:33:39 -06:00
Silent
728531eff7 [Kernel] Operate on handle refcounts in Ob funcs
Although this seems counter-intuitive, operating on handle
reference counters in
- ObLookupThreadByThreadId
- ObReferenceObjectByHandle
- ObDereferenceObject
allows to cleanly clean up handles for resources created elsewhere
and destructed by ObDereferenceObject (for example, threads with 0x80
creation flag). Operating on pointer reference counters alone
would leave a stray handle in the slots list.
2019-11-30 20:08:30 -06:00
Silent
05ef022fd7 [Kernel] Do not retain handle in ExCreateThread
Closing the thread handle should delete the thread object
if it's finished. When this handle was retained, closing the handle
left a lingering handle reference and thus this XThread would leak
2019-11-30 20:08:30 -06:00
Triang3l
8ba6f3fc37 [Memory] Trigger watches when making pages writable, not the other way around 2019-11-10 14:21:36 +03:00
gibbed
b422ed750b Oops. Didn't mean to add that yet. 2019-09-04 23:16:06 -05:00
gibbed
2780e7b1a6 Add user_country cvar, rename game_language cvar.
- [Kernel] Rename game_language cvar to user_language.
- [Kernel] Recategorize user_language to XConfig.
- [Kernel] Add user_country cvar, used instead of hardcoded value in XConfig.
- [XAM] Use user_country cvar for xeXamGetLocaleEx instead of
  xeExGetXConfigSetting.
2019-09-04 23:02:55 -05:00
gibbed
4f4b83b421 [Kernel] Move ExGetXConfigSetting to its own file.
- [Kernel] Clean up xboxkrnl registration function declarations.
- [Kernel] Move ExGetXConfigSetting to its own file.
2019-09-04 23:02:55 -05:00
Triang3l
0ad1bd9ab4 [Kernel] XMAInitializeContext physical buffer addresses 2019-08-28 08:11:43 +03:00
Triang3l
2f51949ece [Kernel] Cya l8r recently added wrong XMAInitializeContext comment 2019-08-27 23:53:06 +03:00
Triang3l
9df39e4883 [Kernel] Fix StoreXmaContextIndexedRegister, note about physical addresses in XMAInitializeContext 2019-08-27 23:50:30 +03:00
Triang3l
a422166123 [Kernel] Fix MmAllocatePhysicalMemoryEx range base 2019-08-24 19:23:31 +03:00
Triang3l
7e6bf8022f [Memory] Refactor GetPhysicalAddress and use it for XMA, resolve #1448 2019-08-24 17:42:06 +03:00
emoose
f46e3c7e39 [Kernel/VFS] Ensure vfs::Entry is up-to-date before retrieving file information
Games like Forza use NtQueryInformationFile to get the size of the file, to make sure that there's enough room inside it to write data.

Previously, updating the file size (via SetInfoFile(EndOfFile) or WriteFile) wouldn't update the vfs::Entry size field, which NtQueryInfo uses to return the size of the file.

This resulted in the game thinking that the file was smaller than it actually is, and trying to correct that by using SetInfoFile(EndOfFile), which then truncated the file and deleted important data that was written to it.
2019-08-21 02:00:57 -05:00
emoose
06cacbb9af [Kernel] Implement XeKeysObscureKey & XeKeysAesCbcUsingKey 2019-08-21 02:00:57 -05:00
Triang3l
2507f1a819 [Memory] TranslateVirtual in shim and strings 2019-08-14 10:31:11 +03:00
Triang3l
0067f5561d [Kernel] More TranslateVirtual/HostToGuestVirtual usage 2019-08-14 08:28:30 +03:00
Triang3l
741b5ae2ec [Memory] Add HostToGuestVirtual and use it in a couple of places 2019-08-13 23:49:49 +03:00
Jonathan Goyvaerts
c621e01dd2 Add game_language as a config variable 2019-08-10 06:51:36 -05:00
gibbed
39c3f72c41 [Kernel] Implement RtlComputeCrc32. 2019-08-07 19:50:17 -05:00
gibbed
7d6d732999 [Kernel] Of course I forget to commit another local change. 2019-08-04 11:44:18 -05:00
gibbed
1ebf7bb484 [Kernel] Implement KeTryToAcquireSpinLockAtRaisedIrql. Maybe correctly. 2019-08-04 11:36:49 -05:00
Triang3l
352f12f92e [D3D12] Switch from gflags to cvars 2019-08-03 16:53:23 +03:00
Jonathan Goyvaerts
c1af632562 Replace all gflag implementations with cvar implementations 2019-08-03 02:34:07 +02:00
Triang3l
24383b9137 [Memory/D3D12] Unwatch up to 256 KB ranges 2019-07-31 00:18:12 +03:00
Triang3l
b5fb84473d [Memory] Replace forgotten InvalidateRange in NtReadFile 2019-07-30 09:06:23 +03:00
Triang3l
83da671bb4 Merge branch 'master' into d3d12 2019-07-30 07:59:38 +03:00
gibbed
669d83896d [Kernel] Implement RtlImageNtHeader. 2019-07-29 19:23:16 -05:00
gibbed
cd18b702a6 [Kernel] Implement ExAllocatePool. 2019-07-29 19:21:01 -05:00
gibbed
3d67ffad81 [Kernel] Implement NtOpenSymbolicLinkObject, NtQuerySymbolicLinkObject. 2019-07-29 18:04:06 -05:00
gibbed
48b04d186b Merge remote-tracking branch 'origin/master' into d3d12 2019-07-18 18:02:01 -05:00
gibbed
bf989f0aae [Kernel/VFS] Maybe fix creation of directories. See #1403. 2019-07-18 17:15:57 -05:00
gibbed
6789873620 Merge branch 'master' into d3d12 2019-05-12 07:48:18 -05:00
Rick Gibbed
f0aae00e4f Merge pull request #1353 from emoose/kernel-funcs
[Kernel] Add ObReferenceObjectByName.
2019-05-12 07:02:41 -05:00
Triang3l
ddd2a6922c Merge branch 'master' into d3d12 2019-04-14 18:09:44 +03:00
Triang3l
85e26c5dde [Kernel] XeCryptAes using openluopworld/aes_128 2019-04-14 18:08:07 +03:00
emoose
88bb173c9d [Kernel] Add XeCryptRc4* funcs 2019-04-14 15:19:56 +03:00
emoose
e86bc83eee [Kernel] Add ObReferenceObjectByName 2019-04-13 19:58:06 +01:00
Triang3l
286628b75b Merge branch 'master' into d3d12 2019-04-13 20:30:17 +03:00
Triang3l
5a6b42c611 [Kernel] ExGetXConfigSetting: correct null buffer handling, better fake country 2019-04-13 20:29:00 +03:00
Triang3l
b38f9ade1b Merge branch 'master' into d3d12 2019-04-09 13:56:11 +03:00