Compare commits

..

242 Commits

Author SHA1 Message Date
chaoticgd
a9526b7cc1 Docs: Add missing third party license for Zycore 2025-07-04 14:48:29 -04:00
chaoticgd
ff01a6359b 3rdparty: Update Zydis to v4.1.1 2025-07-04 14:48:29 -04:00
chaoticgd
6c3ea29157 R3000A: Fix DUMP_BLOCKS option 2025-07-04 14:48:29 -04:00
KamFretoZ
36be1a8f7d FSUI: Fix default to game list behaviour 2025-07-04 14:47:19 -04:00
refractionpcsx2
691c3764ac GS/TC: Check channel overlap for local mem invalidation/readbacks 2025-07-04 19:14:46 +02:00
refractionpcsx2
aa0292ada1 GS/TC: Improve dirty overlap conditions 2025-07-04 19:14:46 +02:00
PCSX2 Bot
e4429527e3 [ci skip] Qt: Update Base Translation. 2025-07-04 13:56:06 +02:00
Mrlinkwii
f06285e3a4 UI : fix some wrong spellings 2025-07-03 16:58:07 +02:00
TellowKrinkle
6d47cefefd MacOS: Add gsdumps, save states, and elfs as supported file types 2025-07-03 10:31:45 -04:00
TellowKrinkle
fe71fc6a30 Qt: Support macOS file open events 2025-07-03 10:31:45 -04:00
Gd7
0e649bc70b GameDB: Final Fantasy X fixes.
Set VU0 Clamping Mode to Extra, which fixes the flickering issue with Yojimbo's cloak when EE Clamping Mode is set to Full, without causing any other issues.
Added missing settings to all other versions of FFX, along with fixing and clarifying the comments.
Removed settings for "Final Fantasy X [Bonus Disc - Beyond Final Fantasy]," as it is just a bonus DVD and not an actual game.
2025-07-02 18:28:34 +02:00
weirdbeardgame
e0915d8372 FSUI: Change to constant string literal 2025-07-02 18:27:05 +02:00
PCSX2 Bot
3f4d9cda85 [ci skip] PAD: Update to latest controller database. 2025-06-30 18:01:37 +02:00
PCSX2 Bot
4e25988961 [ci skip] Qt: Update Base Translation. 2025-06-29 20:19:41 -04:00
JordanTheToaster
b1502c754a Deps: Update Windows and Linux to Qt 6.9.1 2025-06-29 19:47:09 -04:00
SternXD
303cef78ed FSUI: Add Save State Incompatible Warning
Signed-off-by: SternXD <stern@sidestore.io>
2025-06-29 17:02:45 -04:00
Davide Pesavento
a72f282156 Qt: Fix minor typos in settings help text 2025-06-29 17:01:25 -04:00
escape209
32e77a2bd3 Fix some timestamps in GameList using wrong locale 2025-06-29 16:57:05 -04:00
KamFretoZ
a53fdfae82 FSUI: Add option to open Game List directly on startup 2025-06-29 16:56:01 -04:00
Haisom
806ab5ad01 Refactor: Renames help function for consistency
- Renamed <IsMemoryCardFolder> to <FileMcd_IsFolder> for better consistency and clarity on MemoryCardFile.cpp.
2025-06-29 16:54:49 -04:00
chaoticgd
f5ddc0d7c6 Debugger: Add Follow Address option in memory view 2025-06-29 16:54:27 -04:00
chaoticgd
a6eb5d32d8 Debugger: Make some more strings translatable 2025-06-29 16:53:22 -04:00
RedDevilus
b03c982706 3rdparty: Soundtouch bump to v2.4.0
Author also moved to https://codeberg.org/soundtouch/soundtouch. Audiochannel bump from 16 to 32 limit.
2025-06-29 16:52:37 -04:00
Ziemas
7835ebd14f debugger: don't refresh thread/module when paused 2025-06-29 16:52:17 -04:00
Ziemas
fd67049cf9 debugger: sanity check module list 2025-06-29 16:52:17 -04:00
Ziemas
c2f05371e4 debugger: update thread list on refresh 2025-06-29 16:52:17 -04:00
Ziemas
5c9c071086 debugger: set thread list vertical resize 2025-06-29 16:52:17 -04:00
Ziemas
f7677105ed debugger: cache thread list in model 2025-06-29 16:52:17 -04:00
Ziemas
9e2a73c7a7 debugger: use monospace font for thread list 2025-06-29 16:52:17 -04:00
Ziemas
c9f5f03d02 debugger: update module list on Refresh event 2025-06-29 16:52:17 -04:00
Ziemas
c313736334 debugger: set vertical resize of module list 2025-06-29 16:52:17 -04:00
Ziemas
1eb9a60b4a debugger: cache module list in model 2025-06-29 16:52:17 -04:00
Ziemas
e50fe50daf debugger: display iop module list 2025-06-29 16:52:17 -04:00
Ziemas
643c83c2a0 debugger: Find and build IOP module list 2025-06-29 16:52:17 -04:00
JordanTheToaster
44733d7655 3rdparty: Update Vulkan-Headers to v1.4.320 2025-06-29 16:51:05 -04:00
JordanTheToaster
fcdd43fc78 3rdparty: Update vkmemoryallocator to 3.3.0 2025-06-29 16:51:05 -04:00
JordanTheToaster
78643623c3 3rdparty: Update d3d12memalloc to 3.0.1 2025-06-29 16:51:05 -04:00
SternXD
b27846ce39 FSUI: Add custom RetroAchievements login dialog
FSUI: Add custom RetroAchievements login dialog
Signed-off-by: SternXD <stern@sidestore.io>
2025-06-29 16:50:14 -04:00
TellowKrinkle
b87b8eb7bb MacOS: Add pnach definition to Info.plist
Ensures macOS treats it as a known file type, so it doesn't try to prevent users from adding it as a file extension
2025-06-29 16:47:22 -04:00
dependabot[bot]
709dfdd3f2 Bump the ci-deps group across 1 directory with 2 updates
Bumps the ci-deps group with 2 updates in the / directory: [softprops/action-gh-release](https://github.com/softprops/action-gh-release) and [baptiste0928/cargo-install](https://github.com/baptiste0928/cargo-install).


Updates `softprops/action-gh-release` from 2.2.2 to 2.3.2
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](da05d55257...72f2c25fcb)

Updates `baptiste0928/cargo-install` from 3.3.0 to 3.3.1
- [Release notes](https://github.com/baptiste0928/cargo-install/releases)
- [Changelog](https://github.com/baptiste0928/cargo-install/blob/main/CHANGELOG.md)
- [Commits](91c5da1557...e38323ef01)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.3.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci-deps
- dependency-name: baptiste0928/cargo-install
  dependency-version: 3.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-29 16:46:44 -04:00
TheLastRar
faef28d5c4 Deps: Also force PDB files for Qt's plugins 2025-06-29 16:45:55 -04:00
TheLastRar
309dd4f847 Deps: Correct comment 2025-06-29 16:45:55 -04:00
TheLastRar
506897fab2 Build: Copy force enabled symbols
Currently only SDL and Qt
2025-06-29 16:45:55 -04:00
SternXD
4e0aff053c SaveState: Improve version incompatibility error message
Make the error message clearer by showing which version of PCSX2 created
the save state and which version is needed to recover it.

Signed-off-by: SternXD <stern@sidestore.io>
2025-06-29 16:45:10 -04:00
Florin9doi
2ba6fbbcc2 USB: Connect the GT Force pedals 2025-06-29 16:44:28 -04:00
TheLastRar
e987eac545 CI/Appimage: Simplify how we bundle Wayland plugins 2025-06-29 16:44:07 -04:00
Florin9doi
6b9781fee6 USB: Throttle the Buzz data packets 2025-06-29 16:43:37 -04:00
TJnotJT
181ceb38cc GS: Put psm_str in the GSUtil struct. 2025-06-29 16:43:09 -04:00
chaoticgd
595ce0ea19 Qt: Add security warning to setup wizard 2025-06-29 16:41:56 -04:00
TheLastRar
b624330155 Deps: Update Pluto(S)VG
PlutoVG is updated to v1.1.0
PlutoSVG is updated to v0.0.7
2025-06-29 16:41:19 -04:00
JordanTheToaster
380c316869 Deps: Update SDL3 3.2.16 2025-06-29 16:40:27 -04:00
Florin9doi
31dacc2d21 Update Negcon to support Wipeout Fusion 2025-06-29 16:40:17 -04:00
Ty
b557a82009 [ci skip] 2.5.x Development Cycle 2025-06-29 16:34:51 -04:00
Ty
e4af1c4244 [ci-skip] 2.4 Release 2025-06-29 15:47:12 -04:00
JordanTheToaster
7c26ac5578 GameDB: Various fixes 2025-06-29 21:07:07 +02:00
JordanTheToaster
2948d50b0d GameDB: Shadow Hearts fixes 2025-06-29 10:32:13 +02:00
lightningterror
48fefddcb2 GS/HW: Fix -Wunused-variable warnings. 2025-06-29 10:17:57 +02:00
lightningterror
f4d8af2f0d GS/GL: Don't re enable blend after SetupDATE.
Redundant calls, blending will be enabled if needed.
2025-06-29 10:17:57 +02:00
lightningterror
afa3108623 GS/DX11: Adjust blend/depth stencil state.
OMSetDepthStencilState:
If state is nullptr, new state is also nullptr but stencil ref changes no need to set a new OMSetDepthStencilState.

OMSetBlendState:
If state is nullptr, new state is also nullptr but blend factor changes no need to set a new OMSetBlendState.
2025-06-29 10:17:57 +02:00
lightningterror
6fcfddf19a GS/GL/DX11: Resolve potential rtv/srv conflict for primid date.
primid_texture texture was already bound to rtv, so we either need to unbind it first from rtv, or we can bind it to srv after rtv bind has been changed.

Note: DX11 is fine since gpu state will be updated when DrawIndexedPrimitive is executed but it's nice to keep code parity and visual a visual state
what the pipeline order should do.
2025-06-29 10:17:57 +02:00
lightningterror
6d2f442cbd GS/DX11: Backports the avoid framebuffer optimization from GL.
Unlike OpenGL, we don't need to worry about adding extra barriers here
since we already do fb copies so rt tex won't be bound as an rtv and srv
at the same time, we also check for conflicts beforehand.
2025-06-29 10:17:57 +02:00
PCSX2 Bot
e8260e7191 [ci skip] Qt: Update Base Translation. 2025-06-28 20:04:49 -04:00
Ty
48a4367a2c New translations pcsx2-qt_en.ts (Spanish, Latin America)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
edd3540f34 New translations pcsx2-qt_en.ts (Guarani)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
111c32c5ed New translations pcsx2-qt_en.ts (Quechua)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
af22ca3ae0 New translations pcsx2-qt_en.ts (Hindi)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
5e2caa326c New translations pcsx2-qt_en.ts (Latvian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
50f9f60341 New translations pcsx2-qt_en.ts (Croatian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
65f61b143a New translations pcsx2-qt_en.ts (Persian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
10f4892b7e New translations pcsx2-qt_en.ts (Indonesian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
f71d518f75 New translations pcsx2-qt_en.ts (Portuguese, Brazilian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
c5b11fe484 New translations pcsx2-qt_en.ts (Vietnamese)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
068fd04f15 New translations pcsx2-qt_en.ts (Chinese Traditional)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
a461750b55 New translations pcsx2-qt_en.ts (Chinese Simplified)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
291df6a0e4 New translations pcsx2-qt_en.ts (Ukrainian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
8afeb4ea61 New translations pcsx2-qt_en.ts (Turkish)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
b30f246900 New translations pcsx2-qt_en.ts (Swedish)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
7fd042b197 New translations pcsx2-qt_en.ts (Serbian (Cyrillic))
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
b6b3e364f2 New translations pcsx2-qt_en.ts (Russian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
70e5f18971 New translations pcsx2-qt_en.ts (Portuguese)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
1fb35593d5 New translations pcsx2-qt_en.ts (Polish)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
b1b9c32644 New translations pcsx2-qt_en.ts (Norwegian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
8eeed7d42c New translations pcsx2-qt_en.ts (Dutch)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
584493d945 New translations pcsx2-qt_en.ts (Lithuanian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
da8e551e77 New translations pcsx2-qt_en.ts (Korean)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
a717930d5a New translations pcsx2-qt_en.ts (Georgian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
abc000f614 New translations pcsx2-qt_en.ts (Japanese)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
cd51f1def3 New translations pcsx2-qt_en.ts (Italian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
f5573cf0ab New translations pcsx2-qt_en.ts (Hungarian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
1d036a4897 New translations pcsx2-qt_en.ts (Hebrew)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
f9eced6244 New translations pcsx2-qt_en.ts (Finnish)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
90a7253c66 New translations pcsx2-qt_en.ts (Greek)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
31e065f83a New translations pcsx2-qt_en.ts (German)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
571f443339 New translations pcsx2-qt_en.ts (Danish)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
4a4157919c New translations pcsx2-qt_en.ts (Czech)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
e73aa0e81b New translations pcsx2-qt_en.ts (Catalan)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
2343246315 New translations pcsx2-qt_en.ts (Bulgarian)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
e5f41ce175 New translations pcsx2-qt_en.ts (Arabic)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
8184f2eaa9 New translations pcsx2-qt_en.ts (Afrikaans)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
e0bb465945 New translations pcsx2-qt_en.ts (Spanish)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
55749a63eb New translations pcsx2-qt_en.ts (French)
[ci skip]
2025-06-28 13:31:32 -04:00
Ty
aa1b8db3ea New translations pcsx2-qt_en.ts (Romanian)
[ci skip]
2025-06-28 13:31:32 -04:00
JordanTheToaster
023713fd67 GameDB: The Mummy fixes 2025-06-28 13:05:00 -04:00
refractionpcsx2
35093c3e37 GS/HW: Avoid single pixel overlap on lookups + improve buffer splitting 2025-06-27 18:04:29 +02:00
refractionpcsx2
4e5dac3e25 GameDB: Add fixes for MLB 11 and Toro to Kyuujitsu 2025-06-27 18:03:48 +02:00
refractionpcsx2
c52e84ac41 GS/HW: Add ability to detect 16bit clears with 32bit draw 2025-06-27 18:03:48 +02:00
refractionpcsx2
7f8488771d GS/TC: Improve heuristics for sequenced draws inside targets 2025-06-27 18:03:48 +02:00
refractionpcsx2
57ff271f4b GS/HW: Fix up offset Z behaviours and copy ranges 2025-06-27 18:03:48 +02:00
refractionpcsx2
43703755f8 GS/HW: Improve double half clear detection heuristics 2025-06-27 18:03:48 +02:00
refractionpcsx2
17b6cc00ab GS/HW: When expanding a target for display, expand valid area 2025-06-27 18:03:19 +02:00
JordanTheToaster
a03563b366 GameDB: The Golden Compass fixes 2025-06-26 13:44:29 +02:00
lightningterror
ff9da17498 GS/DX11: Allow to pick whenever to update sr or ss, and some reordering.
No need to call sampler update when updating conflicting srvs.
2025-06-26 13:43:51 +02:00
lightningterror
722bc94270 GS/DX11: Cache shader resource and sampler.
Might help speed things up, requires srv and rtv conflicts to be resolved.
2025-06-26 13:43:51 +02:00
lightningterror
d51a5db5b1 GS/GL: Add missing texture barrier count. 2025-06-26 09:20:54 +02:00
PCSX2 Bot
04541ae2ab [ci skip] Qt: Update Base Translation. 2025-06-25 07:15:25 +02:00
JordanTheToaster
c58a67815b GameDB: Stuart Little 3 loading screen fix 2025-06-25 00:03:28 +02:00
JordanTheToaster
085f964cd9 CI/Linux: Link ffmpeg for the appimage 2025-06-24 06:18:38 +02:00
Mrlinkwii
a8b6e448eb GameDB: remove reference to old GSC 2025-06-24 06:13:14 +02:00
PCSX2 Bot
78ab8381d9 [ci skip] PAD: Update to latest controller database. 2025-06-24 06:12:26 +02:00
PCSX2 Bot
49a5d82086 [ci skip] Qt: Update Base Translation. 2025-06-24 06:12:04 +02:00
TheLastRar
4ed129ccac FSUI: Improve layout scaling in games list selected preview 2025-06-24 06:11:49 +02:00
lightningterror
ed09dca17e GS/DX11: Also check DrawMultiStretchRects copy for srv conflicts with rtv.
Also adjust the naming.
2025-06-23 15:09:03 +02:00
TheLastRar
e64fbb2f0e FSUI: Centre disc/exe icon in game list selected preview
The ImGui::Image path was missing the centring logic when drawing svg icons.
Covers where already correctly centred.
2025-06-23 15:07:56 +02:00
lightningterror
e37f8a6521 IopBios: Fix -Wcompare warnings. 2025-06-23 10:18:00 +02:00
lightningterror
b54bcc0e20 FullscreenUI: Fix -Wunused-variable warnings. 2025-06-23 10:18:00 +02:00
lightningterror
db37d51bb1 GS: Silence 3rdparty vk_mem_alloc warnings.
-Wunused-private-field
2025-06-23 10:18:00 +02:00
lightningterror
197b9fc560 GS/HW: Check if primid texture exists instead if it's a primid draw.
Makes local testing easier to null out primid tex.
Also match naming between gl and dx11.
Change some longs to warning level.
2025-06-23 09:59:22 +02:00
lightningterror
fd30b00205 GS/DX11: Make sure no SRVs are bound using the same texture before binding it to a RTV.
Fixes api hazard warnings.
2025-06-23 09:59:22 +02:00
TheLastRar
f182379d24 FSUI: Don't attempt to translate input profile names in game properties 2025-06-23 09:53:25 +02:00
refractionpcsx2
32ba08980d GS: Treat Q == 0 in STQ as FLT_MIN 2025-06-23 09:46:03 +02:00
PCSX2 Bot
1e1f08abb9 [ci skip] Qt: Update Base Translation. 2025-06-23 06:28:14 +02:00
refractionpcsx2
cbe20c0eed GS/HW: Fix dirty check on SWPrimRenderer check 2025-06-23 06:27:41 +02:00
refractionpcsx2
ec288ffa62 GS/TC: Fix CanTranslate rect BWs, disallow block inside target lookup 2025-06-23 06:27:41 +02:00
JordanTheToaster
7e18c02c7e GameDB: Xenosaga Episode III fixes 2025-06-23 06:27:13 +02:00
twingofan
4a505cc239 GameDB: Add memcardFilters to Armored Core: Last Raven NTSC-U SLUS-21338. (#12891) 2025-06-23 06:26:16 +02:00
Kuan-Wei Chiu
35c81106c6 Fix invalid comparator in FullscreenUI game list sort
The game list comparator previously used >= when sorting by CRC in
descending order. This violates the requirements of a strict weak
ordering, as defined by the C++ standard, which mandates that the
comparator must be irreflexive: comp(x, x) must always return false.

Using >= causes comp(a, b) and comp(b, a) to both return true when
a == b, which breaks the irreflexivity and can invalidate the
assumptions made by std::sort. This may lead to undefined behavior,
including memory corruption or segmentation faults.

Replace >= with > to ensure the comparator satisfies the strict weak
ordering requirement, restoring correctness and stability in game list
sorting behavior.
2025-06-22 14:44:34 -04:00
Ziemas
1094222d3f Debugger: Don't check frame count in isAlive 2025-06-22 20:19:13 +02:00
TheLastRar
065d0db4c9 FSUI: Replace various icons with SVG files
Co-Authored-By: KamFretoZ <14798312+kamfretoz@users.noreply.github.com>
2025-06-22 20:15:03 +02:00
JordanTheToaster
bc51537080 GS/HW: Purge Hitman Blood Money CRC 2025-06-22 20:14:09 +02:00
JordanTheToaster
b7dfcb282b ImGuiOverlays: Minor OSD text changes 2025-06-22 20:14:09 +02:00
JordanTheToaster
78a9411766 GameDB: Various Fixes Part 5 2025-06-22 20:14:09 +02:00
TellowKrinkle
4724f67596 GS: Min alpha for AA1 is 0, not 128 2025-06-22 20:13:15 +02:00
JordanTheToaster
e0851bb86f [ci skip] Github: Update app bug report OS list 2025-06-21 22:00:10 -04:00
JordanTheToaster
08e68d9563 GitHub: Update bug report OS list 2025-06-21 15:50:02 -04:00
refractionpcsx2
0b6dccae51 GS/HW: Resize validity to draw size when most of target is covered 2025-06-21 05:52:50 +02:00
refractionpcsx2
60adfd5046 GS/TC: Fix region area on new source interpreted for shuffle 2025-06-21 05:52:50 +02:00
chaoticgd
3e782d355d Docs: Add missing third party license for KDBindings 2025-06-20 22:22:51 +02:00
PCSX2 Bot
22a7324b69 [ci skip] Qt: Update Base Translation. 2025-06-20 02:02:47 +02:00
refractionpcsx2
f3b4c50909 GS/HW: Improve Native Scaling detection + Include direct mem reads 2025-06-20 02:02:30 +02:00
lightningterror
a45f27e6e9 GS/DX: Don't output color for datm/stencil date shaders.
RTV(Render target view) is not bound so no need
to output anything, just clip/discard if needed.

Fixes dx11 api warning that pixel shader writes color
output but no rtv is bound.
2025-06-20 02:01:47 +02:00
lightningterror
2f84bf0cca GS/TC: Don't enable Frame buffer conversion on PSMT8.
We have dedicated shader now, no need.
2025-06-20 02:01:28 +02:00
refractionpcsx2
3e2c3e5075 GS/TC: Slight fix for rect translation with block offset 2025-06-20 02:00:51 +02:00
refractionpcsx2
154259d0a6 GS/HW: Don't resize target if only writing to alpha when RGB is valid 2025-06-20 02:00:51 +02:00
TellowKrinkle
7d2d05ff59 GS: Send all frames to capture, including skipped ones
You wanted those frames recorded right?  Also if you skip them you'll desync audio and everything will be sad.
2025-06-18 20:08:16 -04:00
TheLastRar
f7c587c9a8 CI: Restore repository check in Flathub publish action 2025-06-18 09:07:54 -04:00
PCSX2 Bot
9162b30b18 [ci skip] Qt: Update Base Translation. 2025-06-18 07:09:06 +02:00
chaoticgd
14cfe37c8b Debugger: Fix crash when breakpoint is hit before createMenuBar call 2025-06-17 04:39:32 +02:00
PCSX2 Bot
a27a0ab49d [ci skip] PAD: Update to latest controller database. 2025-06-17 04:38:20 +02:00
Ty
0742fe07ec [ci skip] Testing flathub versioning, please ignore 2025-06-15 14:53:55 -04:00
Ty
65a92470d3 CI: Fix flathub versioning on tagless commits 2025-06-15 14:26:08 -04:00
PCSX2 Bot
10dc1a2da2 [ci skip] Qt: Update Base Translation. 2025-06-14 21:50:20 +02:00
JordanTheToaster
aad2128c32 GSRunner: Fix broken compilation 2025-06-14 21:50:08 +02:00
refractionpcsx2
2640678cac GS/HW: Adjust which function gets used for clearing depth on perfect match 2025-06-14 01:30:00 +02:00
KamFretoZ
8b90e2d53d BPM: Fix CTD when exiting BPM in No GUI mode 2025-06-14 01:28:49 +02:00
KamFretoZ
f87175dc7f Host: Move Batch/NoGUI mode check to Host
Moved from QtHost to Host for more accesibility
2025-06-14 01:28:49 +02:00
refractionpcsx2
b30444c0d0 GS/HW: Fix bug and improve inside target tracking on HW moves 2025-06-12 23:01:36 +01:00
refractionpcsx2
c1da0caf15 GS/HW: Fix possible null reference causing a crash 2025-06-12 18:26:15 +01:00
lightningterror
c4a8fc5b71 Qt: Fix Winconsistent-missing-override warning. 2025-06-11 23:17:53 +02:00
GovanifY
8eb46b5a4c IopBios: remove clang deprecated carveout
we use snprintf now, so this isn't useful anymore.
2025-06-10 20:59:25 +02:00
GovanifY
8be16d1039 IopBios: do not overflow snprintf tmp buffer
We could otherwise overflow as snprintf does not return the number of
written bytes but the number of written bytes assuming an infinite
buffer.
2025-06-10 20:59:25 +02:00
refractionpcsx2
76e6208d1b GS/TC: Fix region for tex in rt depth 2025-06-10 20:12:41 +02:00
refractionpcsx2
bc09080ba5 GS/TC: Remove old inside check from source lookup 2025-06-10 20:12:41 +02:00
refractionpcsx2
a6eb257a3a GS/HW: Allow RT in RT offset on Z buffer if FRAME is disabled 2025-06-10 20:11:32 +02:00
PCSX2 Bot
e62450d255 [ci skip] PAD: Update to latest controller database. 2025-06-10 20:10:22 +02:00
GovanifY
1aa922f700 IopBios: allow %u string formatting in IOP kprintf 2025-06-10 14:47:27 +02:00
GovanifY
4c9d2f99b1 IopBios: truncate printf output if bigger than our buffer
I also increased the buffer size while we are at it to avoid breakage,
despite the obvious unintended allowed situations that we allowed up
until now

Reported-By: Michael Lappas
2025-06-10 14:47:27 +02:00
Ty Lamontagne
f6e899b570 Debugger: Update search results when we are _not_ going to remove them 2025-06-08 15:44:56 -04:00
refractionpcsx2
695c39fba2 GS/HW: Remove channel shuffle override from Namco CRC hack 2025-06-08 16:05:24 +02:00
refractionpcsx2
e5616cff98 GS/HW: Improve shuffle detection robustness 2025-06-08 13:51:19 +02:00
refractionpcsx2
76d5994c1e GS/TC: Improve rect block offset calculation for translation and invalidation 2025-06-08 13:51:19 +02:00
refractionpcsx2
cbb40832a1 GS/HW: Correct block offset target usage 2025-06-08 13:51:19 +02:00
refractionpcsx2
e4bdcde1ca GS/HW: Remove CRC hacks for Kunoichi and Sakura Wars 2025-06-08 13:51:19 +02:00
refractionpcsx2
863e119ff4 GS/HW: Allow conversion of colour to Z formats during HW move 2025-06-08 13:51:19 +02:00
refractionpcsx2
2ccf6dc872 GS: Add IsPageAlignedMasked to return an alignment mask 2025-06-08 13:51:19 +02:00
refractionpcsx2
24ebf1b4f1 GS/HW: Fix bug in target preloading causing misaligned base addresses 2025-06-08 13:51:19 +02:00
refractionpcsx2
ed2832434c GS/HW: Don't look up block offset targets on Exact target lookup 2025-06-08 13:51:19 +02:00
TJnotJT
5e160fca8f Tools: Small fix to gsrunner args. 2025-06-06 18:05:37 -04:00
JordanTheToaster
a0ef82e221 AudioStream: Fix typo with default output latency 2025-06-06 18:03:29 -04:00
icup321
3e7ac3d66c GameDB: Add native scaling to Scooby-Doo! Unmasked 2025-06-06 23:09:37 +02:00
JordanTheToaster
730e6fa737 GameDB: Simple 2000 Vol 92 Fixes 2025-06-06 23:09:26 +02:00
PCSX2 Bot
cdfcd9fddd [ci skip] Qt: Update Base Translation. 2025-06-06 02:31:08 +02:00
refractionpcsx2
b6930c10b9 GS/HW: Clean up target download formats 2025-06-05 13:51:21 +02:00
refractionpcsx2
852734580d GameDB: Update Harry Potter fixes. 2025-06-05 13:51:21 +02:00
refractionpcsx2
d1dc6a9c1d GS/HW: Add 16bit to 8bit conversion shader 2025-06-05 13:51:21 +02:00
Ty
4fa6d3ed3f GSRunner: Add type to shutdown message code 2025-06-04 20:25:32 -04:00
TellowKrinkle
92e190ad6c GSRunner: Fix surfaceless run on macOS 2025-06-04 20:25:32 -04:00
TellowKrinkle
da4fcffef4 Input: Fix crash when shutting down without initializing input 2025-06-04 20:25:32 -04:00
TellowKrinkle
1a5731dd8e MacOS: Better handle directories of non-bundle applications 2025-06-04 20:25:32 -04:00
TellowKrinkle
e764c5cd4e GSRunner: macOS support 2025-06-04 20:25:32 -04:00
TellowKrinkle
e23b247947 GSRunner: Use separate CPU thread 2025-06-04 20:25:32 -04:00
PCSX2 Bot
3d7792436f [ci skip] Qt: Update Base Translation. 2025-06-04 20:03:38 -04:00
chaoticgd
d8187fbea4 Deps: Specify minimum version of KDDockWidgets 2025-06-04 20:02:02 -04:00
chaoticgd
02259ad0a5 Debugger: Add include required for older versions of KDDockWidgets 2025-06-04 20:02:02 -04:00
TellowKrinkle
220a68df9a GS: Warn on texture replacement folder with wrong case 2025-06-04 19:58:41 -04:00
TellowKrinkle
2ced24f69e GS: Create texture dump directory if it doesn't exist 2025-06-04 19:58:41 -04:00
TellowKrinkle
ec91d0dc74 GS: Formatting 2025-06-04 19:58:41 -04:00
TheLastRar
46874f4673 Qt: Add workaround for incorrectly tinted icons after theme switch 2025-06-04 19:39:18 -04:00
TheLastRar
9eac47dc6c Qt: Fix selected gamelist icons being wrong colour after theme switch 2025-06-04 19:39:18 -04:00
RedDevilus
9e3fd5c2e0 CI: Fix flatpak
Try to fix build failing
2025-06-04 20:19:46 +01:00
refractionpcsx2
ae4be6e2b1 GS/CRC: Remove CRC for Simple 2000 Series Vol. 114, update GameDB Fixes 2025-06-04 18:35:00 +02:00
refractionpcsx2
434df49a7d GS/HW: Clear matched target on HW Move 2025-06-04 18:35:00 +02:00
JordanTheToaster
c939c0fcd5 GameDB: Re-add CRC to Death by Degrees 2025-06-04 18:33:36 +02:00
Berylskid
952c39f324 GameDB: Remove SoftwareRendererFMVHack from Armored Core 2 2025-06-03 13:44:40 +02:00
PCSX2 Bot
0fea7e2a70 [ci skip] Qt: Update Base Translation. 2025-06-03 03:40:13 +02:00
lightningterror
c1baab68d0 GS: Better handle hazards when dx12/vk device creation fails.
VK/DX12: Move CreateNullTexture before reading shader resource.
Fixes null pointer dereference.

VK: Check if vertex buffer is valid before binding.
Fixes vertex buffer validation error null handle.
2025-06-02 21:28:41 +02:00
PCSX2 Bot
ccef18f7a9 [ci skip] PAD: Update to latest controller database. 2025-06-02 19:08:36 +02:00
TheLastRar
8cb056bde3 Qt: Use DevicePixelRatioChange to detect DPR changes 2025-06-02 14:58:00 +02:00
TheLastRar
6ecaaee9e0 QtUtils: Remove redundant method 2025-06-02 14:58:00 +02:00
TheLastRar
c5f916bda0 Qt: Fix DPI icon scaling in various settings windows 2025-06-02 14:58:00 +02:00
TheLastRar
52a9a4649c Qt: Improve handling of DPI 2025-06-02 14:58:00 +02:00
refractionpcsx2
d2219b4dbd GS/TC: On RT->Z dst_match delete on format change if not a shuffle 2025-06-02 14:52:46 +02:00
refractionpcsx2
155f603245 GS/HW: Don't make new scaled targets on shuffles if source is downscaled 2025-06-02 14:52:46 +02:00
refractionpcsx2
cb7630a6ab GS/HW: Create new targets on shuffles when no target found
And get rid of some valid sizing thing which is just insane
2025-06-02 14:52:46 +02:00
refractionpcsx2
284fba1ce3 GS/TC: Don't allow Tex in RT 8bit textures from C24
C24 has no alpha channel, 8bit requires all.  This is still allowed for shuffles as that depends which channel it's reading.
2025-06-02 14:52:46 +02:00
refractionpcsx2
aa4bd6c88c GS/HW: Replace frame target if dirty data matches old format. 2025-06-02 14:52:46 +02:00
refractionpcsx2
623993930b GS/HW: Adjust depth size on clear if overlapping by 1 pixel
This is developer misunderstanding of how to use the SCISSOR register, which adds 1 on to the value when it's used, but they put 512x512, when they wanted 512x512.
2025-06-02 14:52:46 +02:00
refractionpcsx2
dbf2c854c6 GS/TC: Adopt valid rgb/alpha from preload merged targets 2025-06-02 14:52:46 +02:00
refractionpcsx2
25351bc05c GS/TC: Correct valid area checks for target combining 2025-06-02 14:52:46 +02:00
refractionpcsx2
27cc5f499c GS/HW: Fix up alpha blending checks 2025-06-02 14:52:46 +02:00
refractionpcsx2
b7c2f39a17 GS/TC: Further matching parameters on preload and tex in rt 2025-06-02 14:52:46 +02:00
refractionpcsx2
3541c1ccf8 GS/TC: Simplify and improve P8 texture conversion inside target 2025-06-02 14:52:46 +02:00
refractionpcsx2
7a05738d11 GS/TC: Allow matching on source if TEX == RT 2025-06-02 14:52:46 +02:00
refractionpcsx2
686220ae0c GS/TC: Improve copying of dst matched data 2025-06-02 14:52:46 +02:00
refractionpcsx2
cf380d36b9 GS/TC: Fix inside target alignment check for ExactTarget lookup 2025-06-02 14:52:46 +02:00
lightningterror
50bc0193ac Core: Bump savestate version.
[SAVEVERSION+]
2025-06-02 01:30:50 +02:00
refractionpcsx2
2162a72831 GS: Bump GS Dump version and add transfer parameters to dump 2025-06-02 00:40:03 +02:00
refractionpcsx2
313666f85b GS: Store entire GS transfer state at TRXDIR write 2025-06-02 00:40:03 +02:00
TheTechnician27
e9d79263b4 UI: Fix Discord Rich Presence not activating in FSUI 2025-06-01 23:21:39 +02:00
JordanTheToaster
4ede6d65fd GameDB: Fix half right issue with Xtreme Bowling 2025-06-01 13:28:25 -04:00
PCSX2 Bot
14d2eee371 [ci skip] Qt: Update Base Translation. 2025-05-31 20:46:33 -04:00
chaoticgd
717f370be0 Debugger: Improve DockTabBar ownership workaround 2025-05-31 03:30:13 +02:00
refractionpcsx2
d05e4b9727 GS/HW: Adjust SpriteNoGaps check for vertical strips 2025-05-31 03:25:47 +02:00
312 changed files with 219439 additions and 152728 deletions

View File

@@ -70,6 +70,8 @@ body:
- Windows 11
- Windows 10 (64bit)
- Linux (64bit) - Specify distro below
- macOS 26 (Tahoe)
- macOS 15 (Sequoia)
- macOS 14 (Sonoma)
- macOS 13 (Ventura)
- macOS 12 (Monterey)

View File

@@ -87,6 +87,8 @@ body:
- Windows 11
- Windows 10 (64bit)
- Linux (64bit) - Specify distro below
- macOS 26 (Tahoe)
- macOS 15 (Sequoia)
- macOS 14 (Sonoma)
- macOS 13 (Ventura)
- macOS 12 (Monterey)
@@ -104,14 +106,14 @@ body:
id: cpu
attributes:
label: CPU
placeholder: "Example: i5-7600"
placeholder: "Example: Intel i5 12400F"
validations:
required: true
- type: input
id: gpu
attributes:
label: GPU
placeholder: "Example: GTX 1070"
placeholder: "Example: Nvidia RTX 4060"
validations:
required: true
- type: textarea

View File

@@ -6,36 +6,45 @@ on:
workflow_dispatch: # As well as manually.
jobs:
check:
if: github.repository == 'PCSX2/pcsx2'
name: "Check if release is needed"
runs-on: ubuntu-latest
timeout-minutes: 180
outputs:
PCSX2_RELEASE: ${{ steps.getinfo.outputs.PCSX2_RELEASE }}
FLATHUB_RELEASE: ${{ steps.getinfo.outputs.FLATHUB_RELEASE }}
steps:
- name: Get latest tag and Flathub release
id: getinfo
env:
GH_TOKEN: ${{ github.token }}
run: |
PCSX2_RELEASE=$(gh api -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' /repos/PCSX2/pcsx2/releases | jq -r '.[0].tag_name')
FLATHUB_RELEASE=$(curl -L -s https://flathub.org/api/v2/appstream/net.pcsx2.PCSX2 | jq -r '.releases | max_by(.version) | .version')
echo "Latest PCSX2 release is: '${PCSX2_RELEASE}'"
echo "Latest Flathub release is: '${FLATHUB_RELEASE}'"
PCSX2_RELEASE=$(echo $PCSX2_RELEASE | sed 's/[^0-9]*//g')
FLATHUB_RELEASE=$(echo $FLATHUB_RELEASE | sed 's/[^0-9]*//g')
echo "PCSX2_RELEASE=${PCSX2_RELEASE}" >> "$GITHUB_OUTPUT"
echo "FLATHUB_RELEASE=${FLATHUB_RELEASE}" >> "$GITHUB_OUTPUT"
# check is disabled as the flathub api does not give us beta repository information
# Alternatively we can "flatpak remote-info or parse the appstream directly for the beta repo"
# Maybe in the future if we don't want to publish the same version twice if we get no commits
# for 24 hours.
# check:
# if: github.repository == 'PCSX2/pcsx2'
# name: "Check if release is needed"
# runs-on: ubuntu-latest
# timeout-minutes: 180
# outputs:
# PCSX2_RELEASE: ${{ steps.getinfo.outputs.PCSX2_RELEASE }}
# FLATHUB_RELEASE: ${{ steps.getinfo.outputs.FLATHUB_RELEASE }}
# steps:
# - name: Get latest tag and Flathub release
# id: getinfo
# env:
# GH_TOKEN: ${{ github.token }}
# run: |
# PCSX2_RELEASE=$(gh api -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' /repos/PCSX2/pcsx2/releases | jq -r '.[0].tag_name')
# FLATHUB_RELEASE=$(curl -L -s https://flathub.org/api/v2/appstream/net.pcsx2.PCSX2 | jq -r '.releases | max_by(.version) | .version')
# echo "Latest PCSX2 release is: '${PCSX2_RELEASE}'"
# echo "Latest Flathub release is: '${FLATHUB_RELEASE}'"
# PCSX2_RELEASE=$(echo $PCSX2_RELEASE | sed 's/[^0-9]*//g')
# FLATHUB_RELEASE=$(echo $FLATHUB_RELEASE | sed 's/[^0-9]*//g')
# echo "PCSX2_RELEASE=${PCSX2_RELEASE}" >> "$GITHUB_OUTPUT"
# echo "FLATHUB_RELEASE=${FLATHUB_RELEASE}" >> "$GITHUB_OUTPUT"
build:
needs: check
# needs: check
# outputs are automatically compared as strings. This doesn't work in our favour
# Use fromJson() to convert them to proper integers...
# see: https://github.com/github/docs/pull/25870
# and: https://github.com/orgs/community/discussions/57480
#if: fromJson(needs.check.outputs.FLATHUB_RELEASE) < fromJson(needs.check.outputs.PCSX2_RELEASE)
# if: fromJson(needs.check.outputs.FLATHUB_RELEASE) < fromJson(needs.check.outputs.PCSX2_RELEASE)
# As the check step is disabled, perform repository check here
if: github.repository == 'PCSX2/pcsx2'
name: "Build and publish Flatpak"
uses: ./.github/workflows/linux_build_flatpak.yml
with:

View File

@@ -54,19 +54,16 @@ jobs:
uses: actions/checkout@v4
with:
set-safe-directory: ${{ env.GITHUB_WORKSPACE }}
# 10 here, since the odds of having 10 untagged commits in a row should be slim to none
# This is required for the tagging logic in generate-metainfo.sh
fetch-depth: 10
fetch-tags: true
# Work around container ownership issue
- name: Set Safe Directory
shell: bash
run: git config --global --add safe.directory "*"
# Hackity hack. When running the workflow on a schedule, we don't have the tag,
# it doesn't fetch tags, therefore we don't get a version. So grab them manually.
# actions/checkout elides tags, fetch them primarily for releases
- name: Fetch tags
if: ${{ inputs.fetchTags }}
run: git fetch --tags --no-recurse-submodules
- name: Add stable release identifier file
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
shell: bash
@@ -125,7 +122,7 @@ jobs:
cache: true
restore-cache: true
cache-key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} flatpak ${{ hashFiles('.github/workflows/scripts/linux/flatpak/**/*.json') }}
#- name: Validate build
# run: |
# flatpak-builder-lint repo repo

View File

@@ -144,6 +144,7 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DENABLE_SETCAP=OFF \
-DDISABLE_ADVANCE_SIMD=TRUE \
-DUSE_LINKED_FFMPEG=ON \
-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON \
$ADDITIONAL_CMAKE_ARGS

View File

@@ -68,7 +68,7 @@ jobs:
mv ./release-notes.md ${GITHUB_WORKSPACE}/release-notes.md
- name: Create a GitHub Release (Manual)
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8
if: steps.tag_version.outputs.new_tag && github.event_name == 'workflow_dispatch'
with:
body_path: ./release-notes.md
@@ -77,7 +77,7 @@ jobs:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
- name: Create a GitHub Release (Push)
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8
if: steps.tag_version.outputs.new_tag && github.event_name != 'workflow_dispatch'
with:
body_path: ./release-notes.md

View File

@@ -45,16 +45,6 @@ declare -a MANUAL_LIBS=(
"libshaderc_shared.so.1"
)
declare -a MANUAL_QT_LIBS=(
"libQt6WaylandEglClientHwIntegration.so.6"
)
declare -a MANUAL_QT_PLUGINS=(
"wayland-decoration-client"
"wayland-graphics-integration-client"
"wayland-shell-integration"
)
declare -a REMOVE_LIBS=(
'libwayland-client.so*'
'libwayland-cursor.so*'
@@ -66,7 +56,6 @@ set -e
LINUXDEPLOY=./linuxdeploy-x86_64.AppImage
LINUXDEPLOY_PLUGIN_QT=./linuxdeploy-plugin-qt-x86_64.AppImage
APPIMAGETOOL=./appimagetool-x86_64.AppImage
PATCHELF=patchelf
if [ ! -f "$LINUXDEPLOY" ]; then
"$PCSX2DIR/tools/retry.sh" wget -O "$LINUXDEPLOY" https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
@@ -125,7 +114,10 @@ cp "$PCSX2DIR/.github/workflows/scripts/linux/pcsx2-qt.desktop" "net.pcsx2.PCSX2
cp "$PCSX2DIR/bin/resources/icons/AppIconLarge.png" "PCSX2.png"
echo "Running linuxdeploy to create AppDir..."
EXTRA_QT_PLUGINS="core;gui;svg;waylandclient;widgets;xcbqpa" \
# The wayland platform plugin requires the plugins deployed for the waylandcompositor module
# Interestingly, specifying the module doesn't copy the module, only the required plugins for it
# https://github.com/linuxdeploy/linuxdeploy-plugin-qt/issues/160#issuecomment-2655543893
EXTRA_QT_MODULES="core;gui;svg;waylandclient;waylandcompositor;widgets;xcbqpa" \
EXTRA_PLATFORM_PLUGINS="libqwayland-egl.so;libqwayland-generic.so" \
DEPLOY_PLATFORM_THEMES="1" \
QMAKE="$DEPSDIR/bin/qmake" \
@@ -136,34 +128,6 @@ $LINUXDEPLOY --plugin qt --appdir="$OUTDIR" --executable="$BUILDDIR/bin/pcsx2-qt
echo "Copying resources into AppDir..."
cp -a "$BUILDDIR/bin/resources" "$OUTDIR/usr/bin"
# LinuxDeploy's Qt plugin doesn't include Wayland support. So manually copy in the additional Wayland libraries.
echo "Copying Qt Wayland libraries..."
for lib in "${MANUAL_QT_LIBS[@]}"; do
srcpath="$DEPSDIR/lib/$lib"
dstpath="$OUTDIR/usr/lib/$lib"
echo " $srcpath -> $dstpath"
cp "$srcpath" "$dstpath"
$PATCHELF --set-rpath '$ORIGIN' "$dstpath"
done
# .. and plugins.
echo "Copying Qt Wayland plugins..."
for GROUP in "${MANUAL_QT_PLUGINS[@]}"; do
srcpath="$DEPSDIR/plugins/$GROUP"
dstpath="$OUTDIR/usr/plugins/$GROUP"
echo " $srcpath -> $dstpath"
mkdir -p "$dstpath"
for srcsopath in $(find "$DEPSDIR/plugins/$GROUP" -iname '*.so'); do
# This is ../../ because it's usually plugins/group/name.so
soname=$(basename "$srcsopath")
dstsopath="$dstpath/$soname"
echo " $srcsopath -> $dstsopath"
cp "$srcsopath" "$dstsopath"
$PATCHELF --set-rpath '$ORIGIN/../../lib:$ORIGIN' "$dstsopath"
done
done
# Why do we have to manually remove these libs? Because the linuxdeploy Qt plugin
# copies them, not the "main" linuxdeploy binary, and plugins don't inherit the
# include list...

View File

@@ -18,13 +18,13 @@ LIBBACKTRACE=ad106d5fdd5d960bd33fae1c48a351af567fd075
LIBJPEGTURBO=3.1.0
LIBPNG=1.6.48
LIBWEBP=1.5.0
SDL=SDL3-3.2.14
QT=6.9.0
SDL=SDL3-3.2.16
QT=6.9.1
LZ4=1.10.0
ZSTD=1.5.7
KDDOCKWIDGETS=2.2.3
PLUTOVG=0.0.13
PLUTOSVG=0.0.6
PLUTOVG=1.1.0
PLUTOSVG=0.0.7
SHADERC=2024.1
SHADERC_GLSLANG=142052fa30f9eca191aa9dcf65359fcaed09eeec
@@ -39,22 +39,22 @@ fd6f417fe9e3a071cf1424a5152d926a34c4a3c5070745470be6cf12a404ed79 $LIBBACKTRACE.
9564c72b1dfd1d6fe6274c5f95a8d989b59854575d4bbee44ade7bc17aa9bc93 libjpeg-turbo-$LIBJPEGTURBO.tar.gz
46fd06ff37db1db64c0dc288d78a3f5efd23ad9ac41561193f983e20937ece03 libpng-$LIBPNG.tar.xz
7d6fab70cf844bf6769077bd5d7a74893f8ffd4dfb42861745750c63c2a5c92c libwebp-$LIBWEBP.tar.gz
b7e7dc05011b88c69170fe18935487b2559276955e49113f8c1b6b72c9b79c1f $SDL.tar.gz
6340e58879b2d15830c8460d2f589a385c444d1faa2a4828a9626c7322562be8 $SDL.tar.gz
537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b lz4-$LZ4.tar.gz
eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3 zstd-$ZSTD.tar.gz
c1800c2ea835801af04a05d4a32321d79a93954ee3ae2172bbeacf13d1f0598c qtbase-everywhere-src-$QT.tar.xz
2047c6242a57bf97cf40079fa9f91752c137cd9ae84760faa9a2e5e8a440606f qtimageformats-everywhere-src-$QT.tar.xz
ec359d930c95935ea48af58b100c2f5d0d275968ec8ca1e0e76629b7159215fc qtsvg-everywhere-src-$QT.tar.xz
fa645589cc3f939022401a926825972a44277dead8ec8607d9f2662e6529c9a4 qttools-everywhere-src-$QT.tar.xz
1d5581ef5fc7c7bc556f2403017983683993bbebfcdf977ef8f180f604668c3f qttranslations-everywhere-src-$QT.tar.xz
503416fcb04db503bd130e6a49c45e3e546f091e83406f774a0c703130c91805 qtwayland-everywhere-src-$QT.tar.xz
40caedbf83cc9a1959610830563565889878bc95f115868bbf545d1914acf28e qtbase-everywhere-src-$QT.tar.xz
ebe9f238daaf9bb752c7233edadf4af33fc4fa30d914936812b6410d3af1577c qtimageformats-everywhere-src-$QT.tar.xz
2dfc5de5fd891ff2afd9861e519bf1a26e6deb729b3133f68a28ba763c9abbd5 qtsvg-everywhere-src-$QT.tar.xz
90c4a562f4ccfd043fd99f34c600853e0b5ba9babc6ec616c0f306f2ce3f4b4c qttools-everywhere-src-$QT.tar.xz
9761a1a555f447cdeba79fdec6a705dee8a7882ac10c12e85f49467ddd01a741 qttranslations-everywhere-src-$QT.tar.xz
7d21ea0e687180ebb19b9a1f86ae9cfa7a25b4f02d5db05ec834164409932e3e qtwayland-everywhere-src-$QT.tar.xz
eb3b5f0c16313d34f208d90c2fa1e588a23283eed63b101edd5422be6165d528 shaderc-$SHADERC.tar.gz
aa27e4454ce631c5a17924ce0624eac736da19fc6f5a2ab15a6c58da7b36950f shaderc-glslang-$SHADERC_GLSLANG.tar.gz
5d866ce34a4b6908e262e5ebfffc0a5e11dd411640b5f24c85a80ad44c0d4697 shaderc-spirv-headers-$SHADERC_SPIRVHEADERS.tar.gz
03ee1a2c06f3b61008478f4abe9423454e53e580b9488b47c8071547c6a9db47 shaderc-spirv-tools-$SHADERC_SPIRVTOOLS.tar.gz
b8529755b2d54205341766ae168e83177c6120660539f9afba71af6bca4b81ec KDDockWidgets-$KDDOCKWIDGETS.tar.gz
f49d62709d6bf1808ddc9b8f71e22a755484f75c7bbb0fb368f7fb2ffc7cf645 plutovg-$PLUTOVG.tar.gz
01f8aee511bd587a602a166642a96522cc9522efd1e38c2d00e4fbc0aa22d7a0 plutosvg-$PLUTOSVG.tar.gz
8aa9860519c407890668c29998e8bb88896ef6a2e6d7ce5ac1e57f18d79e1525 plutovg-$PLUTOVG.tar.gz
78561b571ac224030cdc450ca2986b4de915c2ba7616004a6d71a379bffd15f3 plutosvg-$PLUTOSVG.tar.gz
EOF
curl -L \

View File

@@ -14,8 +14,8 @@
"sources": [
{
"type": "archive",
"url": "https://libsdl.org/release/SDL3-3.2.14.tar.gz",
"sha256": "b7e7dc05011b88c69170fe18935487b2559276955e49113f8c1b6b72c9b79c1f"
"url": "https://libsdl.org/release/SDL3-3.2.16.tar.gz",
"sha256": "6340e58879b2d15830c8460d2f589a385c444d1faa2a4828a9626c7322562be8"
}
],
"cleanup": [

View File

@@ -11,10 +11,10 @@
},
"sources": [
{
"type": "git",
"type": "git",
"url": "https://github.com/sammycage/plutovg.git",
"tag": "v0.0.13",
"sha256": "5e4712cf873b0c7829a4a6157763e2ad3ac49164"
"tag": "v1.1.0",
"commit": "1a8412d0574c4345dd7ef8a91ce7b58c7dcfe253"
}
],
"cleanup": [

View File

@@ -12,10 +12,10 @@
},
"sources": [
{
"type": "git",
"type": "git",
"url": "https://github.com/sammycage/plutosvg.git",
"tag": "v0.0.6",
"sha256": "c5388fa96feca1f1376a3d0485d5e35159452707"
"tag": "v0.0.7",
"commit": "31f7d2675416cd777c8e86220b035364873b2a8b"
}
],
"cleanup": [

View File

@@ -12,12 +12,24 @@ GIT_DATE=$(git log -1 --pretty=%cd --date=iso8601)
GIT_VERSION=$(git tag --points-at HEAD)
GIT_HASH=$(git rev-parse HEAD)
if [[ "${GIT_VERSION}" == "" ]]; then
# In the odd event that we run this script before the release gets tagged.
GIT_VERSION=$(git describe --tags)
if [[ "${GIT_VERSION}" == "" ]]; then
GIT_VERSION=$(git rev-parse HEAD)
fi
if [[ -z "${GIT_VERSION}" ]]; then
if git branch -r --contains HEAD | grep -q 'origin/master'; then
# Our master doesn't have a tagged commit
# This happens when the commit is "ci skip"
# abbrev so we have just the latest tag
# ie v2.3.420 (Yes, that's the current master at the time of writing)
GIT_VERSION=$(git describe --tags --abbrev=0)
else
# We are probably building a PR
# Keep the short SHA in the version
# ie v2.3.420-1-g10dc1a2da
GIT_VERSION=$(git describe --tags)
fi
if [[ -z "${GIT_VERSION}" ]]; then
# Fallback to raw commit hash
GIT_VERSION=$(git rev-parse HEAD)
fi
fi
echo "GIT_DATE: ${GIT_DATE}"

View File

@@ -40,7 +40,7 @@ fi
FREETYPE=2.13.3
HARFBUZZ=11.2.0
SDL=SDL3-3.2.14
SDL=SDL3-3.2.16
ZSTD=1.5.7
LZ4=1.10.0
LIBPNG=1.6.48
@@ -50,8 +50,8 @@ FFMPEG=6.0
MOLTENVK=1.2.9
QT=6.7.3
KDDOCKWIDGETS=2.2.3
PLUTOVG=0.0.13
PLUTOSVG=0.0.6
PLUTOVG=1.1.0
PLUTOSVG=0.0.7
SHADERC=2024.1
SHADERC_GLSLANG=142052fa30f9eca191aa9dcf65359fcaed09eeec
@@ -79,7 +79,7 @@ CMAKE_ARCH_UNIVERSAL=-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
cat > SHASUMS <<EOF
0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289 freetype-$FREETYPE.tar.xz
16c0204704f3ebeed057aba100fe7db18d71035505cb10e595ea33d346457fc8 harfbuzz-$HARFBUZZ.tar.gz
b7e7dc05011b88c69170fe18935487b2559276955e49113f8c1b6b72c9b79c1f $SDL.tar.gz
6340e58879b2d15830c8460d2f589a385c444d1faa2a4828a9626c7322562be8 $SDL.tar.gz
eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3 zstd-$ZSTD.tar.gz
537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b lz4-$LZ4.tar.gz
46fd06ff37db1db64c0dc288d78a3f5efd23ad9ac41561193f983e20937ece03 libpng-$LIBPNG.tar.xz
@@ -97,8 +97,8 @@ aa27e4454ce631c5a17924ce0624eac736da19fc6f5a2ab15a6c58da7b36950f shaderc-glslan
5d866ce34a4b6908e262e5ebfffc0a5e11dd411640b5f24c85a80ad44c0d4697 shaderc-spirv-headers-$SHADERC_SPIRVHEADERS.tar.gz
03ee1a2c06f3b61008478f4abe9423454e53e580b9488b47c8071547c6a9db47 shaderc-spirv-tools-$SHADERC_SPIRVTOOLS.tar.gz
b8529755b2d54205341766ae168e83177c6120660539f9afba71af6bca4b81ec KDDockWidgets-$KDDOCKWIDGETS.tar.gz
f49d62709d6bf1808ddc9b8f71e22a755484f75c7bbb0fb368f7fb2ffc7cf645 plutovg-$PLUTOVG.tar.gz
01f8aee511bd587a602a166642a96522cc9522efd1e38c2d00e4fbc0aa22d7a0 plutosvg-$PLUTOSVG.tar.gz
8aa9860519c407890668c29998e8bb88896ef6a2e6d7ce5ac1e57f18d79e1525 plutovg-$PLUTOVG.tar.gz
78561b571ac224030cdc450ca2986b4de915c2ba7616004a6d71a379bffd15f3 plutosvg-$PLUTOSVG.tar.gz
EOF
curl -C - -L \

View File

@@ -22,7 +22,7 @@ fi
FREETYPE=2.13.3
HARFBUZZ=11.2.0
SDL=SDL3-3.2.14
SDL=SDL3-3.2.16
ZSTD=1.5.7
LZ4=1.10.0
LIBPNG=1.6.48
@@ -32,8 +32,8 @@ FFMPEG=6.0
MOLTENVK=1.2.9
QT=6.7.3
KDDOCKWIDGETS=2.2.3
PLUTOVG=0.0.13
PLUTOSVG=0.0.6
PLUTOVG=1.1.0
PLUTOSVG=0.0.7
SHADERC=2024.1
SHADERC_GLSLANG=142052fa30f9eca191aa9dcf65359fcaed09eeec
@@ -59,7 +59,7 @@ CMAKE_COMMON=(
cat > SHASUMS <<EOF
0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289 freetype-$FREETYPE.tar.xz
16c0204704f3ebeed057aba100fe7db18d71035505cb10e595ea33d346457fc8 harfbuzz-$HARFBUZZ.tar.gz
b7e7dc05011b88c69170fe18935487b2559276955e49113f8c1b6b72c9b79c1f $SDL.tar.gz
6340e58879b2d15830c8460d2f589a385c444d1faa2a4828a9626c7322562be8 $SDL.tar.gz
eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3 zstd-$ZSTD.tar.gz
537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b lz4-$LZ4.tar.gz
46fd06ff37db1db64c0dc288d78a3f5efd23ad9ac41561193f983e20937ece03 libpng-$LIBPNG.tar.xz
@@ -77,8 +77,8 @@ aa27e4454ce631c5a17924ce0624eac736da19fc6f5a2ab15a6c58da7b36950f shaderc-glslan
5d866ce34a4b6908e262e5ebfffc0a5e11dd411640b5f24c85a80ad44c0d4697 shaderc-spirv-headers-$SHADERC_SPIRVHEADERS.tar.gz
03ee1a2c06f3b61008478f4abe9423454e53e580b9488b47c8071547c6a9db47 shaderc-spirv-tools-$SHADERC_SPIRVTOOLS.tar.gz
b8529755b2d54205341766ae168e83177c6120660539f9afba71af6bca4b81ec KDDockWidgets-$KDDOCKWIDGETS.tar.gz
f49d62709d6bf1808ddc9b8f71e22a755484f75c7bbb0fb368f7fb2ffc7cf645 plutovg-$PLUTOVG.tar.gz
01f8aee511bd587a602a166642a96522cc9522efd1e38c2d00e4fbc0aa22d7a0 plutosvg-$PLUTOSVG.tar.gz
8aa9860519c407890668c29998e8bb88896ef6a2e6d7ce5ac1e57f18d79e1525 plutovg-$PLUTOVG.tar.gz
78561b571ac224030cdc450ca2986b4de915c2ba7616004a6d71a379bffd15f3 plutosvg-$PLUTOSVG.tar.gz
EOF
curl -L \

View File

@@ -46,8 +46,8 @@ set FREETYPE=2.13.3
set HARFBUZZ=11.2.0
set LIBJPEGTURBO=3.1.0
set LIBPNG=1648
set SDL=SDL3-3.2.14
set QT=6.9.0
set SDL=SDL3-3.2.16
set QT=6.9.1
set QTMINOR=6.9
set LZ4=1.10.0
set WEBP=1.5.0
@@ -55,8 +55,8 @@ set ZLIB=1.3.1
set ZLIBSHORT=131
set ZSTD=1.5.7
set KDDOCKWIDGETS=2.2.3
set PLUTOVG=0.0.13
set PLUTOSVG=0.0.6
set PLUTOVG=1.1.0
set PLUTOSVG=0.0.7
set SHADERC=2024.1
set SHADERC_GLSLANG=142052fa30f9eca191aa9dcf65359fcaed09eeec
@@ -68,18 +68,18 @@ call :downloadfile "harfbuzz-%HARFBUZZ%.zip" https://github.com/harfbuzz/harfbuz
call :downloadfile "lpng%LIBPNG%.zip" https://download.sourceforge.net/libpng/lpng1648.zip 2e5f080360f77376eb2bfa9e2ed773b9c7728159aba47b638ad53ca839379040 || goto error
call :downloadfile "libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%LIBJPEGTURBO%/libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" 9564c72b1dfd1d6fe6274c5f95a8d989b59854575d4bbee44ade7bc17aa9bc93 || goto error
call :downloadfile "libwebp-%WEBP%.tar.gz" "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%WEBP%.tar.gz" 7d6fab70cf844bf6769077bd5d7a74893f8ffd4dfb42861745750c63c2a5c92c || goto error
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" 46a17d3ea71fe2580a7f43ca7da286c5b9106dd761e2fd5533bb113e5d86b633 || goto error
call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" 513df15a6365a40f6230ec9463ad8c71b824e181d4b661dac9707e103b24ae0c || goto error
call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" d428fd17a0d3f92c48a30f1d23806bf20352fbce2e80e5bbee27fa80576480ee || goto error
call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" 54bf06afeb67035f1c6afcd00beec755c0d776626b4cce9ab56992a55215ba69 || goto error
call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" 5f8a94a161bd2e71a82f478dc19f4ec77ac95a50709f5a68d5951001ed6bb856 || goto error
call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" 5885ce1a114615cc5fa69e459f069d3fe2bcb1320fd9cc162821f3920ef44735 || goto error
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" 0cc7430fb827c1f843e31b8b26ba7f083b1eeb8f6315a65d3744fd4d25b6c373 || goto error
call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" efa6d8ef9f7ae0fd9f7d280fbff574d71882b60a357ae639e516dc173cf26986 || goto error
call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 8439d3394bc380fd17a920ee96df1d2272bf8d3490871d948ef750f95e0ded06 || goto error
call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" a8f90c768b54e28d61e02c1229b74a2b834e9852af523e5c70bcd2ae4c34a772 || goto error
call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" 38db91c4a8044c395eac89e325ecc25edbda12606fc28812491ef5e5b6b53dd6 || goto error
call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" fd2e776164751fb486495efeee336d26d85fe1ca1f6a7b9eb6aafca2e3d333aa || goto error
call :downloadfile "lz4-%LZ4%.zip" "https://github.com/lz4/lz4/archive/refs/tags/v%LZ4%.zip" 3224b4c80f351f194984526ef396f6079bd6332dd9825c72ac0d7a37b3cdc565 || goto error
call :downloadfile "zlib%ZLIBSHORT%.zip" "https://zlib.net/zlib%ZLIBSHORT%.zip" 72af66d44fcc14c22013b46b814d5d2514673dda3d115e64b690c1ad636e7b17 || goto error
call :downloadfile "zstd-%ZSTD%.zip" "https://github.com/facebook/zstd/archive/refs/tags/v%ZSTD%.zip" 7897bc5d620580d9b7cd3539c44b59d78f3657d33663fe97a145e07b4ebd69a4 || goto error
call :downloadfile "KDDockWidgets-%KDDOCKWIDGETS%.zip" "https://github.com/KDAB/KDDockWidgets/archive/v%KDDOCKWIDGETS%.zip" 1ba8e5b48f3b4d47d2de7121529d448532200fa36d9ed21f93909f6eb03f61cb || goto error
call :downloadfile "plutovg-%PLUTOVG%.zip" "https://github.com/sammycage/plutovg/archive/v%PLUTOVG%.zip" e313baaa7c934503ef601c909661a84e5b795dfa12f0354721cac7a9c27be47e || goto error
call :downloadfile "plutosvg-%PLUTOSVG%.zip" "https://github.com/sammycage/plutosvg/archive/v%PLUTOSVG%.zip" 24826a70d0b168a66eb16ec9d7eeeba0d4ca9d4babc1199889d374918008426e || goto error
call :downloadfile "plutovg-%PLUTOVG%.zip" "https://github.com/sammycage/plutovg/archive/v%PLUTOVG%.zip" 83b2cd6230909a8d586518f49e79e4a1b1e9fab3847db6a678ec9d2dacab052a || goto error
call :downloadfile "plutosvg-%PLUTOSVG%.zip" "https://github.com/sammycage/plutosvg/archive/v%PLUTOSVG%.zip" 82dee2c57ad712bdd6d6d81d3e76249d89caa4b5a4214353660fd5adff12201a || goto error
call :downloadfile "shaderc-%SHADERC%.zip" "https://github.com/google/shaderc/archive/refs/tags/v%SHADERC%.zip" 6c9f42ed6bf42750f5369b089909abfdcf0101488b4a1f41116d5159d00af8e7 || goto error
call :downloadfile "shaderc-glslang-%SHADERC_GLSLANG%.zip" "https://github.com/KhronosGroup/glslang/archive/%SHADERC_GLSLANG%.zip" 03ad8a6fa987af4653d0cfe6bdaed41bcf617f1366a151fb1574da75950cd3e8 || goto error

View File

@@ -44,8 +44,8 @@ set FREETYPE=2.13.3
set HARFBUZZ=11.2.0
set LIBJPEGTURBO=3.1.0
set LIBPNG=1648
set SDL=SDL3-3.2.14
set QT=6.9.0
set SDL=SDL3-3.2.16
set QT=6.9.1
set QTMINOR=6.9
set LZ4=1.10.0
set WEBP=1.5.0
@@ -53,8 +53,8 @@ set ZLIB=1.3.1
set ZLIBSHORT=131
set ZSTD=1.5.7
set KDDOCKWIDGETS=2.2.3
set PLUTOVG=0.0.13
set PLUTOSVG=0.0.6
set PLUTOVG=1.1.0
set PLUTOSVG=0.0.7
set SHADERC=2024.1
set SHADERC_GLSLANG=142052fa30f9eca191aa9dcf65359fcaed09eeec
@@ -66,18 +66,18 @@ call :downloadfile "harfbuzz-%HARFBUZZ%.zip" https://github.com/harfbuzz/harfbuz
call :downloadfile "lpng%LIBPNG%.zip" https://download.sourceforge.net/libpng/lpng1648.zip 2e5f080360f77376eb2bfa9e2ed773b9c7728159aba47b638ad53ca839379040 || goto error
call :downloadfile "libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%LIBJPEGTURBO%/libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" 9564c72b1dfd1d6fe6274c5f95a8d989b59854575d4bbee44ade7bc17aa9bc93 || goto error
call :downloadfile "libwebp-%WEBP%.tar.gz" "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%WEBP%.tar.gz" 7d6fab70cf844bf6769077bd5d7a74893f8ffd4dfb42861745750c63c2a5c92c || goto error
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" 46a17d3ea71fe2580a7f43ca7da286c5b9106dd761e2fd5533bb113e5d86b633 || goto error
call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" 513df15a6365a40f6230ec9463ad8c71b824e181d4b661dac9707e103b24ae0c || goto error
call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" d428fd17a0d3f92c48a30f1d23806bf20352fbce2e80e5bbee27fa80576480ee || goto error
call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" 54bf06afeb67035f1c6afcd00beec755c0d776626b4cce9ab56992a55215ba69 || goto error
call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" 5f8a94a161bd2e71a82f478dc19f4ec77ac95a50709f5a68d5951001ed6bb856 || goto error
call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" 5885ce1a114615cc5fa69e459f069d3fe2bcb1320fd9cc162821f3920ef44735 || goto error
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" 0cc7430fb827c1f843e31b8b26ba7f083b1eeb8f6315a65d3744fd4d25b6c373 || goto error
call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" efa6d8ef9f7ae0fd9f7d280fbff574d71882b60a357ae639e516dc173cf26986 || goto error
call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 8439d3394bc380fd17a920ee96df1d2272bf8d3490871d948ef750f95e0ded06 || goto error
call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" a8f90c768b54e28d61e02c1229b74a2b834e9852af523e5c70bcd2ae4c34a772 || goto error
call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" 38db91c4a8044c395eac89e325ecc25edbda12606fc28812491ef5e5b6b53dd6 || goto error
call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" fd2e776164751fb486495efeee336d26d85fe1ca1f6a7b9eb6aafca2e3d333aa || goto error
call :downloadfile "lz4-%LZ4%.zip" "https://github.com/lz4/lz4/archive/refs/tags/v%LZ4%.zip" 3224b4c80f351f194984526ef396f6079bd6332dd9825c72ac0d7a37b3cdc565 || goto error
call :downloadfile "zlib%ZLIBSHORT%.zip" "https://zlib.net/zlib%ZLIBSHORT%.zip" 72af66d44fcc14c22013b46b814d5d2514673dda3d115e64b690c1ad636e7b17 || goto error
call :downloadfile "zstd-%ZSTD%.zip" "https://github.com/facebook/zstd/archive/refs/tags/v%ZSTD%.zip" 7897bc5d620580d9b7cd3539c44b59d78f3657d33663fe97a145e07b4ebd69a4 || goto error
call :downloadfile "KDDockWidgets-%KDDOCKWIDGETS%.zip" "https://github.com/KDAB/KDDockWidgets/archive/v%KDDOCKWIDGETS%.zip" 1ba8e5b48f3b4d47d2de7121529d448532200fa36d9ed21f93909f6eb03f61cb || goto error
call :downloadfile "plutovg-%PLUTOVG%.zip" "https://github.com/sammycage/plutovg/archive/v%PLUTOVG%.zip" e313baaa7c934503ef601c909661a84e5b795dfa12f0354721cac7a9c27be47e || goto error
call :downloadfile "plutosvg-%PLUTOSVG%.zip" "https://github.com/sammycage/plutosvg/archive/v%PLUTOSVG%.zip" 24826a70d0b168a66eb16ec9d7eeeba0d4ca9d4babc1199889d374918008426e || goto error
call :downloadfile "plutovg-%PLUTOVG%.zip" "https://github.com/sammycage/plutovg/archive/v%PLUTOVG%.zip" 83b2cd6230909a8d586518f49e79e4a1b1e9fab3847db6a678ec9d2dacab052a || goto error
call :downloadfile "plutosvg-%PLUTOSVG%.zip" "https://github.com/sammycage/plutosvg/archive/v%PLUTOSVG%.zip" 82dee2c57ad712bdd6d6d81d3e76249d89caa4b5a4214353660fd5adff12201a || goto error
call :downloadfile "shaderc-%SHADERC%.zip" "https://github.com/google/shaderc/archive/refs/tags/v%SHADERC%.zip" 6c9f42ed6bf42750f5369b089909abfdcf0101488b4a1f41116d5159d00af8e7 || goto error
call :downloadfile "shaderc-glslang-%SHADERC_GLSLANG%.zip" "https://github.com/KhronosGroup/glslang/archive/%SHADERC_GLSLANG%.zip" 03ad8a6fa987af4653d0cfe6bdaed41bcf617f1366a151fb1574da75950cd3e8 || goto error
@@ -90,7 +90,7 @@ if %DEBUG%==1 (
echo Building release libraries...
)
set FORCEPDB=-DCMAKE_SHARED_LINKER_FLAGS_RELEASE="/DEBUG"
set FORCEPDB=-DCMAKE_SHARED_LINKER_FLAGS_RELEASE="/DEBUG" -DCMAKE_MODULE_LINKER_FLAGS_RELEASE="/DEBUG"
echo Building Zlib...
rmdir /S /Q "zlib-%ZLIB%"
@@ -198,9 +198,6 @@ cd "qtbase-everywhere-src-%QT%" || goto error
rem Disable the PCRE2 JIT, it doesn't properly verify AVX2 support.
%PATCH% -p1 < "%SCRIPTDIR%\qtbase-disable-pcre2-jit.patch" || goto error
rem Hackfix settings icon stretching
%PATCH% -p1 < "%SCRIPTDIR%\qtbase-fix-icon-stretch.patch" || goto error
cmake -B build -DFEATURE_sql=OFF -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" %FORCEPDB% -DINPUT_gui=yes -DINPUT_widgets=yes -DINPUT_ssl=yes -DINPUT_openssl=no -DINPUT_schannel=yes -DFEATURE_system_png=ON -DFEATURE_system_jpeg=ON -DFEATURE_system_zlib=ON -DFEATURE_system_freetype=ON -DFEATURE_system_harfbuzz=ON %QTBUILDSPEC% || goto error
cmake --build build --parallel || goto error
ninja -C build install || goto error
@@ -254,8 +251,8 @@ if %DEBUG%==1 (
set KDDOCKWIDGETSBUILDSPEC=-DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_CROSS_CONFIGS=all -DCMAKE_DEFAULT_BUILD_TYPE=Release -DCMAKE_DEFAULT_CONFIGS=all -G "Ninja Multi-Config"
) else (
rem kddockwidgets slightly changes the name of the dll depending on if CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES is used
rem The dll name being kddockwidgets-qt62.dll or kddockwidgets-qt62.dll respectively
rem Always use CMAKE_CONFIGURATION_TYPES to give consistant naming
rem The dll name being kddockwidgets-qt62.dll or kddockwidgets-qt6.dll respectively
rem Always use CMAKE_CONFIGURATION_TYPES to give consistent naming
set KDDOCKWIDGETSBUILDSPEC=-DCMAKE_CONFIGURATION_TYPES=Release -DCMAKE_CROSS_CONFIGS=all -DCMAKE_DEFAULT_BUILD_TYPE=Release -DCMAKE_DEFAULT_CONFIGS=Release -G "Ninja Multi-Config"
)

View File

@@ -1,13 +0,0 @@
diff --git a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
index 208420d7e8..26ef6f31ef 100644
--- a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
+++ b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
@@ -4232,8 +4232,6 @@ QRect QWindowsVistaStyle::subElementRect(SubElement element, const QStyleOption
case SE_ItemViewItemDecoration:
rect = QWindowsStyle::subElementRect(element, option, widget);
- if (qstyleoption_cast<const QStyleOptionViewItem *>(option))
- rect.adjust(-2, 0, 2, 0);
break;
case SE_ItemViewItemFocusRect:

View File

@@ -168,7 +168,7 @@ jobs:
!./bin/**/*.lib
- name: Install the Breakpad Symbol Generator
uses: baptiste0928/cargo-install@91c5da15570085bcde6f4d7aed98cb82d6769fd3
uses: baptiste0928/cargo-install@e38323ef017552d7f7af73a3f4db467f278310ed
with:
crate: dump_syms

View File

@@ -1,3 +1,34 @@
# 3.0.1 (2025-05-08)
- Fixed macros `D3D12MA_RECOMMENDED_ALLOCATOR_FLAGS`, `D3D12MA_RECOMMENDED_POOL_FLAGS` (#73).
# 3.0.0 (2025-05-05)
It has been a long time since the previous official release, so hopefully everyone has been using the latest code from "master" branch, which is always maintained in a good state, not the old version. For completeness, here is the list of changes since v2.0.1. The major version number has changed, so there are some compatibility-breaking changes, but the basic API stays the same and is mostly backward-compatible.
- Added helper structs: `CALLOCATION_DESC`, `CPOOL_DESC`, `CVIRTUAL_BLOCK_DESC`, `CVIRTUAL_ALLOCATION_DESC`.
- Added macros: `D3D12MA_RECOMMENDED_ALLOCATOR_FLAGS`, `D3D12MA_RECOMMENDED_HEAP_FLAGS`, `D3D12MA_RECOMMENDED_POOL_FLAGS`.
- Added functions: `Allocator::CreateResource3`, `CreateAliasingResource2`.
- They support parameters: `D3D12_BARRIER_LAYOUT InitialLayout`, `const DXGI_FORMAT* pCastableFormats`.
- They require recent DirectX 12 Agility SDK. To use them, `ID3D12Device10` must be available.
To use non-empty list of castable formats, `ID3D12Device12` must be available.
- Added support for GPU Upload Heaps (`D3D12_HEAP_TYPE_GPU_UPLOAD`).
- Requires recent DirectX 12 Agility SDK. Support on the user's machine is available only when supported by the motherboard, GPU, drivers, and enabled as "Resizable BAR" in UEFI settings. It can be queried using new `Allocator::IsGPUUploadHeapSupported` function.
- `TotalStatistics::HeapType` array was extended from 4 to 5 elements.
- Added missing function `Allocator::CreateAliasingResource1`.
- Added `POOL_DESC::ResidencyPriority` member.
- Removed `Allocation::WasZeroInitialized` function. It wasn't fully implemented anyway.
- Added `POOL_FLAG_ALWAYS_COMMITTED`.
- Added a heuristic that prefers creating small buffers as committed to save memory.
- It is enabled by default. It can be disabled by new flag `ALLOCATOR_FLAG_DONT_PREFER_SMALL_BUFFERS_COMMITTED`.
- Macro `D3D12MA_OPTIONS16_SUPPORTED` is no longer exposed in the header or Cmake script.
It is defined automatically based on the Agility SDK version.
- Added macro `D3D12MA_DEBUG_LOG`, which can be used to log unfreed allocations.
- Many improvements in the documentation, including new chapters: "Frequently asked questions", "Optimal resource allocation".
- Countless fixes and improvements, including performance optimizations, compatibility with various compilers, tests.
- Major changes in the Cmake script.
- Fixes in "GpuMemDumpVis.py" script.
# 2.0.1 (2022-04-05)
A maintenance release with some bug fixes and improvements. There are no changes in the library API.

View File

@@ -1,4 +1,4 @@
Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -10,10 +10,6 @@ Easy to integrate memory allocation library for Direct3D 12.
**Product page:** [D3D12 Memory Allocator on GPUOpen](https://gpuopen.com/gaming-product/d3d12-memory-allocator/)
**Build status:**
Windows: [![Build status](https://ci.appveyor.com/api/projects/status/860i07bxv55ydgvg?svg=true)](https://ci.appveyor.com/project/adam-sawicki-amd/d3d12memoryallocator)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator.svg)](http://isitmaintained.com/project/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator "Average time to resolve an issue")
# Problem
@@ -91,7 +87,7 @@ With this one function call:
# Binaries
The release comes with precompiled binary executable for "D3D12Sample" application which contains test suite. It is compiled using Visual Studio 2019, so it requires appropriate libraries to work, including "MSVCP140.dll", "VCRUNTIME140.dll", "VCRUNTIME140_1.dll". If its launch fails with error message telling about those files missing, please download and install [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads), "x64" version.
The release comes with precompiled binary executable for "D3D12Sample" application which contains test suite. It is compiled using Visual Studio 2022, so it requires appropriate libraries to work, including "MSVCP140.dll", "VCRUNTIME140.dll", "VCRUNTIME140_1.dll". If its launch fails with error message telling about those files missing, please download and install [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170), "X64" version.
# Copyright notice
@@ -113,7 +109,8 @@ For more information see [NOTICES.txt](NOTICES.txt).
- **[Qt Project](https://github.com/qt)**
- **[Ghost of Tsushima: Director's Cut PC](https://www.youtube.com/watch?v=cPKBDbCYctc&t=698s)** - Information avaliable in 11:38 of credits
- **[Godot Engine](https://github.com/godotengine/godot/)** - multi-platform 2D and 3D game engine. License: MIT.
- **[The Forge](https://github.com/ConfettiFX/The-Forge)** - cross-platform rendering framework. Apache License 2.0.
- **[Wicked Engine<img src="https://github.com/turanszkij/WickedEngine/blob/master/Content/logo_small.png" width="28px" align="center"/>](https://github.com/turanszkij/WickedEngine)** - 3D engine with modern graphics
- **[Wicked Engine](https://github.com/turanszkij/WickedEngine)** - 3D engine with modern graphics
[Some other projects on GitHub](https://github.com/search?q=D3D12MemAlloc.h&type=Code) and some game development studios that use DX12 in their games.

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
//
// Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -33,6 +33,13 @@
#include <shared_mutex>
#endif
// Includes needed for MinGW - see #71.
#ifndef _MSC_VER
#include <guiddef.h>
// guiddef.h must be included first.
#include <dxguids.h>
#endif
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
@@ -42,6 +49,14 @@
////////////////////////////////////////////////////////////////////////////////
#ifndef _D3D12MA_CONFIGURATION
#if !defined(D3D12MA_CPP20)
#if __cplusplus >= 202002L || _MSVC_LANG >= 202002L // C++20
#define D3D12MA_CPP20 1
#else
#define D3D12MA_CPP20 0
#endif
#endif
#ifdef _WIN32
#if !defined(WINVER) || WINVER < 0x0600
#error Required at least WinAPI version supporting: client = Windows Vista, server = Windows Server 2008.
@@ -64,6 +79,10 @@
#define D3D12MA_ASSERT(cond) assert(cond)
#endif
#if D3D12MA_CPP20
#include <bit>
#endif
// Assert that will be called very often, like inside data structures e.g. operator[].
// Making it non-empty can make program slow.
#ifndef D3D12MA_HEAVY_ASSERT
@@ -107,6 +126,14 @@ especially to test compatibility with D3D12_RESOURCE_HEAP_TIER_1 on modern GPUs.
#define D3D12MA_DEFAULT_BLOCK_SIZE (64ull * 1024 * 1024)
#endif
#ifndef D3D12MA_OPTIONS16_SUPPORTED
#if D3D12_SDK_VERSION >= 610
#define D3D12MA_OPTIONS16_SUPPORTED 1
#else
#define D3D12MA_OPTIONS16_SUPPORTED 0
#endif
#endif
#ifndef D3D12MA_DEBUG_LOG
#define D3D12MA_DEBUG_LOG(format, ...)
/*
@@ -128,10 +155,6 @@ especially to test compatibility with D3D12_RESOURCE_HEAP_TIER_1 on modern GPUs.
#define D3D12MA_IID_PPV_ARGS(ppType) __uuidof(**(ppType)), reinterpret_cast<void**>(ppType)
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
#define D3D12MA_CREATE_NOT_ZEROED_AVAILABLE 1
#endif
namespace D3D12MA
{
static constexpr UINT HEAP_TYPE_COUNT = 5;
@@ -292,6 +315,10 @@ static UINT8 BitScanLSB(UINT64 mask)
if (_BitScanForward64(&pos, mask))
return static_cast<UINT8>(pos);
return UINT8_MAX;
#elif D3D12MA_CPP20
if (mask != 0)
return static_cast<uint8_t>(std::countr_zero(mask));
return UINT8_MAX;
#elif defined __GNUC__ || defined __clang__
return static_cast<UINT8>(__builtin_ffsll(mask)) - 1U;
#else
@@ -314,6 +341,10 @@ static UINT8 BitScanLSB(UINT32 mask)
if (_BitScanForward(&pos, mask))
return static_cast<UINT8>(pos);
return UINT8_MAX;
#elif D3D12MA_CPP20
if (mask != 0)
return static_cast<uint8_t>(std::countr_zero(mask));
return UINT8_MAX;
#elif defined __GNUC__ || defined __clang__
return static_cast<UINT8>(__builtin_ffs(mask)) - 1U;
#else
@@ -336,6 +367,9 @@ static UINT8 BitScanMSB(UINT64 mask)
unsigned long pos;
if (_BitScanReverse64(&pos, mask))
return static_cast<UINT8>(pos);
#elif D3D12MA_CPP20
if (mask != 0)
return 63 - static_cast<uint8_t>(std::countl_zero(mask));
#elif defined __GNUC__ || defined __clang__
if (mask)
return 63 - static_cast<UINT8>(__builtin_clzll(mask));
@@ -358,6 +392,9 @@ static UINT8 BitScanMSB(UINT32 mask)
unsigned long pos;
if (_BitScanReverse(&pos, mask))
return static_cast<UINT8>(pos);
#elif D3D12MA_CPP20
if (mask != 0)
return 31 - static_cast<uint8_t>(std::countl_zero(mask));
#elif defined __GNUC__ || defined __clang__
if (mask)
return 31 - static_cast<UINT8>(__builtin_clz(mask));
@@ -2791,7 +2828,7 @@ class AllocationObjectAllocator
D3D12MA_CLASS_NO_COPY(AllocationObjectAllocator);
public:
AllocationObjectAllocator(const ALLOCATION_CALLBACKS& allocationCallbacks, bool useMutex)
: m_Allocator(allocationCallbacks, 1024), m_UseMutex(useMutex) {}
: m_UseMutex(useMutex), m_Allocator(allocationCallbacks, 1024) {}
template<typename... Types>
Allocation* Allocate(Types... args);
@@ -2982,7 +3019,7 @@ void BlockMetadata::DebugLogAllocation(UINT64 offset, UINT64 size, void* private
LPCWSTR name = allocation->GetName();
D3D12MA_DEBUG_LOG(L"UNFREED ALLOCATION; Offset: %llu; Size: %llu; PrivateData: %p; Name: %s",
offset, size, privateData, name ? name : L"D3D12MA_Empty");
offset, size, privateData, name ? name : L"");
}
}
@@ -5369,8 +5406,8 @@ struct CREATE_RESOURCE_PARAMS
{
CREATE_RESOURCE_PARAMS() = delete;
CREATE_RESOURCE_PARAMS(
const D3D12_RESOURCE_DESC* pResourceDesc,
D3D12_RESOURCE_STATES InitialResourceState,
const D3D12_RESOURCE_DESC* pResourceDesc,
D3D12_RESOURCE_STATES InitialResourceState,
const D3D12_CLEAR_VALUE* pOptimizedClearValue)
: Variant(VARIANT_WITH_STATE)
, pResourceDesc(pResourceDesc)
@@ -5380,8 +5417,8 @@ struct CREATE_RESOURCE_PARAMS
}
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
CREATE_RESOURCE_PARAMS(
const D3D12_RESOURCE_DESC1* pResourceDesc,
D3D12_RESOURCE_STATES InitialResourceState,
const D3D12_RESOURCE_DESC1* pResourceDesc,
D3D12_RESOURCE_STATES InitialResourceState,
const D3D12_CLEAR_VALUE* pOptimizedClearValue)
: Variant(VARIANT_WITH_STATE_AND_DESC1)
, pResourceDesc1(pResourceDesc)
@@ -5396,7 +5433,7 @@ struct CREATE_RESOURCE_PARAMS
D3D12_BARRIER_LAYOUT InitialLayout,
const D3D12_CLEAR_VALUE* pOptimizedClearValue,
UINT32 NumCastableFormats,
DXGI_FORMAT* pCastableFormats)
const DXGI_FORMAT* pCastableFormats)
: Variant(VARIANT_WITH_LAYOUT)
, pResourceDesc1(pResourceDesc)
, InitialLayout(InitialLayout)
@@ -5466,7 +5503,7 @@ struct CREATE_RESOURCE_PARAMS
D3D12MA_ASSERT(Variant >= VARIANT_WITH_LAYOUT);
return NumCastableFormats;
}
DXGI_FORMAT* GetCastableFormats() const
const DXGI_FORMAT* GetCastableFormats() const
{
D3D12MA_ASSERT(Variant >= VARIANT_WITH_LAYOUT);
return pCastableFormats;
@@ -5491,7 +5528,7 @@ private:
const D3D12_CLEAR_VALUE* pOptimizedClearValue;
#ifdef __ID3D12Device10_INTERFACE_DEFINED__
UINT32 NumCastableFormats;
DXGI_FORMAT* pCastableFormats;
const DXGI_FORMAT* pCastableFormats;
#endif
};
@@ -5541,6 +5578,7 @@ public:
UINT64 size,
UINT64 alignment,
const ALLOCATION_DESC& allocDesc,
bool committedAllowed,
size_t allocationCount,
Allocation** pAllocations);
@@ -5551,6 +5589,7 @@ public:
UINT64 alignment,
const ALLOCATION_DESC& allocDesc,
const CREATE_RESOURCE_PARAMS& createParams,
bool committedAllowed,
Allocation** ppAllocation,
REFIID riidResource,
void** ppvResource);
@@ -5601,6 +5640,7 @@ private:
UINT64 size,
UINT64 alignment,
const ALLOCATION_DESC& allocDesc,
bool committedAllowed,
Allocation** pAllocation);
HRESULT AllocateFromBlock(
@@ -5706,29 +5746,31 @@ HRESULT CurrentBudgetData::UpdateBudget(IDXGIAdapter3* adapter3, bool useMutex)
DXGI_QUERY_VIDEO_MEMORY_INFO infoLocal = {};
DXGI_QUERY_VIDEO_MEMORY_INFO infoNonLocal = {};
const HRESULT hrLocal = adapter3->QueryVideoMemoryInfo(0, DXGI_MEMORY_SEGMENT_GROUP_LOCAL, &infoLocal);
if (FAILED(hrLocal))
{
return hrLocal;
}
const HRESULT hrNonLocal = adapter3->QueryVideoMemoryInfo(0, DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL, &infoNonLocal);
if (FAILED(hrNonLocal))
{
return hrNonLocal;
}
if (SUCCEEDED(hrLocal) || SUCCEEDED(hrNonLocal))
{
MutexLockWrite lockWrite(m_BudgetMutex, useMutex);
if (SUCCEEDED(hrLocal))
{
m_D3D12Usage[0] = infoLocal.CurrentUsage;
m_D3D12Budget[0] = infoLocal.Budget;
}
if (SUCCEEDED(hrNonLocal))
{
m_D3D12Usage[1] = infoNonLocal.CurrentUsage;
m_D3D12Budget[1] = infoNonLocal.Budget;
}
m_D3D12Usage[0] = infoLocal.CurrentUsage;
m_D3D12Budget[0] = infoLocal.Budget;
m_D3D12Usage[1] = infoNonLocal.CurrentUsage;
m_D3D12Budget[1] = infoNonLocal.Budget;
m_BlockBytesAtD3D12Fetch[0] = m_BlockBytes[0];
m_BlockBytesAtD3D12Fetch[1] = m_BlockBytes[1];
m_OperationsSinceBudgetFetch = 0;
}
return FAILED(hrLocal) ? hrLocal : hrNonLocal;
return S_OK;
}
#endif // #if D3D12MA_DXGI_1_4
@@ -5847,6 +5889,7 @@ public:
AllocatorPimpl* GetAllocator() const { return m_Allocator; }
const POOL_DESC& GetDesc() const { return m_Desc; }
bool AlwaysCommitted() const { return (m_Desc.Flags & POOL_FLAG_ALWAYS_COMMITTED) != 0; }
bool SupportsCommittedAllocations() const { return m_Desc.BlockSize == 0; }
LPCWSTR GetName() const { return m_Name; }
@@ -5903,6 +5946,12 @@ public:
#endif
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
ID3D12Device8* GetDevice8() const { return m_Device8; }
#endif
#ifdef __ID3D12Device10_INTERFACE_DEFINED__
ID3D12Device10* GetDevice10() const { return m_Device10; }
#endif
#ifdef __ID3D12Device12_INTERFACE_DEFINED__
ID3D12Device12* GetDevice12() const { return m_Device12; }
#endif
// Shortcut for "Allocation Callbacks", because this function is called so often.
const ALLOCATION_CALLBACKS& GetAllocs() const { return m_AllocationCallbacks; }
@@ -6011,6 +6060,9 @@ private:
#endif
#ifdef __ID3D12Device10_INTERFACE_DEFINED__
ID3D12Device10* m_Device10 = NULL; // AddRef, optional
#endif
#ifdef __ID3D12Device12_INTERFACE_DEFINED__
ID3D12Device12* m_Device12 = NULL; // AddRef, optional
#endif
IDXGIAdapter* m_Adapter; // AddRef
#if D3D12MA_DXGI_1_4
@@ -6071,12 +6123,26 @@ private:
HRESULT UpdateD3D12Budget();
D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfoNative(const D3D12_RESOURCE_DESC& resourceDesc) const;
HRESULT GetResourceAllocationInfoMiddle(D3D12_RESOURCE_DESC& inOutResourceDesc,
UINT32 NumCastableFormats, const DXGI_FORMAT* pCastableFormats,
D3D12_RESOURCE_ALLOCATION_INFO& outAllocInfo) const;
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfoNative(const D3D12_RESOURCE_DESC1& resourceDesc) const;
D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo2Native(const D3D12_RESOURCE_DESC1& resourceDesc) const;
HRESULT GetResourceAllocationInfoMiddle(D3D12_RESOURCE_DESC1& inOutResourceDesc,
UINT32 NumCastableFormats, const DXGI_FORMAT* pCastableFormats,
D3D12_RESOURCE_ALLOCATION_INFO& outAllocInfo) const;
#endif
#ifdef __ID3D12Device12_INTERFACE_DEFINED__
D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo3Native(const D3D12_RESOURCE_DESC1& resourceDesc,
UINT32 NumCastableFormats, const DXGI_FORMAT* pCastableFormats) const;
#endif
template<typename D3D12_RESOURCE_DESC_T>
D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo(D3D12_RESOURCE_DESC_T& inOutResourceDesc) const;
HRESULT GetResourceAllocationInfo(D3D12_RESOURCE_DESC_T& inOutResourceDesc,
UINT32 NumCastableFormats, const DXGI_FORMAT* pCastableFormats,
D3D12_RESOURCE_ALLOCATION_INFO& outAllocInfo) const;
bool NewAllocationWithinBudget(D3D12_HEAP_TYPE heapType, UINT64 size);
@@ -6148,6 +6214,10 @@ HRESULT AllocatorPimpl::Init(const ALLOCATOR_DESC& desc)
m_Device->QueryInterface(D3D12MA_IID_PPV_ARGS(&m_Device10));
#endif
#ifdef __ID3D12Device12_INTERFACE_DEFINED__
m_Device->QueryInterface(D3D12MA_IID_PPV_ARGS(&m_Device12));
#endif
HRESULT hr = m_Adapter->GetDesc(&m_AdapterDesc);
if (FAILED(hr))
{
@@ -6163,9 +6233,6 @@ HRESULT AllocatorPimpl::Init(const ALLOCATOR_DESC& desc)
m_D3D12Options.ResourceHeapTier = (D3D12MA_FORCE_RESOURCE_HEAP_TIER);
#endif
// You must define this macro to like `#define D3D12MA_OPTIONS16_SUPPORTED 1` to enable GPU Upload Heaps!
// Unfortunately there is no way to programmatically check if the included <d3d12.h> defines D3D12_FEATURE_DATA_D3D12_OPTIONS16 or not.
// Main interfaces have respective macros like __ID3D12Device4_INTERFACE_DEFINED__, but structures like this do not.
#if D3D12MA_OPTIONS16_SUPPORTED
{
D3D12_FEATURE_DATA_D3D12_OPTIONS16 options16 = {};
@@ -6175,7 +6242,7 @@ HRESULT AllocatorPimpl::Init(const ALLOCATOR_DESC& desc)
m_GPUUploadHeapSupported = options16.GPUUploadHeapSupported;
}
}
#endif
#endif // #if D3D12MA_OPTIONS16_SUPPORTED
hr = m_Device->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE, &m_D3D12Architecture, sizeof(m_D3D12Architecture));
if (FAILED(hr))
@@ -6223,6 +6290,9 @@ HRESULT AllocatorPimpl::Init(const ALLOCATOR_DESC& desc)
AllocatorPimpl::~AllocatorPimpl()
{
#ifdef __ID3D12Device12_INTERFACE_DEFINED__
SAFE_RELEASE(m_Device12);
#endif
#ifdef __ID3D12Device10_INTERFACE_DEFINED__
SAFE_RELEASE(m_Device10);
#endif
@@ -6319,12 +6389,15 @@ HRESULT AllocatorPimpl::CreatePlacedResourceWrap(
{
return E_NOINTERFACE;
}
// Microsoft defined pCastableFormats parameter as pointer to non-const and only fixed it in later Agility SDK,
// thus we need const_cast.
return m_Device10->CreatePlacedResource2(pHeap, HeapOffset,
createParams.GetResourceDesc1(), createParams.GetInitialLayout(),
createParams.GetOptimizedClearValue(), createParams.GetNumCastableFormats(),
createParams.GetCastableFormats(), riidResource, ppvResource);
} else
const_cast<DXGI_FORMAT*>(createParams.GetCastableFormats()), riidResource, ppvResource);
}
#endif
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE_AND_DESC1)
{
@@ -6335,21 +6408,19 @@ HRESULT AllocatorPimpl::CreatePlacedResourceWrap(
return m_Device8->CreatePlacedResource1(pHeap, HeapOffset,
createParams.GetResourceDesc1(), createParams.GetInitialResourceState(),
createParams.GetOptimizedClearValue(), riidResource, ppvResource);
} else
}
#endif
if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE)
{
return m_Device->CreatePlacedResource(pHeap, HeapOffset,
createParams.GetResourceDesc(), createParams.GetInitialResourceState(),
createParams.GetOptimizedClearValue(), riidResource, ppvResource);
}
else
{
D3D12MA_ASSERT(0);
return E_INVALIDARG;
}
}
D3D12MA_ASSERT(0);
return E_INVALIDARG;
}
HRESULT AllocatorPimpl::CreateResource(
const ALLOCATION_DESC* pAllocDesc,
@@ -6366,6 +6437,7 @@ HRESULT AllocatorPimpl::CreateResource(
*ppvResource = NULL;
}
HRESULT hr = E_NOINTERFACE;
CREATE_RESOURCE_PARAMS finalCreateParams = createParams;
D3D12_RESOURCE_DESC finalResourceDesc;
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
@@ -6376,45 +6448,49 @@ HRESULT AllocatorPimpl::CreateResource(
{
finalResourceDesc = *createParams.GetResourceDesc();
finalCreateParams.AccessResourceDesc() = &finalResourceDesc;
resAllocInfo = GetResourceAllocationInfo(finalResourceDesc);
hr = GetResourceAllocationInfo(finalResourceDesc, 0, NULL, resAllocInfo);
}
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
else if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE_AND_DESC1)
{
if (!m_Device8)
if (m_Device8 != NULL)
{
return E_NOINTERFACE;
finalResourceDesc1 = *createParams.GetResourceDesc1();
finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1;
hr = GetResourceAllocationInfo(finalResourceDesc1, 0, NULL, resAllocInfo);
}
finalResourceDesc1 = *createParams.GetResourceDesc1();
finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1;
resAllocInfo = GetResourceAllocationInfo(finalResourceDesc1);
}
#endif
#ifdef __ID3D12Device10_INTERFACE_DEFINED__
else if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_LAYOUT)
{
if (!m_Device10)
if (m_Device10 != NULL)
{
return E_NOINTERFACE;
finalResourceDesc1 = *createParams.GetResourceDesc1();
finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1;
hr = GetResourceAllocationInfo(finalResourceDesc1,
createParams.GetNumCastableFormats(), createParams.GetCastableFormats(), resAllocInfo);
}
finalResourceDesc1 = *createParams.GetResourceDesc1();
finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1;
resAllocInfo = GetResourceAllocationInfo(finalResourceDesc1);
}
#endif
else
{
D3D12MA_ASSERT(0);
return E_INVALIDARG;
hr = E_INVALIDARG;
}
if (FAILED(hr))
return hr;
D3D12MA_ASSERT(IsPow2(resAllocInfo.Alignment));
// We've seen UINT64_MAX returned when the call to GetResourceAllocationInfo was invalid.
D3D12MA_ASSERT(resAllocInfo.SizeInBytes != UINT64_MAX);
D3D12MA_ASSERT(resAllocInfo.SizeInBytes > 0);
BlockVector* blockVector = NULL;
CommittedAllocationParameters committedAllocationParams = {};
bool preferCommitted = false;
HRESULT hr;
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
if (createParams.Variant >= CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE_AND_DESC1)
{
@@ -6445,7 +6521,7 @@ HRESULT AllocatorPimpl::CreateResource(
if (blockVector != NULL)
{
hr = blockVector->CreateResource(resAllocInfo.SizeInBytes, resAllocInfo.Alignment,
*pAllocDesc, finalCreateParams,
*pAllocDesc, finalCreateParams, committedAllocationParams.IsValid(),
ppAllocation, riidResource, ppvResource);
if (SUCCEEDED(hr))
return hr;
@@ -6488,7 +6564,7 @@ HRESULT AllocatorPimpl::AllocateMemory(
if (blockVector != NULL)
{
hr = blockVector->Allocate(pAllocInfo->SizeInBytes, pAllocInfo->Alignment,
*pAllocDesc, 1, (Allocation**)ppAllocation);
*pAllocDesc, committedAllocationParams.IsValid(), 1, (Allocation**)ppAllocation);
if (SUCCEEDED(hr))
return hr;
}
@@ -6510,6 +6586,7 @@ HRESULT AllocatorPimpl::CreateAliasingResource(
{
*ppvResource = NULL;
HRESULT hr = E_NOINTERFACE;
CREATE_RESOURCE_PARAMS finalCreateParams = createParams;
D3D12_RESOURCE_DESC finalResourceDesc;
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
@@ -6520,37 +6597,40 @@ HRESULT AllocatorPimpl::CreateAliasingResource(
{
finalResourceDesc = *createParams.GetResourceDesc();
finalCreateParams.AccessResourceDesc() = &finalResourceDesc;
resAllocInfo = GetResourceAllocationInfo(finalResourceDesc);
hr = GetResourceAllocationInfo(finalResourceDesc, 0, NULL, resAllocInfo);
}
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
else if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE_AND_DESC1)
{
if (!m_Device8)
if (m_Device8 != NULL)
{
return E_NOINTERFACE;
finalResourceDesc1 = *createParams.GetResourceDesc1();
finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1;
hr = GetResourceAllocationInfo(finalResourceDesc1, 0, NULL, resAllocInfo);
}
finalResourceDesc1 = *createParams.GetResourceDesc1();
finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1;
resAllocInfo = GetResourceAllocationInfo(finalResourceDesc1);
}
#endif
#ifdef __ID3D12Device10_INTERFACE_DEFINED__
else if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_LAYOUT)
{
if (!m_Device10)
if (m_Device10 != NULL)
{
return E_NOINTERFACE;
finalResourceDesc1 = *createParams.GetResourceDesc1();
finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1;
hr = GetResourceAllocationInfo(finalResourceDesc1,
createParams.GetNumCastableFormats(), createParams.GetCastableFormats(), resAllocInfo);
}
finalResourceDesc1 = *createParams.GetResourceDesc1();
finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1;
resAllocInfo = GetResourceAllocationInfo(finalResourceDesc1);
}
#endif
else
{
D3D12MA_ASSERT(0);
return E_INVALIDARG;
hr = E_INVALIDARG;
}
if (FAILED(hr))
return hr;
D3D12MA_ASSERT(IsPow2(resAllocInfo.Alignment));
D3D12MA_ASSERT(resAllocInfo.SizeInBytes > 0);
@@ -6773,42 +6853,41 @@ void AllocatorPimpl::GetBudget(Budget* outLocalBudget, Budget* outNonLocalBudget
outLocalBudget ? &outLocalBudget->BudgetBytes : NULL,
outNonLocalBudget ? &outNonLocalBudget->UsageBytes : NULL,
outNonLocalBudget ? &outNonLocalBudget->BudgetBytes : NULL);
return;
}
else
if (SUCCEEDED(UpdateD3D12Budget()))
{
UpdateD3D12Budget();
GetBudget(outLocalBudget, outNonLocalBudget); // Recursion
GetBudget(outLocalBudget, outNonLocalBudget); // Recursion.
return;
}
}
else
#endif
// Fallback path - manual calculation, not real budget.
if (outLocalBudget)
{
if (outLocalBudget)
{
outLocalBudget->UsageBytes = outLocalBudget->Stats.BlockBytes;
outLocalBudget->BudgetBytes = GetMemoryCapacity(DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY) * 8 / 10; // 80% heuristics.
}
if (outNonLocalBudget)
{
outNonLocalBudget->UsageBytes = outNonLocalBudget->Stats.BlockBytes;
outNonLocalBudget->BudgetBytes = GetMemoryCapacity(DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY) * 8 / 10; // 80% heuristics.
}
outLocalBudget->UsageBytes = outLocalBudget->Stats.BlockBytes;
outLocalBudget->BudgetBytes = GetMemoryCapacity(DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY) * 8 / 10; // 80% heuristics.
}
if (outNonLocalBudget)
{
outNonLocalBudget->UsageBytes = outNonLocalBudget->Stats.BlockBytes;
outNonLocalBudget->BudgetBytes = GetMemoryCapacity(DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY) * 8 / 10; // 80% heuristics.
}
}
void AllocatorPimpl::GetBudgetForHeapType(Budget& outBudget, D3D12_HEAP_TYPE heapType)
{
switch (heapType)
const bool isLocal = StandardHeapTypeToMemorySegmentGroup(heapType) ==
DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY;
if (isLocal)
{
case D3D12_HEAP_TYPE_DEFAULT:
case D3D12_HEAP_TYPE_GPU_UPLOAD_COPY:
GetBudget(&outBudget, NULL);
break;
case D3D12_HEAP_TYPE_UPLOAD:
case D3D12_HEAP_TYPE_READBACK:
}
else
{
GetBudget(NULL, &outBudget);
break;
default: D3D12MA_ASSERT(0);
}
}
@@ -7248,12 +7327,15 @@ HRESULT AllocatorPimpl::AllocateCommittedResource(
{
return E_NOINTERFACE;
}
// Microsoft defined pCastableFormats parameter as pointer to non-const and only fixed it in later Agility SDK,
// thus we need const_cast.
hr = m_Device10->CreateCommittedResource3(
&committedAllocParams.m_HeapProperties,
committedAllocParams.m_HeapFlags & ~RESOURCE_CLASS_HEAP_FLAGS,
createParams.GetResourceDesc1(), createParams.GetInitialLayout(),
createParams.GetOptimizedClearValue(), committedAllocParams.m_ProtectedSession,
createParams.GetNumCastableFormats(), createParams.GetCastableFormats(),
createParams.GetNumCastableFormats(), const_cast<DXGI_FORMAT*>(createParams.GetCastableFormats()),
D3D12MA_IID_PPV_ARGS(&res));
} else
#endif
@@ -7396,8 +7478,8 @@ HRESULT AllocatorPimpl::CalcAllocationParams(const ALLOCATION_DESC& allocDesc, U
outCommittedAllocationParams = CommittedAllocationParameters();
outPreferCommitted = false;
D3D12MA_ASSERT((allocDesc.HeapType != D3D12_HEAP_TYPE_GPU_UPLOAD_COPY || IsGPUUploadHeapSupported()) &&
"Trying to allocate from D3D12_HEAP_TYPE_GPU_UPLOAD while GPUUploadHeapSupported == FALSE or D3D12MA_OPTIONS16_SUPPORTED macro was not defined when compiling D3D12MA library.");
if (allocDesc.HeapType == D3D12_HEAP_TYPE_GPU_UPLOAD_COPY && !IsGPUUploadHeapSupported())
return E_NOTIMPL;
bool msaaAlwaysCommitted;
if (allocDesc.CustomPool != NULL)
@@ -7405,7 +7487,8 @@ HRESULT AllocatorPimpl::CalcAllocationParams(const ALLOCATION_DESC& allocDesc, U
PoolPimpl* const pool = allocDesc.CustomPool->m_Pimpl;
msaaAlwaysCommitted = pool->GetBlockVector()->DeniesMsaaTextures();
outBlockVector = pool->GetBlockVector();
if(!pool->AlwaysCommitted())
outBlockVector = pool->GetBlockVector();
const auto& desc = pool->GetDesc();
outCommittedAllocationParams.m_ProtectedSession = desc.pProtectedSession;
@@ -7444,12 +7527,6 @@ HRESULT AllocatorPimpl::CalcAllocationParams(const ALLOCATION_DESC& allocDesc, U
outPreferCommitted = true;
}
}
const D3D12_HEAP_FLAGS extraHeapFlags = allocDesc.ExtraHeapFlags & ~RESOURCE_CLASS_HEAP_FLAGS;
if (outBlockVector != NULL && extraHeapFlags != 0)
{
outBlockVector = NULL;
}
}
if ((allocDesc.Flags & ALLOCATION_FLAG_COMMITTED) != 0 ||
@@ -7479,12 +7556,7 @@ UINT AllocatorPimpl::CalcDefaultPoolIndex(const ALLOCATION_DESC& allocDesc, Reso
D3D12_HEAP_FLAGS extraHeapFlags = allocDesc.ExtraHeapFlags & ~RESOURCE_CLASS_HEAP_FLAGS;
#if D3D12MA_CREATE_NOT_ZEROED_AVAILABLE
// If allocator was created with ALLOCATOR_FLAG_DEFAULT_POOLS_NOT_ZEROED, also ignore
// D3D12_HEAP_FLAG_CREATE_NOT_ZEROED.
if(m_DefaultPoolsNotZeroed)
{
extraHeapFlags &= ~D3D12_HEAP_FLAG_CREATE_NOT_ZEROED;
}
extraHeapFlags &= ~D3D12_HEAP_FLAG_CREATE_NOT_ZEROED;
#endif
if (extraHeapFlags != 0)
@@ -7603,7 +7675,7 @@ D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(c
}
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(const D3D12_RESOURCE_DESC1& resourceDesc) const
D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfo2Native(const D3D12_RESOURCE_DESC1& resourceDesc) const
{
D3D12MA_ASSERT(m_Device8 != NULL);
D3D12_RESOURCE_ALLOCATION_INFO1 info1Unused;
@@ -7619,8 +7691,71 @@ D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(c
}
#endif // #ifdef __ID3D12Device8_INTERFACE_DEFINED__
#ifdef __ID3D12Device12_INTERFACE_DEFINED__
D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfo3Native(const D3D12_RESOURCE_DESC1& resourceDesc,
UINT32 NumCastableFormats, const DXGI_FORMAT* pCastableFormats) const
{
D3D12MA_ASSERT(m_Device12 != NULL);
D3D12_RESOURCE_ALLOCATION_INFO1 info1Unused;
// This is how new D3D12 headers define GetResourceAllocationInfo function -
// different signature depending on these macros.
#if defined(_MSC_VER) || !defined(_WIN32)
return m_Device12->GetResourceAllocationInfo3(0, 1, &resourceDesc,
&NumCastableFormats, &pCastableFormats, &info1Unused);
#else
D3D12_RESOURCE_ALLOCATION_INFO retVal;
return *m_Device12->GetResourceAllocationInfo3(&retVal, 0, 1, &resourceDesc,
&NumCastableFormats, &pCastableFormats, &info1Unused);
#endif
}
#endif // #ifdef __ID3D12Device12_INTERFACE_DEFINED__
HRESULT AllocatorPimpl::GetResourceAllocationInfoMiddle(
D3D12_RESOURCE_DESC& inOutResourceDesc,
UINT32 NumCastableFormats, const DXGI_FORMAT* pCastableFormats,
D3D12_RESOURCE_ALLOCATION_INFO& outAllocInfo) const
{
if (NumCastableFormats > 0)
{
return E_NOTIMPL;
}
outAllocInfo = GetResourceAllocationInfoNative(inOutResourceDesc);
return outAllocInfo.SizeInBytes != UINT64_MAX ? S_OK : E_INVALIDARG;
}
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
HRESULT AllocatorPimpl::GetResourceAllocationInfoMiddle(
D3D12_RESOURCE_DESC1& inOutResourceDesc,
UINT32 NumCastableFormats, const DXGI_FORMAT* pCastableFormats,
D3D12_RESOURCE_ALLOCATION_INFO& outAllocInfo) const
{
if (NumCastableFormats > 0)
{
#ifdef __ID3D12Device12_INTERFACE_DEFINED__
if (m_Device12 != NULL)
{
outAllocInfo = GetResourceAllocationInfo3Native(inOutResourceDesc, NumCastableFormats, pCastableFormats);
return outAllocInfo.SizeInBytes != UINT64_MAX ? S_OK : E_INVALIDARG;
}
#else
return E_NOTIMPL;
#endif
}
outAllocInfo = GetResourceAllocationInfo2Native(inOutResourceDesc);
return outAllocInfo.SizeInBytes != UINT64_MAX ? S_OK : E_INVALIDARG;
}
#endif // #ifdef __ID3D12Device8_INTERFACE_DEFINED__
template<typename D3D12_RESOURCE_DESC_T>
D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfo(D3D12_RESOURCE_DESC_T& inOutResourceDesc) const
HRESULT AllocatorPimpl::GetResourceAllocationInfo(
D3D12_RESOURCE_DESC_T& inOutResourceDesc,
UINT32 NumCastableFormats, const DXGI_FORMAT* pCastableFormats,
D3D12_RESOURCE_ALLOCATION_INFO& outAllocInfo) const
{
#ifdef __ID3D12Device1_INTERFACE_DEFINED__
/* Optional optimization: Microsoft documentation says:
@@ -7634,12 +7769,15 @@ D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfo(D3D12_R
if (inOutResourceDesc.Alignment == 0 &&
inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
{
return {
outAllocInfo = {
AlignUp<UINT64>(inOutResourceDesc.Width, D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT), // SizeInBytes
D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT }; // Alignment
return S_OK;
}
#endif // #ifdef __ID3D12Device1_INTERFACE_DEFINED__
HRESULT hr = S_OK;
#if D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT
if (inOutResourceDesc.Alignment == 0 &&
inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D &&
@@ -7657,17 +7795,19 @@ D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfo(D3D12_R
D3D12_SMALL_MSAA_RESOURCE_PLACEMENT_ALIGNMENT :
D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT;
inOutResourceDesc.Alignment = smallAlignmentToTry;
const D3D12_RESOURCE_ALLOCATION_INFO smallAllocInfo = GetResourceAllocationInfoNative(inOutResourceDesc);
hr = GetResourceAllocationInfoMiddle(
inOutResourceDesc, NumCastableFormats, pCastableFormats, outAllocInfo);
// Check if alignment requested has been granted.
if (smallAllocInfo.Alignment == smallAlignmentToTry)
if (SUCCEEDED(hr) && outAllocInfo.Alignment == smallAlignmentToTry)
{
return smallAllocInfo;
return S_OK;
}
inOutResourceDesc.Alignment = 0; // Restore original
}
#endif // #if D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT
return GetResourceAllocationInfoNative(inOutResourceDesc);
return GetResourceAllocationInfoMiddle(
inOutResourceDesc, NumCastableFormats, pCastableFormats, outAllocInfo);
}
bool AllocatorPimpl::NewAllocationWithinBudget(D3D12_HEAP_TYPE heapType, UINT64 size)
@@ -7988,6 +8128,7 @@ HRESULT BlockVector::Allocate(
UINT64 size,
UINT64 alignment,
const ALLOCATION_DESC& allocDesc,
bool committedAllowed,
size_t allocationCount,
Allocation** pAllocations)
{
@@ -8002,6 +8143,7 @@ HRESULT BlockVector::Allocate(
size,
alignment,
allocDesc,
committedAllowed,
pAllocations + allocIndex);
if (FAILED(hr))
{
@@ -8090,40 +8232,43 @@ HRESULT BlockVector::CreateResource(
UINT64 alignment,
const ALLOCATION_DESC& allocDesc,
const CREATE_RESOURCE_PARAMS& createParams,
bool committedAllowed,
Allocation** ppAllocation,
REFIID riidResource,
void** ppvResource)
{
HRESULT hr = Allocate(size, alignment, allocDesc, 1, ppAllocation);
HRESULT hr = Allocate(size, alignment, allocDesc, committedAllowed, 1, ppAllocation);
if (FAILED(hr))
{
return hr;
}
ID3D12Resource* res = NULL;
hr = m_hAllocator->CreatePlacedResourceWrap(
(*ppAllocation)->m_Placed.block->GetHeap(),
(*ppAllocation)->GetOffset(),
createParams,
D3D12MA_IID_PPV_ARGS(&res));
if (SUCCEEDED(hr))
{
ID3D12Resource* res = NULL;
hr = m_hAllocator->CreatePlacedResourceWrap(
(*ppAllocation)->m_Placed.block->GetHeap(),
(*ppAllocation)->GetOffset(),
createParams,
D3D12MA_IID_PPV_ARGS(&res));
if (ppvResource != NULL)
{
hr = res->QueryInterface(riidResource, ppvResource);
}
if (SUCCEEDED(hr))
{
if (ppvResource != NULL)
{
hr = res->QueryInterface(riidResource, ppvResource);
}
if (SUCCEEDED(hr))
{
(*ppAllocation)->SetResourcePointer(res, createParams.GetBaseResourceDesc());
}
else
{
res->Release();
SAFE_RELEASE(*ppAllocation);
}
(*ppAllocation)->SetResourcePointer(res, createParams.GetBaseResourceDesc());
}
else
{
res->Release();
SAFE_RELEASE(*ppAllocation);
}
}
else
{
SAFE_RELEASE(*ppAllocation);
}
return hr;
}
@@ -8241,6 +8386,7 @@ HRESULT BlockVector::AllocatePage(
UINT64 size,
UINT64 alignment,
const ALLOCATION_DESC& allocDesc,
bool committedAllowed,
Allocation** pAllocation)
{
// Early reject: requested allocation size is larger that maximum block size for this block vector.
@@ -8257,13 +8403,19 @@ HRESULT BlockVector::AllocatePage(
freeMemory = (budget.UsageBytes < budget.BudgetBytes) ? (budget.BudgetBytes - budget.UsageBytes) : 0;
}
const bool canCreateNewBlock =
const bool canExceedFreeMemory = !committedAllowed;
bool canCreateNewBlock =
((allocDesc.Flags & ALLOCATION_FLAG_NEVER_ALLOCATE) == 0) &&
(m_Blocks.size() < m_MaxBlockCount) &&
// Even if we don't have to stay within budget with this allocation, when the
// budget would be exceeded, we don't want to allocate new blocks, but always
// create resources as committed.
freeMemory >= size;
(m_Blocks.size() < m_MaxBlockCount);
// Even if we don't have to stay within budget with this allocation, when the
// budget would be exceeded, we don't want to allocate new blocks, but always
// create resources as committed.
if (freeMemory < size && !canExceedFreeMemory)
{
canCreateNewBlock = false;
}
// 1. Search existing allocations
{
@@ -8313,26 +8465,29 @@ HRESULT BlockVector::AllocatePage(
}
}
size_t newBlockIndex = 0;
HRESULT hr = newBlockSize <= freeMemory ?
CreateBlock(newBlockSize, &newBlockIndex) : E_OUTOFMEMORY;
size_t newBlockIndex = SIZE_MAX;
HRESULT hr = E_OUTOFMEMORY;
if (newBlockSize <= freeMemory || canExceedFreeMemory)
{
hr = CreateBlock(newBlockSize, &newBlockIndex);
}
// Allocation of this size failed? Try 1/2, 1/4, 1/8 of m_PreferredBlockSize.
if (!m_ExplicitBlockSize)
{
while (FAILED(hr) && newBlockSizeShift < NEW_BLOCK_SIZE_SHIFT_MAX)
{
const UINT64 smallerNewBlockSize = newBlockSize / 2;
if (smallerNewBlockSize >= size)
{
newBlockSize = smallerNewBlockSize;
++newBlockSizeShift;
hr = newBlockSize <= freeMemory ?
CreateBlock(newBlockSize, &newBlockIndex) : E_OUTOFMEMORY;
}
else
if (smallerNewBlockSize < size)
{
break;
}
newBlockSize = smallerNewBlockSize;
++newBlockSizeShift;
if (newBlockSize <= freeMemory || canExceedFreeMemory)
{
hr = CreateBlock(newBlockSize, &newBlockIndex);
}
}
}
@@ -9509,6 +9664,8 @@ HRESULT Pool::BeginDefragmentation(const DEFRAGMENTATION_DESC* pDesc, Defragment
// Check for support
if (m_Pimpl->GetBlockVector()->GetAlgorithm() & POOL_FLAG_ALGORITHM_LINEAR)
return E_NOINTERFACE;
if(m_Pimpl->AlwaysCommitted())
return E_NOINTERFACE;
AllocatorPimpl* allocator = m_Pimpl->GetAllocator();
*ppContext = D3D12MA_NEW(allocator->GetAllocs(), DefragmentationContext)(allocator, *pDesc, m_Pimpl->GetBlockVector());
@@ -9612,7 +9769,7 @@ HRESULT Allocator::CreateResource3(
D3D12_BARRIER_LAYOUT InitialLayout,
const D3D12_CLEAR_VALUE* pOptimizedClearValue,
UINT32 NumCastableFormats,
DXGI_FORMAT* pCastableFormats,
const DXGI_FORMAT* pCastableFormats,
Allocation** ppAllocation,
REFIID riidResource,
void** ppvResource)
@@ -9702,7 +9859,7 @@ HRESULT Allocator::CreateAliasingResource2(
D3D12_BARRIER_LAYOUT InitialLayout,
const D3D12_CLEAR_VALUE* pOptimizedClearValue,
UINT32 NumCastableFormats,
DXGI_FORMAT* pCastableFormats,
const DXGI_FORMAT* pCastableFormats,
REFIID riidResource,
void** ppvResource)
{
@@ -9732,6 +9889,12 @@ HRESULT Allocator::CreatePool(
D3D12MA_ASSERT(0 && "Invalid arguments passed to Allocator::CreatePool.");
return E_INVALIDARG;
}
if ((pPoolDesc->Flags & POOL_FLAG_ALWAYS_COMMITTED) != 0 &&
(pPoolDesc->BlockSize != 0 || pPoolDesc->MinBlockCount > 0))
{
D3D12MA_ASSERT(0 && "Invalid arguments passed to Allocator::CreatePool while POOL_FLAG_ALWAYS_COMMITTED is specified.");
return E_INVALIDARG;
}
if (!m_Pimpl->HeapFlagsFulfillResourceHeapTier(pPoolDesc->HeapFlags))
{
D3D12MA_ASSERT(0 && "Invalid pPoolDesc->HeapFlags passed to Allocator::CreatePool. Did you forget to handle ResourceHeapTier=1?");

View File

@@ -15,8 +15,8 @@
<body class="normal">
<hr>
<h1>SoundTouch audio processing library v2.3.3</h1>
<p class="normal">SoundTouch library Copyright &copy; Olli Parviainen 2001-2024</p>
<h1>SoundTouch audio processing library v2.4.0</h1>
<p class="normal">SoundTouch library Copyright &copy; Olli Parviainen 2001-2025</p>
<hr>
<h2>1. Introduction </h2>
<p>SoundTouch is an open-source audio processing library that allows
@@ -81,8 +81,8 @@
<p>The SoundTouch library compiles in practically any platform
supporting GNU compiler (GCC) tools.
<h4>2.2.1 Compiling with autotools</h4>
<p>To install build prerequisites for 'autotools' tool chain:</p>
<pre> sudo apt-get install automake autoconf libtool build-essential</pre>
<p>To install build prerequisites for 'autotools' tool chain (for Ubuntu/Debian. Use dnf/yum/etc in other distros):</p>
<pre> sudo apt install -y automake autoconf libtool build-essential</pre>
<p>To build and install the binaries, run the following commands in
/soundtouch directory:</p>
<table border="0" cellpadding="0" cellspacing="4">
@@ -140,8 +140,8 @@
<h4><b>2.2.2 Compiling with cmake</b></h4>
<p>'cmake' build scripts are provided as an alternative to the autotools toolchain.</p>
<p>To install cmake build prerequisites:</p>
<pre> sudo apt-get install libtool build-essential cmake</pre>
<p>To install cmake build prerequisites (for Ubuntu/Debian. Use dnf/yum/etc in other distros):</p>
<pre> sudo apt install -y libtool build-essential cmake</pre>
<p>To build:</p>
<pre>
cmake .
@@ -205,7 +205,7 @@
separate mono channels, this isn't recommended because processing the
channels separately would result in losing the phase coherency between
the channels, which consequently would ruin the stereo effect.</p>
<p>Sample rates between 8000-48000H are supported.</p>
<p>Sample rates between 8000-48000Hz are supported.</p>
<h3>3.2. Processing latency</h3>
<p>The processing and latency constraints of the SoundTouch library are:</p>
<ul>
@@ -606,10 +606,17 @@
<pre>soundstretch original.wav output.wav -pitch=-0.318</pre>
</blockquote>
<hr>
<h2>5. Change History</h2>
<a name="changehistory"><h2>5. Change History</h2></a>
<h3>5.1. SoundTouch library Change History </h3>
<p><b>2.3.3:</b></p>
<p><b>2.4.0:</b></p>
<ul class="current">
<li>Set CMake minimum version to 3.5 to avoid deprecation warning</li>
<li>Increase max nr. of channels from 16 to 32</li>
<li>Don't use `pow()` when using integer precision samples</li>
<li>Replace `-Ofast` that's being deprecated in some compilers, by `-O3 -ffast-math`</li>
</ul>
<p><b>2.3.3:</b></p>
<ul>
<li>Fixing compiler warnings, maintenance fixes to make/build files for various systems
</li>
</ul>
@@ -881,9 +888,14 @@
<ul>
<li> Initial release</li>
</ul>
<br><br>
<h3>5.2. SoundStretch application Change History </h3>
<p><b>2.3.3:</b></p>
<p><b>2.4.0:</b></p>
<ul class="current_soundstretch">
<li>parse command-line argument values with double float precision.</li>
</ul>
<p><b>2.3.3:</b></p>
<ul>
<li>Added support for Asian / non-latin filenames in Windows. Gnu platform has supported them already earlier.</li>
</ul>
<p><b>1.9:</b></p>

View File

@@ -56,8 +56,9 @@ typedef unsigned long ulong;
namespace soundtouch
{
/// Max allowed number of channels
#define SOUNDTOUCH_MAX_CHANNELS 16
/// Max allowed number of channels. This is not a hard limit but to have some
/// maximum value for argument sanity checks -- can be increased if necessary
#define SOUNDTOUCH_MAX_CHANNELS 32
/// Activate these undef's to overrule the possible sampletype
/// setting inherited from some other header file:

View File

@@ -72,10 +72,10 @@ namespace soundtouch
{
/// Soundtouch library version string
#define SOUNDTOUCH_VERSION "2.3.3"
#define SOUNDTOUCH_VERSION "2.4.0"
/// SoundTouch library version id
#define SOUNDTOUCH_VERSION_ID (20303)
#define SOUNDTOUCH_VERSION_ID (20400)
//
// Available setting IDs for the 'setSetting' & 'get_setting' functions:

View File

@@ -301,7 +301,7 @@ void BPMDetect::updateXCorr(int process_samples)
pBuffer = buffer->ptrBegin();
// calculate decay factor for xcorr filtering
float xcorr_decay = (float)pow(0.5, 1.0 / (XCORR_DECAY_TIME_CONSTANT * TARGET_SRATE / process_samples));
float xcorr_decay = (float)pow(0.5, process_samples / (XCORR_DECAY_TIME_CONSTANT * TARGET_SRATE));
// prescale pbuffer
float tmp[XCORR_UPDATE_SEQUENCE];

View File

@@ -56,7 +56,6 @@ using namespace soundtouch;
FIRFilter::FIRFilter()
{
resultDivFactor = 0;
resultDivider = 0;
length = 0;
lengthDiv8 = 0;
filterCoeffs = nullptr;
@@ -79,7 +78,7 @@ uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, ui
uint ilength = length & -8;
assert((length != 0) && (length == ilength) && (src != nullptr) && (dest != nullptr) && (filterCoeffs != nullptr));
assert(numSamples > ilength);
assert(numSamples >= ilength);
end = 2 * (numSamples - ilength);
@@ -155,7 +154,7 @@ uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uin
assert(src != nullptr);
assert(dest != nullptr);
assert(filterCoeffs != nullptr);
assert(numChannels < 16);
assert(numChannels <= SOUNDTOUCH_MAX_CHANNELS);
// hint compiler autovectorization that loop length is divisible by 8
int ilength = length & -8;
@@ -207,24 +206,24 @@ void FIRFilter::setCoefficients(const SAMPLETYPE *coeffs, uint newLength, uint u
assert(newLength > 0);
if (newLength % 8) ST_THROW_RT_ERROR("FIR filter length not divisible by 8");
#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// scale coefficients already here if using floating samples
double scale = 1.0 / resultDivider;
#else
short scale = 1;
#endif
lengthDiv8 = newLength / 8;
length = lengthDiv8 * 8;
assert(length == newLength);
resultDivFactor = uResultDivFactor;
resultDivider = (SAMPLETYPE)::pow(2.0, (int)resultDivFactor);
delete[] filterCoeffs;
filterCoeffs = new SAMPLETYPE[length];
delete[] filterCoeffsStereo;
filterCoeffsStereo = new SAMPLETYPE[length*2];
#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// scale coefficients already here if using floating samples
const double scale = ::pow(0.5, (int)resultDivFactor);;
#else
const short scale = 1;
#endif
for (uint i = 0; i < length; i ++)
{
filterCoeffs[i] = (SAMPLETYPE)(coeffs[i] * scale);

View File

@@ -52,9 +52,6 @@ protected:
// Result divider factor in 2^k format
uint resultDivFactor;
// Result divider value.
SAMPLETYPE resultDivider;
// Memory for filter coefficients
SAMPLETYPE *filterCoeffs;
SAMPLETYPE *filterCoeffsStereo;

View File

@@ -211,9 +211,6 @@ FIRFilterSSE::~FIRFilterSSE()
// (overloaded) Calculates filter coefficients for SSE routine
void FIRFilterSSE::setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor)
{
uint i;
float fDivider;
FIRFilter::setCoefficients(coeffs, newLength, uResultDivFactor);
// Scale the filter coefficients so that it won't be necessary to scale the filtering result
@@ -223,13 +220,13 @@ void FIRFilterSSE::setCoefficients(const float *coeffs, uint newLength, uint uRe
filterCoeffsUnalign = new float[2 * newLength + 4];
filterCoeffsAlign = (float *)SOUNDTOUCH_ALIGN_POINTER_16(filterCoeffsUnalign);
fDivider = (float)resultDivider;
const float scale = ::pow(0.5, (int)resultDivFactor);
// rearrange the filter coefficients for mmx routines
for (i = 0; i < newLength; i ++)
// rearrange the filter coefficients for sse routines
for (auto i = 0U; i < newLength; i ++)
{
filterCoeffsAlign[2 * i + 0] =
filterCoeffsAlign[2 * i + 1] = coeffs[i + 0] / fDivider;
filterCoeffsAlign[2 * i + 1] = coeffs[i] * scale;
}
}

View File

@@ -1,3 +1,24 @@
# 3.3.0 (2025-05-12)
Additions to the library API:
- Added function `vmaImportVulkanFunctionsFromVolk`, useful for loading pointers to Vulkan functions with [volk library](https://github.com/zeux/volk).
Other changes:
- Added macro `VMA_DEBUG_DONT_EXCEED_HEAP_SIZE_WITH_ALLOCATION_SIZE` with default value 1.
- Changed macro `VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT` default value from 0 to 1.
- Added documentation chapter "Frequenty asked questions".
- Other fixes and improvements, including compatibility with various platforms and compilers.
# 3.2.1 (2025-02-05)
Changes:
- Fixed an assert in `vmaCreateAllocator` function incorrectly failing when Vulkan version 1.4 is used (#457).
- Fix for importing function `vkGetPhysicalDeviceMemoryProperties2` / `vkGetPhysicalDeviceMemoryProperties2KHR` when `VMA_DYNAMIC_VULKAN_FUNCTIONS` macro is enabled (#410).
- Other minor fixes and improvements...
# 3.2.0 (2024-12-30)
Additions to the library API:

View File

@@ -10,11 +10,6 @@ Easy to integrate Vulkan memory allocation library.
**Product page:** [Vulkan Memory Allocator on GPUOpen](https://gpuopen.com/gaming-product/vulkan-memory-allocator/)
**Build status:**
- Windows: [![Build status](https://ci.appveyor.com/api/projects/status/4vlcrb0emkaio2pn/branch/master?svg=true)](https://ci.appveyor.com/project/adam-sawicki-amd/vulkanmemoryallocator/branch/master)
- Linux: [![Build Status](https://app.travis-ci.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.svg?branch=master)](https://app.travis-ci.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.svg)](http://isitmaintained.com/project/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator "Average time to resolve an issue")
# Problem

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_AV1STD_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_AV1STD_DECODE_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_AV1STD_ENCODE_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H264STD_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H265STD_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@@ -0,0 +1,151 @@
#ifndef VULKAN_VIDEO_CODEC_VP9STD_H_
#define VULKAN_VIDEO_CODEC_VP9STD_H_ 1
/*
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
// vulkan_video_codec_vp9std is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_vp9std 1
#include "vulkan_video_codecs_common.h"
#define STD_VIDEO_VP9_NUM_REF_FRAMES 8
#define STD_VIDEO_VP9_REFS_PER_FRAME 3
#define STD_VIDEO_VP9_MAX_REF_FRAMES 4
#define STD_VIDEO_VP9_LOOP_FILTER_ADJUSTMENTS 2
#define STD_VIDEO_VP9_MAX_SEGMENTS 8
#define STD_VIDEO_VP9_SEG_LVL_MAX 4
#define STD_VIDEO_VP9_MAX_SEGMENTATION_TREE_PROBS 7
#define STD_VIDEO_VP9_MAX_SEGMENTATION_PRED_PROB 3
typedef enum StdVideoVP9Profile {
STD_VIDEO_VP9_PROFILE_0 = 0,
STD_VIDEO_VP9_PROFILE_1 = 1,
STD_VIDEO_VP9_PROFILE_2 = 2,
STD_VIDEO_VP9_PROFILE_3 = 3,
STD_VIDEO_VP9_PROFILE_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_PROFILE_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9Profile;
typedef enum StdVideoVP9Level {
STD_VIDEO_VP9_LEVEL_1_0 = 0,
STD_VIDEO_VP9_LEVEL_1_1 = 1,
STD_VIDEO_VP9_LEVEL_2_0 = 2,
STD_VIDEO_VP9_LEVEL_2_1 = 3,
STD_VIDEO_VP9_LEVEL_3_0 = 4,
STD_VIDEO_VP9_LEVEL_3_1 = 5,
STD_VIDEO_VP9_LEVEL_4_0 = 6,
STD_VIDEO_VP9_LEVEL_4_1 = 7,
STD_VIDEO_VP9_LEVEL_5_0 = 8,
STD_VIDEO_VP9_LEVEL_5_1 = 9,
STD_VIDEO_VP9_LEVEL_5_2 = 10,
STD_VIDEO_VP9_LEVEL_6_0 = 11,
STD_VIDEO_VP9_LEVEL_6_1 = 12,
STD_VIDEO_VP9_LEVEL_6_2 = 13,
STD_VIDEO_VP9_LEVEL_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_LEVEL_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9Level;
typedef enum StdVideoVP9FrameType {
STD_VIDEO_VP9_FRAME_TYPE_KEY = 0,
STD_VIDEO_VP9_FRAME_TYPE_NON_KEY = 1,
STD_VIDEO_VP9_FRAME_TYPE_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_FRAME_TYPE_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9FrameType;
typedef enum StdVideoVP9ReferenceName {
STD_VIDEO_VP9_REFERENCE_NAME_INTRA_FRAME = 0,
STD_VIDEO_VP9_REFERENCE_NAME_LAST_FRAME = 1,
STD_VIDEO_VP9_REFERENCE_NAME_GOLDEN_FRAME = 2,
STD_VIDEO_VP9_REFERENCE_NAME_ALTREF_FRAME = 3,
STD_VIDEO_VP9_REFERENCE_NAME_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_REFERENCE_NAME_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9ReferenceName;
typedef enum StdVideoVP9InterpolationFilter {
STD_VIDEO_VP9_INTERPOLATION_FILTER_EIGHTTAP = 0,
STD_VIDEO_VP9_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH = 1,
STD_VIDEO_VP9_INTERPOLATION_FILTER_EIGHTTAP_SHARP = 2,
STD_VIDEO_VP9_INTERPOLATION_FILTER_BILINEAR = 3,
STD_VIDEO_VP9_INTERPOLATION_FILTER_SWITCHABLE = 4,
STD_VIDEO_VP9_INTERPOLATION_FILTER_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_INTERPOLATION_FILTER_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9InterpolationFilter;
typedef enum StdVideoVP9ColorSpace {
STD_VIDEO_VP9_COLOR_SPACE_UNKNOWN = 0,
STD_VIDEO_VP9_COLOR_SPACE_BT_601 = 1,
STD_VIDEO_VP9_COLOR_SPACE_BT_709 = 2,
STD_VIDEO_VP9_COLOR_SPACE_SMPTE_170 = 3,
STD_VIDEO_VP9_COLOR_SPACE_SMPTE_240 = 4,
STD_VIDEO_VP9_COLOR_SPACE_BT_2020 = 5,
STD_VIDEO_VP9_COLOR_SPACE_RESERVED = 6,
STD_VIDEO_VP9_COLOR_SPACE_RGB = 7,
STD_VIDEO_VP9_COLOR_SPACE_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_COLOR_SPACE_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9ColorSpace;
typedef struct StdVideoVP9ColorConfigFlags {
uint32_t color_range : 1;
uint32_t reserved : 31;
} StdVideoVP9ColorConfigFlags;
typedef struct StdVideoVP9ColorConfig {
StdVideoVP9ColorConfigFlags flags;
uint8_t BitDepth;
uint8_t subsampling_x;
uint8_t subsampling_y;
uint8_t reserved1;
StdVideoVP9ColorSpace color_space;
} StdVideoVP9ColorConfig;
typedef struct StdVideoVP9LoopFilterFlags {
uint32_t loop_filter_delta_enabled : 1;
uint32_t loop_filter_delta_update : 1;
uint32_t reserved : 30;
} StdVideoVP9LoopFilterFlags;
typedef struct StdVideoVP9LoopFilter {
StdVideoVP9LoopFilterFlags flags;
uint8_t loop_filter_level;
uint8_t loop_filter_sharpness;
uint8_t update_ref_delta;
int8_t loop_filter_ref_deltas[STD_VIDEO_VP9_MAX_REF_FRAMES];
uint8_t update_mode_delta;
int8_t loop_filter_mode_deltas[STD_VIDEO_VP9_LOOP_FILTER_ADJUSTMENTS];
} StdVideoVP9LoopFilter;
typedef struct StdVideoVP9SegmentationFlags {
uint32_t segmentation_update_map : 1;
uint32_t segmentation_temporal_update : 1;
uint32_t segmentation_update_data : 1;
uint32_t segmentation_abs_or_delta_update : 1;
uint32_t reserved : 28;
} StdVideoVP9SegmentationFlags;
typedef struct StdVideoVP9Segmentation {
StdVideoVP9SegmentationFlags flags;
uint8_t segmentation_tree_probs[STD_VIDEO_VP9_MAX_SEGMENTATION_TREE_PROBS];
uint8_t segmentation_pred_prob[STD_VIDEO_VP9_MAX_SEGMENTATION_PRED_PROB];
uint8_t FeatureEnabled[STD_VIDEO_VP9_MAX_SEGMENTS];
int16_t FeatureData[STD_VIDEO_VP9_MAX_SEGMENTS][STD_VIDEO_VP9_SEG_LVL_MAX];
} StdVideoVP9Segmentation;
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,68 @@
#ifndef VULKAN_VIDEO_CODEC_VP9STD_DECODE_H_
#define VULKAN_VIDEO_CODEC_VP9STD_DECODE_H_ 1
/*
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
// vulkan_video_codec_vp9std_decode is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_vp9std_decode 1
#include "vulkan_video_codec_vp9std.h"
#define VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0)
#define VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_API_VERSION_1_0_0
#define VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_vp9_decode"
typedef struct StdVideoDecodeVP9PictureInfoFlags {
uint32_t error_resilient_mode : 1;
uint32_t intra_only : 1;
uint32_t allow_high_precision_mv : 1;
uint32_t refresh_frame_context : 1;
uint32_t frame_parallel_decoding_mode : 1;
uint32_t segmentation_enabled : 1;
uint32_t show_frame : 1;
uint32_t UsePrevFrameMvs : 1;
uint32_t reserved : 24;
} StdVideoDecodeVP9PictureInfoFlags;
typedef struct StdVideoDecodeVP9PictureInfo {
StdVideoDecodeVP9PictureInfoFlags flags;
StdVideoVP9Profile profile;
StdVideoVP9FrameType frame_type;
uint8_t frame_context_idx;
uint8_t reset_frame_context;
uint8_t refresh_frame_flags;
uint8_t ref_frame_sign_bias_mask;
StdVideoVP9InterpolationFilter interpolation_filter;
uint8_t base_q_idx;
int8_t delta_q_y_dc;
int8_t delta_q_uv_dc;
int8_t delta_q_uv_ac;
uint8_t tile_cols_log2;
uint8_t tile_rows_log2;
uint16_t reserved1[3];
const StdVideoVP9ColorConfig* pColorConfig;
const StdVideoVP9LoopFilter* pLoopFilter;
const StdVideoVP9Segmentation* pSegmentation;
} StdVideoDecodeVP9PictureInfo;
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -2,7 +2,7 @@
#define VULKAN_VIDEO_CODECS_COMMON_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
// File: vk_platform.h
//
/*
** Copyright 2014-2024 The Khronos Group Inc.
** Copyright 2014-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@@ -2,7 +2,7 @@
#define VULKAN_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -96,4 +96,8 @@
#include "vulkan_beta.h"
#endif
#ifdef VK_USE_PLATFORM_OHOS
#include "vulkan_ohos.h"
#endif
#endif // VULKAN_H_

View File

@@ -2,7 +2,7 @@
#define VULKAN_ANDROID_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -35,12 +35,14 @@ typedef struct VkAndroidSurfaceCreateInfoKHR {
typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
VkInstance instance,
const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#endif
// VK_ANDROID_external_memory_android_hardware_buffer is a preprocessor guard. Do not pass it to API calls.
@@ -109,16 +111,20 @@ typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(Vk
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID(
VkDevice device,
const struct AHardwareBuffer* buffer,
VkAndroidHardwareBufferPropertiesANDROID* pProperties);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID(
VkDevice device,
const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
struct AHardwareBuffer** pBuffer);
#endif
#endif
// VK_ANDROID_external_format_resolve is a preprocessor guard. Do not pass it to API calls.

View File

@@ -2,7 +2,7 @@
#define VULKAN_BETA_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -120,7 +120,7 @@ typedef struct VkPipelineShaderStageNodeCreateInfoAMDX {
uint32_t index;
} VkPipelineShaderStageNodeCreateInfoAMDX;
typedef VkResult (VKAPI_PTR *PFN_vkCreateExecutionGraphPipelinesAMDX)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
typedef VkResult (VKAPI_PTR *PFN_vkCreateExecutionGraphPipelinesAMDX)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineScratchSizeAMDX)(VkDevice device, VkPipeline executionGraph, VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo);
typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineNodeIndexAMDX)(VkDevice device, VkPipeline executionGraph, const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, uint32_t* pNodeIndex);
typedef void (VKAPI_PTR *PFN_vkCmdInitializeGraphScratchMemoryAMDX)(VkCommandBuffer commandBuffer, VkPipeline executionGraph, VkDeviceAddress scratch, VkDeviceSize scratchSize);
@@ -129,6 +129,7 @@ typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectAMDX)(VkCommandBuffer
typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectCountAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, VkDeviceAddress countInfo);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateExecutionGraphPipelinesAMDX(
VkDevice device,
VkPipelineCache pipelineCache,
@@ -136,42 +137,159 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateExecutionGraphPipelinesAMDX(
const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos,
const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetExecutionGraphPipelineScratchSizeAMDX(
VkDevice device,
VkPipeline executionGraph,
VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetExecutionGraphPipelineNodeIndexAMDX(
VkDevice device,
VkPipeline executionGraph,
const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo,
uint32_t* pNodeIndex);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdInitializeGraphScratchMemoryAMDX(
VkCommandBuffer commandBuffer,
VkPipeline executionGraph,
VkDeviceAddress scratch,
VkDeviceSize scratchSize);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphAMDX(
VkCommandBuffer commandBuffer,
VkDeviceAddress scratch,
VkDeviceSize scratchSize,
const VkDispatchGraphCountInfoAMDX* pCountInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectAMDX(
VkCommandBuffer commandBuffer,
VkDeviceAddress scratch,
VkDeviceSize scratchSize,
const VkDispatchGraphCountInfoAMDX* pCountInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectCountAMDX(
VkCommandBuffer commandBuffer,
VkDeviceAddress scratch,
VkDeviceSize scratchSize,
VkDeviceAddress countInfo);
#endif
#endif
// VK_NV_cuda_kernel_launch is a preprocessor guard. Do not pass it to API calls.
#define VK_NV_cuda_kernel_launch 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaModuleNV)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaFunctionNV)
#define VK_NV_CUDA_KERNEL_LAUNCH_SPEC_VERSION 2
#define VK_NV_CUDA_KERNEL_LAUNCH_EXTENSION_NAME "VK_NV_cuda_kernel_launch"
typedef struct VkCudaModuleCreateInfoNV {
VkStructureType sType;
const void* pNext;
size_t dataSize;
const void* pData;
} VkCudaModuleCreateInfoNV;
typedef struct VkCudaFunctionCreateInfoNV {
VkStructureType sType;
const void* pNext;
VkCudaModuleNV module;
const char* pName;
} VkCudaFunctionCreateInfoNV;
typedef struct VkCudaLaunchInfoNV {
VkStructureType sType;
const void* pNext;
VkCudaFunctionNV function;
uint32_t gridDimX;
uint32_t gridDimY;
uint32_t gridDimZ;
uint32_t blockDimX;
uint32_t blockDimY;
uint32_t blockDimZ;
uint32_t sharedMemBytes;
size_t paramCount;
const void* const * pParams;
size_t extraCount;
const void* const * pExtras;
} VkCudaLaunchInfoNV;
typedef struct VkPhysicalDeviceCudaKernelLaunchFeaturesNV {
VkStructureType sType;
void* pNext;
VkBool32 cudaKernelLaunchFeatures;
} VkPhysicalDeviceCudaKernelLaunchFeaturesNV;
typedef struct VkPhysicalDeviceCudaKernelLaunchPropertiesNV {
VkStructureType sType;
void* pNext;
uint32_t computeCapabilityMinor;
uint32_t computeCapabilityMajor;
} VkPhysicalDeviceCudaKernelLaunchPropertiesNV;
typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaModuleNV)(VkDevice device, const VkCudaModuleCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCudaModuleNV* pModule);
typedef VkResult (VKAPI_PTR *PFN_vkGetCudaModuleCacheNV)(VkDevice device, VkCudaModuleNV module, size_t* pCacheSize, void* pCacheData);
typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaFunctionNV)(VkDevice device, const VkCudaFunctionCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCudaFunctionNV* pFunction);
typedef void (VKAPI_PTR *PFN_vkDestroyCudaModuleNV)(VkDevice device, VkCudaModuleNV module, const VkAllocationCallbacks* pAllocator);
typedef void (VKAPI_PTR *PFN_vkDestroyCudaFunctionNV)(VkDevice device, VkCudaFunctionNV function, const VkAllocationCallbacks* pAllocator);
typedef void (VKAPI_PTR *PFN_vkCmdCudaLaunchKernelNV)(VkCommandBuffer commandBuffer, const VkCudaLaunchInfoNV* pLaunchInfo);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateCudaModuleNV(
VkDevice device,
const VkCudaModuleCreateInfoNV* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkCudaModuleNV* pModule);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetCudaModuleCacheNV(
VkDevice device,
VkCudaModuleNV module,
size_t* pCacheSize,
void* pCacheData);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateCudaFunctionNV(
VkDevice device,
const VkCudaFunctionCreateInfoNV* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkCudaFunctionNV* pFunction);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkDestroyCudaModuleNV(
VkDevice device,
VkCudaModuleNV module,
const VkAllocationCallbacks* pAllocator);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkDestroyCudaFunctionNV(
VkDevice device,
VkCudaFunctionNV function,
const VkAllocationCallbacks* pAllocator);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdCudaLaunchKernelNV(
VkCommandBuffer commandBuffer,
const VkCudaLaunchInfoNV* pLaunchInfo);
#endif
#endif
// VK_NV_displacement_micromap is a preprocessor guard. Do not pass it to API calls.

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
#define VULKAN_DIRECTFB_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -36,17 +36,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateDirectFBSurfaceEXT)(VkInstance instance
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateDirectFBSurfaceEXT(
VkInstance instance,
const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceDirectFBPresentationSupportEXT(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
IDirectFB* dfb);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -2,7 +2,7 @@
#define VULKAN_FUCHSIA_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -34,12 +34,14 @@ typedef struct VkImagePipeSurfaceCreateInfoFUCHSIA {
typedef VkResult (VKAPI_PTR *PFN_vkCreateImagePipeSurfaceFUCHSIA)(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA(
VkInstance instance,
const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#endif
// VK_FUCHSIA_external_memory is a preprocessor guard. Do not pass it to API calls.
@@ -70,17 +72,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryZirconHandleFUCHSIA)(VkDevice device
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle, VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandleFUCHSIA(
VkDevice device,
const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
zx_handle_t* pZirconHandle);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandlePropertiesFUCHSIA(
VkDevice device,
VkExternalMemoryHandleTypeFlagBits handleType,
zx_handle_t zirconHandle,
VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties);
#endif
#endif
// VK_FUCHSIA_external_semaphore is a preprocessor guard. Do not pass it to API calls.
@@ -107,15 +113,19 @@ typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreZirconHandleFUCHSIA)(VkDevice
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreZirconHandleFUCHSIA)(VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreZirconHandleFUCHSIA(
VkDevice device,
const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreZirconHandleFUCHSIA(
VkDevice device,
const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
zx_handle_t* pZirconHandle);
#endif
#endif
// VK_FUCHSIA_buffer_collection is a preprocessor guard. Do not pass it to API calls.
@@ -228,32 +238,42 @@ typedef void (VKAPI_PTR *PFN_vkDestroyBufferCollectionFUCHSIA)(VkDevice device,
typedef VkResult (VKAPI_PTR *PFN_vkGetBufferCollectionPropertiesFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, VkBufferCollectionPropertiesFUCHSIA* pProperties);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferCollectionFUCHSIA(
VkDevice device,
const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkBufferCollectionFUCHSIA* pCollection);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionImageConstraintsFUCHSIA(
VkDevice device,
VkBufferCollectionFUCHSIA collection,
const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionBufferConstraintsFUCHSIA(
VkDevice device,
VkBufferCollectionFUCHSIA collection,
const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkDestroyBufferCollectionFUCHSIA(
VkDevice device,
VkBufferCollectionFUCHSIA collection,
const VkAllocationCallbacks* pAllocator);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetBufferCollectionPropertiesFUCHSIA(
VkDevice device,
VkBufferCollectionFUCHSIA collection,
VkBufferCollectionPropertiesFUCHSIA* pProperties);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -2,7 +2,7 @@
#define VULKAN_GGP_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -34,12 +34,14 @@ typedef struct VkStreamDescriptorSurfaceCreateInfoGGP {
typedef VkResult (VKAPI_PTR *PFN_vkCreateStreamDescriptorSurfaceGGP)(VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateStreamDescriptorSurfaceGGP(
VkInstance instance,
const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#endif
// VK_GGP_frame_token is a preprocessor guard. Do not pass it to API calls.

View File

@@ -2,7 +2,7 @@
#define VULKAN_IOS_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -34,12 +34,14 @@ typedef struct VkIOSSurfaceCreateInfoMVK {
typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK(
VkInstance instance,
const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -2,7 +2,7 @@
#define VULKAN_MACOS_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -34,12 +34,14 @@ typedef struct VkMacOSSurfaceCreateInfoMVK {
typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK(
VkInstance instance,
const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -2,7 +2,7 @@
#define VULKAN_METAL_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -40,12 +40,14 @@ typedef struct VkMetalSurfaceCreateInfoEXT {
typedef VkResult (VKAPI_PTR *PFN_vkCreateMetalSurfaceEXT)(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT(
VkInstance instance,
const VkMetalSurfaceCreateInfoEXT* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#endif
// VK_EXT_metal_objects is a preprocessor guard. Do not pass it to API calls.
@@ -183,10 +185,57 @@ typedef struct VkImportMetalSharedEventInfoEXT {
typedef void (VKAPI_PTR *PFN_vkExportMetalObjectsEXT)(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkExportMetalObjectsEXT(
VkDevice device,
VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
#endif
#endif
// VK_EXT_external_memory_metal is a preprocessor guard. Do not pass it to API calls.
#define VK_EXT_external_memory_metal 1
#define VK_EXT_EXTERNAL_MEMORY_METAL_SPEC_VERSION 1
#define VK_EXT_EXTERNAL_MEMORY_METAL_EXTENSION_NAME "VK_EXT_external_memory_metal"
typedef struct VkImportMemoryMetalHandleInfoEXT {
VkStructureType sType;
const void* pNext;
VkExternalMemoryHandleTypeFlagBits handleType;
void* handle;
} VkImportMemoryMetalHandleInfoEXT;
typedef struct VkMemoryMetalHandlePropertiesEXT {
VkStructureType sType;
void* pNext;
uint32_t memoryTypeBits;
} VkMemoryMetalHandlePropertiesEXT;
typedef struct VkMemoryGetMetalHandleInfoEXT {
VkStructureType sType;
const void* pNext;
VkDeviceMemory memory;
VkExternalMemoryHandleTypeFlagBits handleType;
} VkMemoryGetMetalHandleInfoEXT;
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryMetalHandleEXT)(VkDevice device, const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo, void** pHandle);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryMetalHandlePropertiesEXT)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHandle, VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryMetalHandleEXT(
VkDevice device,
const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo,
void** pHandle);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryMetalHandlePropertiesEXT(
VkDevice device,
VkExternalMemoryHandleTypeFlagBits handleType,
const void* pHandle,
VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -2,7 +2,7 @@
#define VULKAN_SCREEN_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -36,17 +36,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateScreenSurfaceQNX)(VkInstance instance,
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct _screen_window* window);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateScreenSurfaceQNX(
VkInstance instance,
const VkScreenSurfaceCreateInfoQNX* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceScreenPresentationSupportQNX(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
struct _screen_window* window);
#endif
#endif
// VK_QNX_external_memory_screen_buffer is a preprocessor guard. Do not pass it to API calls.
@@ -95,11 +99,13 @@ typedef struct VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX {
typedef VkResult (VKAPI_PTR *PFN_vkGetScreenBufferPropertiesQNX)(VkDevice device, const struct _screen_buffer* buffer, VkScreenBufferPropertiesQNX* pProperties);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetScreenBufferPropertiesQNX(
VkDevice device,
const struct _screen_buffer* buffer,
VkScreenBufferPropertiesQNX* pProperties);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -2,7 +2,7 @@
#define VULKAN_VI_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -34,12 +34,14 @@ typedef struct VkViSurfaceCreateInfoNN {
typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN(
VkInstance instance,
const VkViSurfaceCreateInfoNN* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -2,7 +2,7 @@
#define VULKAN_WAYLAND_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -36,17 +36,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance,
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(
VkInstance instance,
const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
struct wl_display* display);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -2,7 +2,7 @@
#define VULKAN_WIN32_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -36,16 +36,20 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, c
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(
VkInstance instance,
const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex);
#endif
#endif
// VK_KHR_external_memory_win32 is a preprocessor guard. Do not pass it to API calls.
@@ -85,17 +89,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, con
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR(
VkDevice device,
const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(
VkDevice device,
VkExternalMemoryHandleTypeFlagBits handleType,
HANDLE handle,
VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
#endif
#endif
// VK_KHR_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls.
@@ -158,15 +166,19 @@ typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice devic
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR(
VkDevice device,
const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(
VkDevice device,
const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
#endif
#endif
// VK_KHR_external_fence_win32 is a preprocessor guard. Do not pass it to API calls.
@@ -202,15 +214,19 @@ typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, c
typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR(
VkDevice device,
const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR(
VkDevice device,
const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
#endif
#endif
// VK_NV_external_memory_win32 is a preprocessor guard. Do not pass it to API calls.
@@ -234,12 +250,14 @@ typedef struct VkExportMemoryWin32HandleInfoNV {
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
VkDevice device,
VkDeviceMemory memory,
VkExternalMemoryHandleTypeFlagsNV handleType,
HANDLE* pHandle);
#endif
#endif
// VK_NV_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls.
@@ -296,25 +314,33 @@ typedef VkResult (VKAPI_PTR *PFN_vkReleaseFullScreenExclusiveModeEXT)(VkDevice d
typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModes2EXT)(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModes2EXT(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
uint32_t* pPresentModeCount,
VkPresentModeKHR* pPresentModes);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireFullScreenExclusiveModeEXT(
VkDevice device,
VkSwapchainKHR swapchain);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkReleaseFullScreenExclusiveModeEXT(
VkDevice device,
VkSwapchainKHR swapchain);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModes2EXT(
VkDevice device,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
VkDeviceGroupPresentModeFlagsKHR* pModes);
#endif
#endif
// VK_NV_acquire_winrt_display is a preprocessor guard. Do not pass it to API calls.
@@ -325,15 +351,19 @@ typedef VkResult (VKAPI_PTR *PFN_vkAcquireWinrtDisplayNV)(VkPhysicalDevice physi
typedef VkResult (VKAPI_PTR *PFN_vkGetWinrtDisplayNV)(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR* pDisplay);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireWinrtDisplayNV(
VkPhysicalDevice physicalDevice,
VkDisplayKHR display);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetWinrtDisplayNV(
VkPhysicalDevice physicalDevice,
uint32_t deviceRelativeId,
VkDisplayKHR* pDisplay);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -2,7 +2,7 @@
#define VULKAN_XCB_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -36,18 +36,22 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, con
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(
VkInstance instance,
const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
xcb_connection_t* connection,
xcb_visualid_t visual_id);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -2,7 +2,7 @@
#define VULKAN_XLIB_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -36,18 +36,22 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, co
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(
VkInstance instance,
const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
Display* dpy,
VisualID visualID);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -2,7 +2,7 @@
#define VULKAN_XLIB_XRANDR_H_ 1
/*
** Copyright 2015-2024 The Khronos Group Inc.
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -27,17 +27,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physi
typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT(
VkPhysicalDevice physicalDevice,
Display* dpy,
VkDisplayKHR display);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT(
VkPhysicalDevice physicalDevice,
Display* dpy,
RROutput rrOutput,
VkDisplayKHR* pDisplay);
#endif
#endif
#ifdef __cplusplus
}

View File

@@ -1,10 +1,5 @@
add_library(zydis
dependencies/zycore/src/Allocator.c
dependencies/zycore/src/API/Memory.c
dependencies/zycore/src/API/Process.c
dependencies/zycore/src/API/Synchronization.c
dependencies/zycore/src/API/Terminal.c
dependencies/zycore/src/API/Thread.c
dependencies/zycore/src/ArgParse.c
dependencies/zycore/src/Bitset.c
dependencies/zycore/src/Format.c
@@ -12,34 +7,51 @@ add_library(zydis
dependencies/zycore/src/String.c
dependencies/zycore/src/Vector.c
dependencies/zycore/src/Zycore.c
dependencies/zycore/src/API/Memory.c
dependencies/zycore/src/API/Process.c
dependencies/zycore/src/API/Synchronization.c
dependencies/zycore/src/API/Terminal.c
dependencies/zycore/src/API/Thread.c
src/Decoder.c
src/DecoderData.c
src/Formatter.c
src/Disassembler.c
src/Encoder.c
src/EncoderData.c
src/FormatterATT.c
src/FormatterBase.c
src/FormatterBuffer.c
src/Formatter.c
src/FormatterIntel.c
src/MetaInfo.c
src/Mnemonic.c
src/Register.c
src/Segment.c
src/SharedData.c
src/String.c
src/Utils.c
src/Zydis.c
src/Generated/AccessedFlags.inc
src/Generated/DecoderTables.inc
src/Generated/EncoderTables.inc
src/Generated/EnumInstructionCategory.inc
src/Generated/EnumISAExt.inc
src/Generated/EnumISASet.inc
src/Generated/EnumMnemonic.inc
src/Generated/EnumRegister.inc
src/Generated/FormatterStrings.inc
src/Generated/GetRelInfo.inc
src/Generated/InstructionDefinitions.inc
src/Generated/InstructionEncodings.inc
src/Generated/OperandDefinitions.inc
src/Generated/RegisterClassLookup.inc
src/Generated/RegisterLookup.inc
dependencies/zycore/include/Zycore/Allocator.h
dependencies/zycore/include/Zycore/API/Memory.h
dependencies/zycore/include/Zycore/API/Process.h
dependencies/zycore/include/Zycore/API/Synchronization.h
dependencies/zycore/include/Zycore/API/Terminal.h
dependencies/zycore/include/Zycore/API/Thread.h
dependencies/zycore/include/Zycore/ArgParse.h
dependencies/zycore/include/Zycore/Atomic.h
dependencies/zycore/include/Zycore/Bitset.h
dependencies/zycore/include/Zycore/Comparison.h
dependencies/zycore/include/Zycore/Defines.h
dependencies/zycore/include/Zycore/Format.h
dependencies/zycore/include/Zycore/Internal/AtomicGNU.h
dependencies/zycore/include/Zycore/Internal/AtomicMSVC.h
dependencies/zycore/include/Zycore/LibC.h
dependencies/zycore/include/Zycore/List.h
dependencies/zycore/include/Zycore/Object.h
@@ -48,34 +60,46 @@ add_library(zydis
dependencies/zycore/include/Zycore/Types.h
dependencies/zycore/include/Zycore/Vector.h
dependencies/zycore/include/Zycore/Zycore.h
dependencies/zycore/include/Zycore/API/Memory.h
dependencies/zycore/include/Zycore/API/Process.h
dependencies/zycore/include/Zycore/API/Synchronization.h
dependencies/zycore/include/Zycore/API/Terminal.h
dependencies/zycore/include/Zycore/API/Thread.h
dependencies/zycore/include/Zycore/Internal/AtomicGNU.h
dependencies/zycore/include/Zycore/Internal/AtomicMSVC.h
include/Zydis/Decoder.h
include/Zydis/DecoderTypes.h
include/Zydis/Formatter.h
include/Zydis/Defines.h
include/Zydis/Disassembler.h
include/Zydis/Encoder.h
include/Zydis/FormatterBuffer.h
include/Zydis/Formatter.h
include/Zydis/MetaInfo.h
include/Zydis/Mnemonic.h
include/Zydis/Register.h
include/Zydis/Segment.h
include/Zydis/SharedTypes.h
include/Zydis/ShortString.h
include/Zydis/Status.h
include/Zydis/Utils.h
include/Zydis/Zydis.h
include/Zydis/Generated/EnumInstructionCategory.h
include/Zydis/Generated/EnumISAExt.h
include/Zydis/Generated/EnumISASet.h
include/Zydis/Generated/EnumMnemonic.h
include/Zydis/Generated/EnumRegister.h
include/Zydis/Internal/DecoderData.h
include/Zydis/Internal/EncoderData.h
include/Zydis/Internal/FormatterATT.h
include/Zydis/Internal/FormatterBase.h
include/Zydis/Internal/FormatterIntel.h
include/Zydis/Internal/SharedData.h
include/Zydis/Internal/String.h
include/Zydis/MetaInfo.h
include/Zydis/Mnemonic.h
include/Zydis/Register.h
include/Zydis/SharedTypes.h
include/Zydis/ShortString.h
include/Zydis/Status.h
include/Zydis/Utils.h
include/Zydis/Zydis.h
)
target_compile_definitions(zydis PUBLIC
ZYCORE_STATIC_DEFINE
ZYDIS_STATIC_DEFINE
ZYCORE_STATIC_BUILD
ZYDIS_STATIC_BUILD
)
target_include_directories(zydis PUBLIC

View File

@@ -1,7 +1,7 @@
The MIT License (MIT)
Copyright (c) 2014-2021 Florian Bernd
Copyright (c) 2014-2021 Joel Höner
Copyright (c) 2014-2024 Florian Bernd
Copyright (c) 2014-2024 Joel Höner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,80 +1,48 @@
<p align="center">
<img alt="zydis logo" src="https://zydis.re/img/logo.svg" width="400px">
<a href="https://zydis.re/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/zyantific/zydis/master/assets/img/logo-dark.svg" width="400px">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/zyantific/zydis/master/assets/img/logo-light.svg" width="400px">
<img alt="zydis logo" src="https://raw.githubusercontent.com/zyantific/zydis/master/assets/img/logo-dark.svg" width="400px">
</picture>
</a>
</p>
<p align="center">
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT">
<a href="https://github.com/zyantific/zydis/actions"><img src="https://github.com/zyantific/zydis/workflows/GitHub%20Actions%20CI/badge.svg" alt="GitHub Actions"></a>
<a href="https://github.com/zyantific/zydis/actions"><img src="https://github.com/zyantific/zydis/workflows/CI/badge.svg" alt="GitHub Actions"></a>
<a href="https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:zydis"><img src="https://oss-fuzz-build-logs.storage.googleapis.com/badges/zydis.svg" alt="Fuzzing Status"></a>
<a href="https://gitter.im/zyantific/zydis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/zyantific/zyan-disassembler-engine.svg" alt="Gitter"></a>
<a href="https://discord.zyantific.com/"><img src="https://img.shields.io/discord/390136917779415060.svg?logo=discord&label=Discord" alt="Discord"></a>
</p>
<p align="center">Fast and lightweight x86/x86-64 disassembler library.</p>
<p align="center">Fast and lightweight x86/x86-64 disassembler and code generation library.</p>
## Features
- Supports all x86 and x86-64 (AMD64) instructions and [extensions](./include/Zydis/Generated/EnumISAExt.h)
- Optimized for high performance
- No dynamic memory allocation ("malloc")
- Thread-safe by design
- Very small file-size overhead compared to other common disassembler libraries
- [Complete doxygen documentation](https://zydis.re/doc/3/)
- [Complete doxygen documentation](https://doc.zydis.re/)
- Trusted by many major open-source projects
- Examples include [x64dbg][zydis-x64dbg], [Mozilla Firefox][zydis-firefox] and [Webkit][zydis-webkit]
- Absolutely no third party dependencies — not even libc
- Should compile on any platform with a working C99 compiler
- Should compile on any platform with a working C11 compiler
- Tested on Windows, macOS, FreeBSD, Linux and UEFI, both user and kernel mode
## Quick Example
The following example program uses Zydis to disassemble a given memory buffer and prints the output to the console ([more examples here](./examples/)).
[zydis-x64dbg]: https://github.com/x64dbg/x64dbg/tree/729285ef82580812edf7167c41aa6a2c23d8d72d/src/zydis_wrapper
[zydis-firefox]: https://github.com/mozilla/gecko-dev/tree/3ddbce3c426a55080bd84974444f9ac4869e580b/js/src/zydis
[zydis-webkit]: https://github.com/WebKit/WebKit/tree/1f2d2a92eeb831bedd01bbb5b694a0e29fa9af81/Source/JavaScriptCore/disassembler/zydis
```C
#include <stdio.h>
#include <inttypes.h>
#include <Zydis/Zydis.h>
## Examples
int main()
{
ZyanU8 data[] =
{
0x51, 0x8D, 0x45, 0xFF, 0x50, 0xFF, 0x75, 0x0C, 0xFF, 0x75,
0x08, 0xFF, 0x15, 0xA0, 0xA5, 0x48, 0x76, 0x85, 0xC0, 0x0F,
0x88, 0xFC, 0xDA, 0x02, 0x00
};
### Disassembler
// Initialize decoder context
ZydisDecoder decoder;
ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_ADDRESS_WIDTH_64);
The following example program uses Zydis to disassemble a given memory buffer and prints the output to the console.
// Initialize formatter. Only required when you actually plan to do instruction
// formatting ("disassembling"), like we do here
ZydisFormatter formatter;
ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL);
https://github.com/zyantific/zydis/blob/214536a814ba20d2e33d2a907198d1a329aac45c/examples/DisassembleSimple.c#L38-L63
// Loop over the instructions in our buffer.
// The runtime-address (instruction pointer) is chosen arbitrary here in order to better
// visualize relative addressing
ZyanU64 runtime_address = 0x007FFFFFFF400000;
ZyanUSize offset = 0;
const ZyanUSize length = sizeof(data);
ZydisDecodedInstruction instruction;
while (ZYAN_SUCCESS(ZydisDecoderDecodeBuffer(&decoder, data + offset, length - offset,
&instruction)))
{
// Print current instruction pointer.
printf("%016" PRIX64 " ", runtime_address);
// Format & print the binary instruction structure to human readable format
char buffer[256];
ZydisFormatterFormatInstruction(&formatter, &instruction, buffer, sizeof(buffer),
runtime_address);
puts(buffer);
offset += instruction.length;
runtime_address += instruction.length;
}
}
```
## Sample Output
The above example program generates the following output:
```asm
@@ -88,74 +56,133 @@ The above example program generates the following output:
007FFFFFFF400013 js 0x007FFFFFFF42DB15
```
### Encoder
https://github.com/zyantific/zydis/blob/b37076e69f5aa149fde540cae43c50f15a380dfc/examples/EncodeMov.c#L39-L62
The above example program generates the following output:
```
48 C7 C0 37 13 00 00
```
### More Examples
More examples can be found in the [examples](./examples/) directory of this repository.
## Build
#### Unix
Zydis builds cleanly on most platforms without any external dependencies. You can use CMake to generate project files for your favorite C99 compiler.
There are many ways to make Zydis available on your system. The following sub-sections list commonly used options.
### CMake Build
**Platforms:** Windows, macOS, Linux, BSDs
You can use CMake to build Zydis on all supported platforms.
Instructions on how to install CMake can be found [here](https://cmake.org/install/).
```bash
git clone --recursive 'https://github.com/zyantific/zydis.git'
cd zydis
mkdir build && cd build
cmake ..
make
cmake -B build
cmake --build build -j4
```
#### Windows
Either use the [Visual Studio 2017 project](./msvc/) or build Zydis using [CMake](https://cmake.org/download/) ([video guide](https://www.youtube.com/watch?v=fywLDK1OAtQ)).
### Visual Studio 2022 project
#### Building Zydis - Using vcpkg
**Platforms:** Windows
You can download and install Zydis using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
We manually maintain a [Visual Studio 2022 project](./msvc/) in addition to the CMake build logic.
```bash
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
vcpkg install zydis
```
The Zydis port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
### CMake generated VS project
**Platforms:** Windows
CMake can be instructed to generate a Visual Studio project for pretty much any VS version. A video guide describing how to use the CMake GUI to generate such project files is available [here](https://www.youtube.com/watch?v=fywLDK1OAtQ). Don't be confused by the apparent use of macOS in the video: Windows is simply running in a virtual machine.
### Amalgamated distribution
**Platforms:** any platform with a working C11 compiler
We provide an auto-generated single header & single source file variant of Zydis. To use this variant
of Zydis in your project, all you need to do is to copy these two files into your project. The
amalgamated builds can be found on our [release page](https://github.com/zyantific/zydis/releases)
as `zydis-amalgamated.tar.gz`.
These files are generated with the [`amalgamate.py`](./assets/amalgamate.py) script.
### Package managers
**Platforms:** Windows, macOS, Linux, FreeBSD
Pre-built headers, shared libraries and executables are available through a variety of package managers.
<details>
<summary>Zydis version in various package repositories</summary>
[![Packaging status](https://repology.org/badge/vertical-allrepos/zydis.svg)](https://repology.org/project/zydis/versions)
</details>
| Repository | Install command |
|------------|--------------------------------------------|
| Arch Linux | `pacman -S zydis` |
| Debian | `apt-get install libzydis-dev zydis-tools` |
| Homebrew | `brew install zydis` |
| NixOS | `nix-shell -p zydis` |
| Ubuntu | `apt-get install libzydis-dev zydis-tools` |
| vcpkg | `vcpkg install zydis` |
## Using Zydis in a CMake project
An example on how to use Zydis in your own CMake based project [can be found in this repo](https://github.com/zyantific/zydis-submodule-example).
## `ZydisInfo` tool
The `ZydisInfo` command-line tool can be used to inspect essentially all information
that Zydis provides about an instruction.
![ZydisInfo](./assets/screenshots/ZydisInfo.png)
## Bindings
Official bindings exist for a selection of languages:
- [Pascal](https://github.com/zyantific/zydis-pascal)
- [Python 3](https://github.com/zyantific/zydis-py)
- [Rust](https://github.com/zyantific/zydis-rs)
Unofficial but actively maintained bindings:
- [Go](https://github.com/jpap/go-zydis)
- [LuaJIT](https://github.com/Wiladams/lj2zydis)
- [Haskell](https://github.com/nerded1337/zydiskell)
Official bindings exist for a selection of languages:
- [Rust](https://github.com/zyantific/zydis-rs)
- [Python 3](https://github.com/zyantific/zydis-py)
### asmjit-style C++ front-end
If you're looking for an asmjit-style assembler front-end for the encoder, check out [zasm](https://github.com/zyantific/zasm).
zasm also provides an idiomatic C++ wrapper around the decoder and formatter interface.
## Versions
#### Scheme
Versions follow the [semantic versioning scheme](https://semver.org/). All stability guarantees apply to the API only — ABI stability between patches cannot be assumed unless explicitly mentioned in the release notes.
### Scheme
Versions follow the [semantic versioning scheme](https://semver.org/). All stability guarantees apply to the API only. ABI stability is provided only between patch versions.
### Branches & Tags
#### Branches & Tags
- `master` holds the bleeding edge code of the next, unreleased Zydis version. Elevated amounts of bugs and issues must be expected, API stability is not guaranteed outside of tagged commits.
- Stable and preview versions are annotated with git tags
- beta and other preview versions have `-beta`, `-rc`, etc. suffixes
- `maintenance/v2` contains the code of the latest legacy release of v2
- v2 is now deprecated, but will receive security fixes until 2021
- `maintenance/v3` points to the code of the latest release of v3
- v3 won't get any feature updates but will receive security updates until 2025
- `maintenance/v2` points to the code of the last legacy release of v2
- v2 is has reached end-of-life and won't receive any security updates
## Credits
- Intel (for open-sourcing [XED](https://github.com/intelxed/xed), allowing for automatic comparison of our tables against theirs, improving both)
- [LLVM](https://llvm.org) (for providing pretty solid instruction data as well)
- Christian Ludloff (http://sandpile.org, insanely helpful)
- Christian Ludloff (https://sandpile.org, insanely helpful)
- [LekoArts](https://www.lekoarts.de/) (for creating the project logo)
- Our [contributors on GitHub](https://github.com/zyantific/zydis/graphs/contributors)
## Troubleshooting
#### `-fPIC` for shared library builds
### `-fPIC` for shared library builds
```
/usr/bin/ld: ./libfoo.a(foo.c.o): relocation R_X86_64_PC32 against symbol `bar' can not be used when making a shared object; recompile with -fPIC
@@ -167,11 +194,12 @@ might fail to detect that relocation information must be emitted. This can be fo
by passing `-DCMAKE_POSITION_INDEPENDENT_CODE=ON` to the CMake invocation.
## Consulting and Business Support
We offer consulting services and professional business support for Zydis. If you need a custom extension, require help in integrating Zydis into your product or simply want contractually guaranteed updates and turnaround times, we are happy to assist with that! Please contact us at business@zyantific.com.
## Donations
Since GitHub Sponsors currently doesn't support sponsoring teams directly, donations are collected and distributed using [flobernd](https://github.com/users/flobernd/sponsorship)s account.
Donations are collected and distributed using [flobernd](https://github.com/users/flobernd/sponsorship)'s account.
## License

View File

@@ -1,7 +1,7 @@
The MIT License (MIT)
Copyright (c) 2018-2020 Florian Bernd
Copyright (c) 2018-2020 Joel Höner
Copyright (c) 2018-2024 Florian Bernd
Copyright (c) 2018-2024 Joel Höner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -87,7 +87,7 @@ typedef enum ZyanMemoryPageProtection_
*
* @return The system page size.
*/
ZYCORE_EXPORT ZyanU32 ZyanMemoryGetSystemPageSize();
ZYCORE_EXPORT ZyanU32 ZyanMemoryGetSystemPageSize(void);
/**
* Returns the system allocation granularity.
@@ -100,7 +100,7 @@ ZYCORE_EXPORT ZyanU32 ZyanMemoryGetSystemPageSize();
*
* @return The system allocation granularity.
*/
ZYCORE_EXPORT ZyanU32 ZyanMemoryGetSystemAllocationGranularity();
ZYCORE_EXPORT ZyanU32 ZyanMemoryGetSystemAllocationGranularity(void);
/* ---------------------------------------------------------------------------------------------- */
/* Memory management */

View File

@@ -64,6 +64,10 @@
#if defined(__clang__)
# define ZYAN_CLANG
# define ZYAN_GNUC
# if defined(_MSC_VER)
# define ZYAN_CLANG_CL
# define ZYAN_MSVC
# endif
#elif defined(__ICC) || defined(__INTEL_COMPILER)
# define ZYAN_ICC
#elif defined(__GNUC__) || defined(__GNUG__)
@@ -97,10 +101,16 @@
#elif defined(__FreeBSD__)
# define ZYAN_FREEBSD
# define ZYAN_POSIX
#elif defined(__NetBSD__)
# define ZYAN_NETBSD
# define ZYAN_POSIX
#elif defined(sun) || defined(__sun)
# define ZYAN_SOLARIS
# define ZYAN_POSIX
#elif defined(__unix)
#elif defined(__HAIKU__)
# define ZYAN_HAIKU
# define ZYAN_POSIX
#elif defined(__unix) || defined(__unix__)
# define ZYAN_UNIX
# define ZYAN_POSIX
#elif defined(__posix)
@@ -136,6 +146,14 @@
# define ZYAN_ARM
#elif defined(__EMSCRIPTEN__) || defined(__wasm__) || defined(__WASM__)
# define ZYAN_WASM
#elif defined(__loongarch__)
# define ZYAN_LOONGARCH
#elif defined(__powerpc64__)
# define ZYAN_PPC64
#elif defined(__powerpc__)
# define ZYAN_PPC
#elif defined(__riscv) && __riscv_xlen == 64
# define ZYAN_RISCV64
#else
# error "Unsupported architecture detected"
#endif
@@ -176,12 +194,17 @@
/* Generic DLL import/export helpers */
/* ============================================================================================== */
#if defined(ZYAN_MSVC)
#if defined(ZYAN_MSVC) || (defined(ZYAN_WINDOWS) && defined(ZYAN_GNUC))
# define ZYAN_DLLEXPORT __declspec(dllexport)
# define ZYAN_DLLIMPORT __declspec(dllimport)
#else
# define ZYAN_DLLEXPORT
# define ZYAN_DLLIMPORT
# if defined(ZYAN_GNUC)
# define ZYAN_DLLEXPORT __attribute__((__visibility__("default")))
# define ZYAN_DLLIMPORT extern
# else
# define ZYAN_DLLEXPORT
# define ZYAN_DLLIMPORT
# endif
#endif
/* ============================================================================================== */
@@ -201,8 +224,7 @@
// backward compatibility for users that don't use CMake and previously manually defined these, we
// translate the old defines here and print a warning.
#if defined(ZYCORE_STATIC_DEFINE)
// Warning disabled for PCSX2 since we define this on the command line.
//# pragma message("ZYCORE_STATIC_DEFINE was renamed to ZYCORE_STATIC_BUILD.")
# pragma message("ZYCORE_STATIC_DEFINE was renamed to ZYCORE_STATIC_BUILD.")
# define ZYCORE_STATIC_BUILD
#endif
#if defined(Zycore_EXPORTS)
@@ -226,7 +248,11 @@
/**
* Symbol is not exported and for internal use only.
*/
#define ZYCORE_NO_EXPORT
#if defined(ZYAN_GNUC)
# define ZYCORE_NO_EXPORT __attribute__((__visibility__("hidden")))
#else
# define ZYCORE_NO_EXPORT
#endif
/* ============================================================================================== */
/* Misc compatibility macros */
@@ -272,12 +298,15 @@
/**
* Compiler-time assertion.
*/
#if __STDC_VERSION__ >= 201112L && !defined(__cplusplus)
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__cplusplus)
# define ZYAN_STATIC_ASSERT(x) _Static_assert(x, #x)
#elif (defined(__cplusplus) && __cplusplus >= 201103L) || \
(defined(__cplusplus) && defined (_MSC_VER) && (_MSC_VER >= 1600)) || \
(defined (_MSC_VER) && (_MSC_VER >= 1800))
# define ZYAN_STATIC_ASSERT(x) static_assert(x, #x)
#elif defined(ZYAN_GNUC)
# define ZYAN_STATIC_ASSERT(x) \
__attribute__((unused)) typedef int ZYAN_MACRO_CONCAT_EXPAND(ZYAN_SASSERT_, __COUNTER__) [(x) ? 1 : -1]
#else
# define ZYAN_STATIC_ASSERT(x) \
typedef int ZYAN_MACRO_CONCAT_EXPAND(ZYAN_SASSERT_, __COUNTER__) [(x) ? 1 : -1]
@@ -335,7 +364,7 @@
* Intentional fallthrough.
*/
#if defined(ZYAN_GCC) && __GNUC__ >= 7
# define ZYAN_FALLTHROUGH __attribute__((__fallthrough__))
# define ZYAN_FALLTHROUGH ; __attribute__((__fallthrough__))
#else
# define ZYAN_FALLTHROUGH
#endif
@@ -469,6 +498,20 @@
*/
#define ZYAN_ALIGN_DOWN(x, align) (((x) - 1) & ~((align) - 1))
/**
* Divide the 64bit integer value by the given divisor.
*
* @param n Variable containing the dividend that will be updated with the result of the
* division.
* @param divisor The divisor.
*/
#if defined(ZYAN_LINUX) && defined(ZYAN_KERNEL)
# include <asm/div64.h> /* do_div */
# define ZYAN_DIV64(n, divisor) do_div(n, divisor)
#else
# define ZYAN_DIV64(n, divisor) (n /= divisor)
#endif
/* ---------------------------------------------------------------------------------------------- */
/* Bit operations */
/* ---------------------------------------------------------------------------------------------- */

View File

@@ -99,6 +99,7 @@ typedef FILE ZyanFile;
#include <stdlib.h>
#define ZYAN_CALLOC calloc
#define ZYAN_FREE free
#define ZYAN_GETENV getenv
#define ZYAN_MALLOC malloc
#define ZYAN_REALLOC realloc

View File

@@ -42,68 +42,172 @@
(defined(ZYAN_MSVC) && defined(ZYAN_KERNEL)) // The WDK LibC lacks stdint.h.
// No LibC mode, use compiler built-in types / macros.
# if defined(ZYAN_MSVC) || defined(ZYAN_ICC)
typedef unsigned __int8 ZyanU8;
typedef unsigned __int16 ZyanU16;
typedef unsigned __int32 ZyanU32;
typedef unsigned __int64 ZyanU64;
typedef signed __int8 ZyanI8;
typedef signed __int16 ZyanI16;
typedef signed __int32 ZyanI32;
typedef signed __int64 ZyanI64;
typedef unsigned __int8 ZyanU8;
typedef unsigned __int16 ZyanU16;
typedef unsigned __int32 ZyanU32;
typedef unsigned __int64 ZyanU64;
typedef signed __int8 ZyanI8;
typedef signed __int16 ZyanI16;
typedef signed __int32 ZyanI32;
typedef signed __int64 ZyanI64;
# if _WIN64
typedef ZyanU64 ZyanUSize;
typedef ZyanI64 ZyanISize;
typedef ZyanU64 ZyanUPointer;
typedef ZyanI64 ZyanIPointer;
typedef ZyanU64 ZyanUSize;
typedef ZyanI64 ZyanISize;
typedef ZyanU64 ZyanUPointer;
typedef ZyanI64 ZyanIPointer;
# else
typedef ZyanU32 ZyanUSize;
typedef ZyanI32 ZyanISize;
typedef ZyanU32 ZyanUPointer;
typedef ZyanI32 ZyanIPointer;
typedef ZyanU32 ZyanUSize;
typedef ZyanI32 ZyanISize;
typedef ZyanU32 ZyanUPointer;
typedef ZyanI32 ZyanIPointer;
# endif
# elif defined(ZYAN_GNUC)
typedef __UINT8_TYPE__ ZyanU8;
typedef __UINT16_TYPE__ ZyanU16;
typedef __UINT32_TYPE__ ZyanU32;
typedef __UINT64_TYPE__ ZyanU64;
typedef __INT8_TYPE__ ZyanI8;
typedef __INT16_TYPE__ ZyanI16;
typedef __INT32_TYPE__ ZyanI32;
typedef __INT64_TYPE__ ZyanI64;
typedef __SIZE_TYPE__ ZyanUSize;
typedef __PTRDIFF_TYPE__ ZyanISize;
typedef __UINTPTR_TYPE__ ZyanUPointer;
typedef __INTPTR_TYPE__ ZyanIPointer;
# ifdef __UINT8_TYPE__
typedef __UINT8_TYPE__ ZyanU8;
# else
typedef unsigned char ZyanU8;
# endif
# ifdef __UINT16_TYPE__
typedef __UINT16_TYPE__ ZyanU16;
# else
typedef unsigned short int ZyanU16;
# endif
# ifdef __UINT32_TYPE__
typedef __UINT32_TYPE__ ZyanU32;
# else
typedef unsigned int ZyanU32;
# endif
# ifdef __UINT64_TYPE__
typedef __UINT64_TYPE__ ZyanU64;
# else
# if defined(__x86_64__) && !defined(__ILP32__)
typedef unsigned long int ZyanU64;
# else
typedef unsigned long long int ZyanU64;
# endif
# endif
# ifdef __INT8_TYPE__
typedef __INT8_TYPE__ ZyanI8;
# else
typedef signed char ZyanI8;
# endif
# ifdef __INT16_TYPE__
typedef __INT16_TYPE__ ZyanI16;
# else
typedef signed short int ZyanI16;
# endif
# ifdef __INT32_TYPE__
typedef __INT32_TYPE__ ZyanI32;
# else
typedef signed int ZyanI32;
# endif
# ifdef __INT64_TYPE__
typedef __INT64_TYPE__ ZyanI64;
# else
# if defined(__x86_64__) && !defined( __ILP32__)
typedef signed long int ZyanI64;
# else
typedef signed long long int ZyanI64;
# endif
# endif
# ifdef __SIZE_TYPE__
typedef __SIZE_TYPE__ ZyanUSize;
# else
typedef long unsigned int ZyanUSize;
# endif
# ifdef __PTRDIFF_TYPE__
typedef __PTRDIFF_TYPE__ ZyanISize;
# else
typedef long int ZyanISize;
# endif
# ifdef __UINTPTR_TYPE__
typedef __UINTPTR_TYPE__ ZyanUPointer;
# else
# if defined(__x86_64__) && !defined( __ILP32__)
typedef unsigned long int ZyanUPointer;
# else
typedef unsigned int ZyanUPointer;
# endif
# endif
# ifdef __INTPTR_TYPE__
typedef __INTPTR_TYPE__ ZyanIPointer;
# else
# if defined(__x86_64__) && !defined( __ILP32__)
typedef long int ZyanIPointer;
# else
typedef int ZyanIPointer;
# endif
# endif
# else
# error "Unsupported compiler for no-libc mode."
# endif
# if defined(ZYAN_MSVC)
# define ZYAN_INT8_MIN (-127i8 - 1)
# define ZYAN_INT16_MIN (-32767i16 - 1)
# define ZYAN_INT32_MIN (-2147483647i32 - 1)
# define ZYAN_INT64_MIN (-9223372036854775807i64 - 1)
# define ZYAN_INT8_MAX 127i8
# define ZYAN_INT16_MAX 32767i16
# define ZYAN_INT32_MAX 2147483647i32
# define ZYAN_INT64_MAX 9223372036854775807i64
# define ZYAN_UINT8_MAX 0xffui8
# define ZYAN_UINT16_MAX 0xffffui16
# define ZYAN_UINT32_MAX 0xffffffffui32
# define ZYAN_UINT64_MAX 0xffffffffffffffffui64
# define ZYAN_INT8_MIN (-127i8 - 1)
# define ZYAN_INT16_MIN (-32767i16 - 1)
# define ZYAN_INT32_MIN (-2147483647i32 - 1)
# define ZYAN_INT64_MIN (-9223372036854775807i64 - 1)
# define ZYAN_INT8_MAX 127i8
# define ZYAN_INT16_MAX 32767i16
# define ZYAN_INT32_MAX 2147483647i32
# define ZYAN_INT64_MAX 9223372036854775807i64
# define ZYAN_UINT8_MAX 0xffui8
# define ZYAN_UINT16_MAX 0xffffui16
# define ZYAN_UINT32_MAX 0xffffffffui32
# define ZYAN_UINT64_MAX 0xffffffffffffffffui64
# else
# define ZYAN_INT8_MAX __INT8_MAX__
# define ZYAN_INT8_MIN (-ZYAN_INT8_MAX - 1)
# define ZYAN_INT16_MAX __INT16_MAX__
# define ZYAN_INT16_MIN (-ZYAN_INT16_MAX - 1)
# define ZYAN_INT32_MAX __INT32_MAX__
# define ZYAN_INT32_MIN (-ZYAN_INT32_MAX - 1)
# define ZYAN_INT64_MAX __INT64_MAX__
# define ZYAN_INT64_MIN (-ZYAN_INT64_MAX - 1)
# define ZYAN_UINT8_MAX __UINT8_MAX__
# define ZYAN_UINT16_MAX __UINT16_MAX__
# define ZYAN_UINT32_MAX __UINT32_MAX__
# define ZYAN_UINT64_MAX __UINT64_MAX__
# ifdef __INT8_MAX__
# define ZYAN_INT8_MAX __INT8_MAX__
# else
# define ZYAN_INT8_MAX (127)
# endif
# define ZYAN_INT8_MIN (-ZYAN_INT8_MAX - 1)
# ifdef __INT16_MAX__
# define ZYAN_INT16_MAX __INT16_MAX__
# else
# define ZYAN_INT16_MAX (32767)
# endif
# define ZYAN_INT16_MIN (-ZYAN_INT16_MAX - 1)
# ifdef __INT32_MAX__
# define ZYAN_INT32_MAX __INT32_MAX__
# else
# define ZYAN_INT32_MAX (2147483647)
# endif
# define ZYAN_INT32_MIN (-ZYAN_INT32_MAX - 1)
# ifdef __INT64_MAX__
# define ZYAN_INT64_MAX __INT64_MAX__
# else
# if defined(__x86_64__) && !defined( __ILP32__)
# define ZYAN_INT64_MAX (9223372036854775807L)
# else
# define ZYAN_INT64_MAX (9223372036854775807LL)
# endif
# endif
# define ZYAN_INT64_MIN (-ZYAN_INT64_MAX - 1)
# ifdef __UINT8_MAX__
# define ZYAN_UINT8_MAX __UINT8_MAX__
# else
# define ZYAN_UINT8_MAX (255)
# endif
# ifdef __UINT16_MAX__
# define ZYAN_UINT16_MAX __UINT16_MAX__
# else
# define ZYAN_UINT16_MAX (65535)
# endif
# ifdef __UINT32_MAX__
# define ZYAN_UINT32_MAX __UINT32_MAX__
# else
# define ZYAN_UINT32_MAX (4294967295U)
# endif
# ifdef __UINT64_MAX__
# define ZYAN_UINT64_MAX __UINT64_MAX__
# else
# if defined(__x86_64__) && !defined( __ILP32__)
# define ZYAN_UINT64_MAX (18446744073709551615UL)
# else
# define ZYAN_UINT64_MAX (18446744073709551615ULL)
# endif
# endif
# endif
#else
// If is LibC present, we use stdint types.
@@ -180,8 +284,8 @@ typedef const void* ZyanConstVoidPointer;
/* Boolean */
/* ---------------------------------------------------------------------------------------------- */
#define ZYAN_FALSE 0
#define ZYAN_TRUE 1
#define ZYAN_FALSE 0u
#define ZYAN_TRUE 1u
/**
* Defines the `ZyanBool` data-type.

View File

@@ -51,7 +51,7 @@ extern "C" {
/**
* A macro that defines the zycore version.
*/
#define ZYCORE_VERSION (ZyanU64)0x0001000200000000
#define ZYCORE_VERSION 0x0001000500020000ULL
/* ---------------------------------------------------------------------------------------------- */
/* Helper macros */
@@ -62,28 +62,28 @@ extern "C" {
*
* @param version The zycore version value
*/
#define ZYCORE_VERSION_MAJOR(version) (ZyanU16)((version & 0xFFFF000000000000) >> 48)
#define ZYCORE_VERSION_MAJOR(version) ((version & 0xFFFF000000000000) >> 48)
/**
* Extracts the minor-part of the zycore version.
*
* @param version The zycore version value
*/
#define ZYCORE_VERSION_MINOR(version) (ZyanU16)((version & 0x0000FFFF00000000) >> 32)
#define ZYCORE_VERSION_MINOR(version) ((version & 0x0000FFFF00000000) >> 32)
/**
* Extracts the patch-part of the zycore version.
*
* @param version The zycore version value
*/
#define ZYCORE_VERSION_PATCH(version) (ZyanU16)((version & 0x00000000FFFF0000) >> 16)
#define ZYCORE_VERSION_PATCH(version) ((version & 0x00000000FFFF0000) >> 16)
/**
* Extracts the build-part of the zycore version.
*
* @param version The zycore version value
*/
#define ZYCORE_VERSION_BUILD(version) (ZyanU16)(version & 0x000000000000FFFF)
#define ZYCORE_VERSION_BUILD(version) (version & 0x000000000000FFFF)
/* ---------------------------------------------------------------------------------------------- */

View File

@@ -44,7 +44,7 @@
/* General */
/* ---------------------------------------------------------------------------------------------- */
ZyanU32 ZyanMemoryGetSystemPageSize()
ZyanU32 ZyanMemoryGetSystemPageSize(void)
{
#if defined(ZYAN_WINDOWS)
@@ -60,7 +60,7 @@ ZyanU32 ZyanMemoryGetSystemPageSize()
#endif
}
ZyanU32 ZyanMemoryGetSystemAllocationGranularity()
ZyanU32 ZyanMemoryGetSystemAllocationGranularity(void)
{
#if defined(ZYAN_WINDOWS)

View File

@@ -25,6 +25,10 @@
***************************************************************************************************/
#include <Zycore/Defines.h>
#include <Zycore/API/Process.h>
#ifndef ZYAN_NO_LIBC
#if defined(ZYAN_WINDOWS)
#if defined(ZYAN_KERNEL)
# include <wdm.h>
@@ -36,9 +40,6 @@
#else
# error "Unsupported platform detected"
#endif
#include <Zycore/API/Process.h>
#ifndef ZYAN_NO_LIBC
/* ============================================================================================== */
/* Exported functions */

View File

@@ -83,7 +83,7 @@ static const ZyanStringView STR_SUB = ZYAN_DEFINE_STRING_VIEW("-");
/* Decimal */
/* ---------------------------------------------------------------------------------------------- */
#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) || defined(ZYAN_WASM)
#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) || defined(ZYAN_WASM) || defined(ZYAN_PPC)
ZyanStatus ZyanStringAppendDecU32(ZyanString* string, ZyanU32 value, ZyanU8 padding_length)
{
if (!string)
@@ -179,7 +179,7 @@ ZyanStatus ZyanStringAppendDecU64(ZyanString* string, ZyanU64 value, ZyanU8 padd
/* Hexadecimal */
/* ---------------------------------------------------------------------------------------------- */
#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) || defined(ZYAN_WASM)
#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) || defined(ZYAN_WASM) || defined(ZYAN_PPC)
ZyanStatus ZyanStringAppendHexU32(ZyanString* string, ZyanU32 value, ZyanU8 padding_length,
ZyanBool uppercase)
{
@@ -423,7 +423,7 @@ ZyanStatus ZyanStringAppendFormat(ZyanString* string, const char* format, ...)
ZyanStatus ZyanStringAppendDecU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length)
{
#if defined(ZYAN_X64) || defined(ZYAN_AARCH64)
#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_PPC64) || defined(ZYAN_RISCV64) || defined(ZYAN_LOONGARCH)
return ZyanStringAppendDecU64(string, value, padding_length);
#else
// Working with 64-bit values is slow on non 64-bit systems
@@ -464,7 +464,7 @@ ZyanStatus ZyanStringAppendDecS(ZyanString* string, ZyanI64 value, ZyanU8 paddin
ZyanStatus ZyanStringAppendHexU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length,
ZyanBool uppercase)
{
#if defined(ZYAN_X64) || defined(ZYAN_AARCH64)
#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_PPC64) || defined(ZYAN_RISCV64) || defined(ZYAN_LOONGARCH)
return ZyanStringAppendHexU64(string, value, padding_length, uppercase);
#else
// Working with 64-bit values is slow on non 64-bit systems

View File

@@ -1,46 +0,0 @@
#ifndef ZYCORE_EXPORT_H
#define ZYCORE_EXPORT_H
#ifdef ZYCORE_STATIC_DEFINE
# define ZYCORE_EXPORT
# define ZYCORE_NO_EXPORT
#else
# ifndef ZYCORE_EXPORT
# ifdef Zycore_EXPORTS
/* We are building this library */
# define ZYCORE_EXPORT __declspec(dllexport)
# else
/* We are using this library */
# define ZYCORE_EXPORT __declspec(dllimport)
# endif
# endif
# ifndef ZYCORE_NO_EXPORT
# define ZYCORE_NO_EXPORT
# endif
#endif
#ifndef ZYCORE_DEPRECATED
# ifdef _MSC_VER
# define ZYCORE_DEPRECATED __declspec(deprecated)
# else
# define ZYCORE_DEPRECATED
# endif
#endif
#ifndef ZYCORE_DEPRECATED_EXPORT
# define ZYCORE_DEPRECATED_EXPORT ZYCORE_EXPORT ZYCORE_DEPRECATED
#endif
#ifndef ZYCORE_DEPRECATED_NO_EXPORT
# define ZYCORE_DEPRECATED_NO_EXPORT ZYCORE_NO_EXPORT ZYCORE_DEPRECATED
#endif
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef ZYCORE_NO_DEPRECATED
# define ZYCORE_NO_DEPRECATED
# endif
#endif
#endif /* ZYCORE_EXPORT_H */

View File

@@ -136,11 +136,28 @@ typedef enum ZydisDecoderMode_
* This mode is enabled by default.
*/
ZYDIS_DECODER_MODE_CLDEMOTE,
/**
* Enables the `IPREFETCH` mode.
*
* The `IPREFETCH` isa-extension reuses (overrides) some of the widenop instruction opcodes.
*
* This mode is enabled by default.
*/
ZYDIS_DECODER_MODE_IPREFETCH,
/**
* Enables the `UD0` compatibility mode.
*
* Some processors decode the `UD0` instruction without a ModR/M byte. Enable this decoder mode
* to mimic this behavior.
*
* This mode is disabled by default.
*/
ZYDIS_DECODER_MODE_UD0_COMPAT,
/**
* Maximum value of this enum.
*/
ZYDIS_DECODER_MODE_MAX_VALUE = ZYDIS_DECODER_MODE_CLDEMOTE,
ZYDIS_DECODER_MODE_MAX_VALUE = ZYDIS_DECODER_MODE_UD0_COMPAT,
/**
* The minimum number of bits required to represent all values of this enum.
*/
@@ -164,13 +181,13 @@ typedef struct ZydisDecoder_
*/
ZydisMachineMode machine_mode;
/**
* The address width.
* The stack width.
*/
ZydisAddressWidth address_width;
ZydisStackWidth stack_width;
/**
* The decoder mode array.
* The decoder mode bitmap.
*/
ZyanBool decoder_mode[ZYDIS_DECODER_MODE_MAX_VALUE + 1];
ZyanU32 decoder_mode;
} ZydisDecoder;
/* ---------------------------------------------------------------------------------------------- */
@@ -190,12 +207,12 @@ typedef struct ZydisDecoder_
*
* @param decoder A pointer to the `ZydisDecoder` instance.
* @param machine_mode The machine mode.
* @param address_width The address width.
* @param stack_width The stack width.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisDecoderInit(ZydisDecoder* decoder, ZydisMachineMode machine_mode,
ZydisAddressWidth address_width);
ZydisStackWidth stack_width);
/**
* Enables or disables the specified decoder-mode.
@@ -209,10 +226,45 @@ ZYDIS_EXPORT ZyanStatus ZydisDecoderInit(ZydisDecoder* decoder, ZydisMachineMode
ZYDIS_EXPORT ZyanStatus ZydisDecoderEnableMode(ZydisDecoder* decoder, ZydisDecoderMode mode,
ZyanBool enabled);
/**
* Decodes the instruction in the given input `buffer` and returns all details (e.g. operands).
*
* @param decoder A pointer to the `ZydisDecoder` instance.
* @param buffer A pointer to the input buffer.
* @param length The length of the input buffer. Note that this can be bigger than the
* actual size of the instruction -- you don't have to know the size up
* front. This length is merely used to prevent Zydis from doing
* out-of-bounds reads on your buffer.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct receiving the details
* about the decoded instruction.
* @param operands A pointer to an array with `ZYDIS_MAX_OPERAND_COUNT` entries that
* receives the decoded operands. The number of operands decoded is
* determined by the `instruction.operand_count` field. Excess entries are
* zeroed.
*
* This is a convenience function that combines the following functions into one call:
*
* - `ZydisDecoderDecodeInstruction`
* - `ZydisDecoderDecodeOperands`
*
* Please refer to `ZydisDecoderDecodeInstruction` if operand decoding is not required or should
* be done separately (`ZydisDecoderDecodeOperands`).
*
* This function is not available in MINIMAL_MODE.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisDecoderDecodeFull(const ZydisDecoder* decoder,
const void* buffer, ZyanUSize length, ZydisDecodedInstruction* instruction,
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT]);
/**
* Decodes the instruction in the given input `buffer`.
*
* @param decoder A pointer to the `ZydisDecoder` instance.
* @param context A pointer to a decoder context struct which is required for further
* decoding (e.g. operand decoding using `ZydisDecoderDecodeOperands`) or
* `ZYAN_NULL` if not needed.
* @param buffer A pointer to the input buffer.
* @param length The length of the input buffer. Note that this can be bigger than the
* actual size of the instruction -- you don't have to know the size up
@@ -223,8 +275,39 @@ ZYDIS_EXPORT ZyanStatus ZydisDecoderEnableMode(ZydisDecoder* decoder, ZydisDecod
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisDecoderDecodeBuffer(const ZydisDecoder* decoder,
const void* buffer, ZyanUSize length, ZydisDecodedInstruction* instruction);
ZYDIS_EXPORT ZyanStatus ZydisDecoderDecodeInstruction(const ZydisDecoder* decoder,
ZydisDecoderContext* context, const void* buffer, ZyanUSize length,
ZydisDecodedInstruction* instruction);
/**
* Decodes the instruction operands.
*
* @param decoder A pointer to the `ZydisDecoder` instance.
* @param context A pointer to the `ZydisDecoderContext` struct.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param operands The array that receives the decoded operands.
* Refer to `ZYDIS_MAX_OPERAND_COUNT` or `ZYDIS_MAX_OPERAND_COUNT_VISIBLE`
* when allocating space for the array to ensure that the buffer size is
* sufficient to always fit all instruction operands.
* Refer to `instruction.operand_count` or
* `instruction.operand_count_visible' when allocating space for the array
* to ensure that the buffer size is sufficient to fit all operands of
* the given instruction.
* @param operand_count The length of the `operands` array.
* This argument as well limits the maximum amount of operands to decode.
* If this value is `0`, no operands will be decoded and `ZYAN_NULL` will
* be accepted for the `operands` argument.
*
* This function fails, if `operand_count` is larger than the total number of operands for the
* given instruction (`instruction.operand_count`).
*
* This function is not available in MINIMAL_MODE.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisDecoderDecodeOperands(const ZydisDecoder* decoder,
const ZydisDecoderContext* context, const ZydisDecodedInstruction* instruction,
ZydisDecodedOperand* operands, ZyanU8 operand_count);
/** @} */

File diff suppressed because it is too large Load Diff

76
3rdparty/zydis/include/Zydis/Defines.h vendored Normal file
View File

@@ -0,0 +1,76 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Joel Hoener
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
* Import/export defines for MSVC builds.
*/
#ifndef ZYDIS_DEFINES_H
#define ZYDIS_DEFINES_H
#include <Zycore/Defines.h>
// This is a cut-down version of what CMake's `GenerateExportHeader` would usually generate. To
// simplify builds without CMake, we define these things manually instead of relying on CMake
// to generate the header.
//
// For static builds, our CMakeList will define `ZYDIS_STATIC_BUILD`. For shared library builds,
// our CMake will define `ZYDIS_SHOULD_EXPORT` depending on whether the target is being imported or
// exported. If CMake isn't used, users can manually define these to fit their use-case.
// Backward compatibility: CMake would previously generate these variables names. However, because
// they have pretty cryptic names, we renamed them when we got rid of `GenerateExportHeader`. For
// backward compatibility for users that don't use CMake and previously manually defined these, we
// translate the old defines here and print a warning.
#if defined(ZYDIS_STATIC_DEFINE)
# pragma message("ZYDIS_STATIC_DEFINE was renamed to ZYDIS_STATIC_BUILD.")
# define ZYDIS_STATIC_BUILD
#endif
#if defined(Zydis_EXPORTS)
# pragma message("Zydis_EXPORTS was renamed to ZYDIS_SHOULD_EXPORT.")
# define ZYDIS_SHOULD_EXPORT
#endif
/**
* Symbol is exported in shared library builds.
*/
#if defined(ZYDIS_STATIC_BUILD)
# define ZYDIS_EXPORT
#else
# if defined(ZYDIS_SHOULD_EXPORT)
# define ZYDIS_EXPORT ZYAN_DLLEXPORT
# else
# define ZYDIS_EXPORT ZYAN_DLLIMPORT
# endif
#endif
/**
* Symbol is not exported and for internal use only.
*/
#define ZYDIS_NO_EXPORT
#endif // ZYDIS_DEFINES_H

View File

@@ -0,0 +1,135 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Joel Hoener
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
* All-in-one convenience function providing the simplest possible way to use Zydis.
*/
#ifndef ZYDIS_DISASSEMBLER_H
#define ZYDIS_DISASSEMBLER_H
#include <Zydis/Decoder.h>
#include <Zydis/Formatter.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Types */
/* ============================================================================================== */
/**
* All commonly used information about a decoded instruction that Zydis can provide.
*
* This structure is filled in by calling `ZydisDisassembleIntel` or `ZydisDisassembleATT`.
*/
typedef struct ZydisDisassembledInstruction_
{
/**
* The runtime address that was passed when disassembling the instruction.
*/
ZyanU64 runtime_address;
/**
* General information about the decoded instruction in machine-readable format.
*/
ZydisDecodedInstruction info;
/**
* The operands of the decoded instruction in a machine-readable format.
*
* The amount of actual operands can be determined by inspecting the corresponding fields
* in the `info` member of this struct. Inspect `operand_count_visible` if you care about
* visible operands (those that are printed by the formatter) or `operand_count` if you're
* also interested in implicit operands (for example the registers implicitly accessed by
* `pushad`). Unused entries are zeroed.
*/
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
/**
* The textual, human-readable representation of the instruction.
*
* Guaranteed to be zero-terminated.
*/
char text[96];
} ZydisDisassembledInstruction;
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
/**
* Disassemble an instruction and format it to human-readable text in a single step (Intel syntax).
*
* @param machine_mode The machine mode to assume when disassembling. When in doubt, pass
* `ZYDIS_MACHINE_MODE_LONG_64` for what is typically referred to as
* "64-bit mode" or `ZYDIS_MACHINE_MODE_LEGACY_32` for "32-bit mode".
* @param runtime_address The program counter (`eip` / `rip`) to assume when formatting the
* instruction. Many instructions behave differently depending on the
* address they are located at.
* @param buffer A pointer to the raw instruction bytes that you wish to decode.
* @param length The length of the input buffer. Note that this can be bigger than the
* actual size of the instruction -- you don't have to know the size up
* front. This length is merely used to prevent Zydis from doing
* out-of-bounds reads on your buffer.
* @param instruction A pointer to receive the decoded instruction information. Can be
* uninitialized and reused on later calls.
*
* This is a convenience function intended as a quick path for getting started with using Zydis.
* It internally calls a range of other more advanced functions to obtain all commonly needed
* information about the instruction. It is likely that you won't need most of this information in
* practice, so it is advisable to instead call these more advanced functions directly if you're
* concerned about performance.
*
* This function essentially combines the following more advanced functions into a single call:
*
* - `ZydisDecoderInit`
* - `ZydisDecoderDecodeInstruction`
* - `ZydisDecoderDecodeOperands`
* - `ZydisFormatterInit`
* - `ZydisFormatterFormatInstruction`
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisDisassembleIntel(ZydisMachineMode machine_mode,
ZyanU64 runtime_address, const void* buffer, ZyanUSize length,
ZydisDisassembledInstruction *instruction);
/**
* Disassemble an instruction and format it to human-readable text in a single step (AT&T syntax).
*
* @copydetails ZydisDisassembleIntel
*/
ZYDIS_EXPORT ZyanStatus ZydisDisassembleATT(ZydisMachineMode machine_mode,
ZyanU64 runtime_address, const void* buffer, ZyanUSize length,
ZydisDisassembledInstruction *instruction);
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_DISASSEMBLER_H */

471
3rdparty/zydis/include/Zydis/Encoder.h vendored Normal file
View File

@@ -0,0 +1,471 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Mappa
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
* Functions for encoding instructions.
*/
#ifndef ZYDIS_ENCODER_H
#define ZYDIS_ENCODER_H
#include <Zycore/Types.h>
#include <Zydis/MetaInfo.h>
#include <Zydis/Register.h>
#include <Zydis/DecoderTypes.h>
#include <Zydis/Mnemonic.h>
#include <Zydis/Status.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Macros */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Constants */
/* ---------------------------------------------------------------------------------------------- */
/**
* Maximum number of encodable (explicit and implicit) operands
*/
#define ZYDIS_ENCODER_MAX_OPERANDS 5
// If asserts are failing here remember to update encoder table generator before fixing asserts
ZYAN_STATIC_ASSERT(ZYAN_BITS_TO_REPRESENT(ZYDIS_ENCODER_MAX_OPERANDS) == 3);
/**
* Combination of all user-encodable prefixes
*/
#define ZYDIS_ENCODABLE_PREFIXES (ZYDIS_ATTRIB_HAS_LOCK | \
ZYDIS_ATTRIB_HAS_REP | \
ZYDIS_ATTRIB_HAS_REPE | \
ZYDIS_ATTRIB_HAS_REPNE | \
ZYDIS_ATTRIB_HAS_BND | \
ZYDIS_ATTRIB_HAS_XACQUIRE | \
ZYDIS_ATTRIB_HAS_XRELEASE | \
ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN | \
ZYDIS_ATTRIB_HAS_BRANCH_TAKEN | \
ZYDIS_ATTRIB_HAS_NOTRACK | \
ZYDIS_ATTRIB_HAS_SEGMENT_CS | \
ZYDIS_ATTRIB_HAS_SEGMENT_SS | \
ZYDIS_ATTRIB_HAS_SEGMENT_DS | \
ZYDIS_ATTRIB_HAS_SEGMENT_ES | \
ZYDIS_ATTRIB_HAS_SEGMENT_FS | \
ZYDIS_ATTRIB_HAS_SEGMENT_GS)
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Enums and types */
/* ============================================================================================== */
/**
* Defines possible physical instruction encodings as bit flags, so multiple acceptable encodings
* can be specified simultaneously.
*/
typedef enum ZydisEncodableEncoding_
{
ZYDIS_ENCODABLE_ENCODING_DEFAULT = 0x00000000,
ZYDIS_ENCODABLE_ENCODING_LEGACY = 0x00000001,
ZYDIS_ENCODABLE_ENCODING_3DNOW = 0x00000002,
ZYDIS_ENCODABLE_ENCODING_XOP = 0x00000004,
ZYDIS_ENCODABLE_ENCODING_VEX = 0x00000008,
ZYDIS_ENCODABLE_ENCODING_EVEX = 0x00000010,
ZYDIS_ENCODABLE_ENCODING_MVEX = 0x00000020,
/**
* Maximum value of this enum.
*/
ZYDIS_ENCODABLE_ENCODING_MAX_VALUE = (ZYDIS_ENCODABLE_ENCODING_MVEX |
(ZYDIS_ENCODABLE_ENCODING_MVEX - 1)),
/**
* The minimum number of bits required to represent all values of this enum.
*/
ZYDIS_ENCODABLE_ENCODING_REQUIRED_BITS =
ZYAN_BITS_TO_REPRESENT(ZYDIS_ENCODABLE_ENCODING_MAX_VALUE)
} ZydisEncodableEncoding;
/**
* Defines encodable physical/effective sizes of relative immediate operands. See
* `ZydisEncoderRequest.branch_width` for more details.
*/
typedef enum ZydisBranchWidth_
{
ZYDIS_BRANCH_WIDTH_NONE,
ZYDIS_BRANCH_WIDTH_8,
ZYDIS_BRANCH_WIDTH_16,
ZYDIS_BRANCH_WIDTH_32,
ZYDIS_BRANCH_WIDTH_64,
/**
* Maximum value of this enum.
*/
ZYDIS_BRANCH_WIDTH_MAX_VALUE = ZYDIS_BRANCH_WIDTH_64,
/**
* The minimum number of bits required to represent all values of this enum.
*/
ZYDIS_BRANCH_WIDTH_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_BRANCH_WIDTH_MAX_VALUE)
} ZydisBranchWidth;
/**
* Defines possible values for address size hints. See `ZydisEncoderRequest` for more information
* about address size hints.
*/
typedef enum ZydisAddressSizeHint_
{
ZYDIS_ADDRESS_SIZE_HINT_NONE,
ZYDIS_ADDRESS_SIZE_HINT_16,
ZYDIS_ADDRESS_SIZE_HINT_32,
ZYDIS_ADDRESS_SIZE_HINT_64,
/**
* Maximum value of this enum.
*/
ZYDIS_ADDRESS_SIZE_HINT_MAX_VALUE = ZYDIS_ADDRESS_SIZE_HINT_64,
/**
* The minimum number of bits required to represent all values of this enum.
*/
ZYDIS_ADDRESS_SIZE_HINT_REQUIRED_BITS =
ZYAN_BITS_TO_REPRESENT(ZYDIS_ADDRESS_SIZE_HINT_MAX_VALUE)
} ZydisAddressSizeHint;
/**
* Defines possible values for operand size hints. See `ZydisEncoderRequest` for more information
* about operand size hints.
*/
typedef enum ZydisOperandSizeHint_
{
ZYDIS_OPERAND_SIZE_HINT_NONE,
ZYDIS_OPERAND_SIZE_HINT_8,
ZYDIS_OPERAND_SIZE_HINT_16,
ZYDIS_OPERAND_SIZE_HINT_32,
ZYDIS_OPERAND_SIZE_HINT_64,
/**
* Maximum value of this enum.
*/
ZYDIS_OPERAND_SIZE_HINT_MAX_VALUE = ZYDIS_OPERAND_SIZE_HINT_64,
/**
* The minimum number of bits required to represent all values of this enum.
*/
ZYDIS_OPERAND_SIZE_HINT_REQUIRED_BITS =
ZYAN_BITS_TO_REPRESENT(ZYDIS_OPERAND_SIZE_HINT_MAX_VALUE)
} ZydisOperandSizeHint;
/**
* Describes explicit or implicit instruction operand.
*/
typedef struct ZydisEncoderOperand_
{
/**
* The type of the operand.
*/
ZydisOperandType type;
/**
* Extended info for register-operands.
*/
struct ZydisEncoderOperandReg_
{
/**
* The register value.
*/
ZydisRegister value;
/**
* Is this 4th operand (`VEX`/`XOP`). Despite its name, `is4` encoding can sometimes be
* applied to 3rd operand instead of 4th. This field is used to resolve such ambiguities.
* For all other operands it should be set to `ZYAN_FALSE`.
*/
ZyanBool is4;
} reg;
/**
* Extended info for memory-operands.
*/
struct ZydisEncoderOperandMem_
{
/**
* The base register.
*/
ZydisRegister base;
/**
* The index register.
*/
ZydisRegister index;
/**
* The scale factor.
*/
ZyanU8 scale;
/**
* The displacement value. This value is always treated as 64-bit signed integer, so it's
* important to take this into account when specifying absolute addresses. For example
* to specify a 16-bit address 0x8000 in 16-bit mode it should be sign extended to
* `0xFFFFFFFFFFFF8000`. See `address_size_hint` for more information about absolute
* addresses.
*/
ZyanI64 displacement;
/**
* Size of this operand in bytes.
*/
ZyanU16 size;
} mem;
/**
* Extended info for pointer-operands.
*/
struct ZydisEncoderOperandPtr_
{
/**
* The segment value.
*/
ZyanU16 segment;
/**
* The offset value.
*/
ZyanU32 offset;
} ptr;
/**
* Extended info for immediate-operands.
*/
union ZydisEncoderOperandImm_
{
/**
* The unsigned immediate value.
*/
ZyanU64 u;
/**
* The signed immediate value.
*/
ZyanI64 s;
} imm;
} ZydisEncoderOperand;
/**
* Main structure consumed by the encoder. It represents full semantics of an instruction.
*/
typedef struct ZydisEncoderRequest_
{
/**
* The machine mode used to encode this instruction.
*/
ZydisMachineMode machine_mode;
/**
* This optional field can be used to restrict allowed physical encodings for desired
* instruction. Some mnemonics can be supported by more than one encoding, so this field can
* resolve ambiguities e.g. you can disable `AVX-512` extensions by prohibiting usage of `EVEX`
* prefix and allow only `VEX` variants.
*/
ZydisEncodableEncoding allowed_encodings;
/**
* The instruction-mnemonic.
*/
ZydisMnemonic mnemonic;
/**
* A combination of requested encodable prefixes (`ZYDIS_ATTRIB_HAS_*` flags) for desired
* instruction. See `ZYDIS_ENCODABLE_PREFIXES` for list of available prefixes.
*/
ZydisInstructionAttributes prefixes;
/**
* Branch type (required for branching instructions only). Use `ZYDIS_BRANCH_TYPE_NONE` to let
* encoder pick size-optimal branch type automatically (`short` and `near` are prioritized over
* `far`).
*/
ZydisBranchType branch_type;
/**
* Specifies physical size for relative immediate operands. Use `ZYDIS_BRANCH_WIDTH_NONE` to
* let encoder pick size-optimal branch width automatically. For segment:offset `far` branches
* this field applies to physical size of the offset part. For branching instructions without
* relative operands this field affects effective operand size attribute.
*/
ZydisBranchWidth branch_width;
/**
* Optional address size hint used to resolve ambiguities for some instructions. Generally
* encoder deduces address size from `ZydisEncoderOperand` structures that represent
* explicit and implicit operands. This hint resolves conflicts when instruction's hidden
* operands scale with address size attribute.
*
* This hint is also used for instructions with absolute memory addresses (memory operands with
* displacement and no registers). Since displacement field is a 64-bit signed integer it's not
* possible to determine actual size of the address value in all situations. This hint
* specifies size of the address value provided inside encoder request rather than desired
* address size attribute of encoded instruction. Use `ZYDIS_ADDRESS_SIZE_HINT_NONE` to assume
* address size default for specified machine mode.
*/
ZydisAddressSizeHint address_size_hint;
/**
* Optional operand size hint used to resolve ambiguities for some instructions. Generally
* encoder deduces operand size from `ZydisEncoderOperand` structures that represent
* explicit and implicit operands. This hint resolves conflicts when instruction's hidden
* operands scale with operand size attribute.
*/
ZydisOperandSizeHint operand_size_hint;
/**
* The number of instruction-operands.
*/
ZyanU8 operand_count;
/**
* Detailed info for all explicit and implicit instruction operands.
*/
ZydisEncoderOperand operands[ZYDIS_ENCODER_MAX_OPERANDS];
/**
* Extended info for `EVEX` instructions.
*/
struct ZydisEncoderRequestEvexFeatures_
{
/**
* The broadcast-mode. Specify `ZYDIS_BROADCAST_MODE_INVALID` for instructions with
* static broadcast functionality.
*/
ZydisBroadcastMode broadcast;
/**
* The rounding-mode.
*/
ZydisRoundingMode rounding;
/**
* Signals, if the `SAE` (suppress-all-exceptions) functionality should be enabled for
* the instruction.
*/
ZyanBool sae;
/**
* Signals, if the zeroing-mask functionality should be enabled for the instruction.
* Specify `ZYAN_TRUE` for instructions with forced zeroing mask.
*/
ZyanBool zeroing_mask;
} evex;
/**
* Extended info for `MVEX` instructions.
*/
struct ZydisEncoderRequestMvexFeatures_
{
/**
* The broadcast-mode.
*/
ZydisBroadcastMode broadcast;
/**
* The data-conversion mode.
*/
ZydisConversionMode conversion;
/**
* The rounding-mode.
*/
ZydisRoundingMode rounding;
/**
* The `AVX` register-swizzle mode.
*/
ZydisSwizzleMode swizzle;
/**
* Signals, if the `SAE` (suppress-all-exceptions) functionality is enabled for
* the instruction.
*/
ZyanBool sae;
/**
* Signals, if the instruction has a memory-eviction-hint (`KNC` only).
*/
ZyanBool eviction_hint;
} mvex;
} ZydisEncoderRequest;
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
/**
* @addtogroup encoder Encoder
* Functions allowing encoding of instruction bytes from a machine interpretable struct.
* @{
*/
/**
* Encodes instruction with semantics specified in encoder request structure.
*
* @param request A pointer to the `ZydisEncoderRequest` struct.
* @param buffer A pointer to the output buffer receiving encoded instruction.
* @param length A pointer to the variable containing length of the output buffer. Upon
* successful return this variable receives length of the encoded instruction.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisEncoderEncodeInstruction(const ZydisEncoderRequest *request,
void *buffer, ZyanUSize *length);
/**
* Encodes instruction with semantics specified in encoder request structure. This function expects
* absolute addresses inside encoder request instead of `EIP`/`RIP`-relative values. Function
* predicts final instruction length prior to encoding and writes back calculated relative operands
* to provided encoder request.
*
* @param request A pointer to the `ZydisEncoderRequest` struct.
* @param buffer A pointer to the output buffer receiving encoded instruction.
* @param length A pointer to the variable containing length of the output buffer. Upon
* successful return this variable receives length of the encoded
* instruction.
* @param runtime_address The runtime address of the instruction.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisEncoderEncodeInstructionAbsolute(ZydisEncoderRequest *request,
void *buffer, ZyanUSize *length, ZyanU64 runtime_address);
/**
* Converts decoded instruction to encoder request that can be passed to
* `ZydisEncoderEncodeInstruction`.
*
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param operands A pointer to the decoded operands.
* @param operand_count The operand count.
* @param request A pointer to the `ZydisEncoderRequest` struct, that receives
* information necessary for encoder to re-encode the instruction.
*
* This function performs simple structure conversion and does minimal sanity checks on the
* input. There's no guarantee that produced request will be accepted by
* `ZydisEncoderEncodeInstruction` if malformed `ZydisDecodedInstruction` or malformed
* `ZydisDecodedOperands` is passed to this function.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisEncoderDecodedInstructionToEncoderRequest(
const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operands,
ZyanU8 operand_count, ZydisEncoderRequest* request);
/**
* Fills provided buffer with `NOP` instructions using longest possible multi-byte instructions.
*
* @param buffer A pointer to the output buffer receiving encoded instructions.
* @param length Size of the output buffer.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisEncoderNopFill(void *buffer, ZyanUSize length);
/** @} */
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_ENCODER_H */

View File

@@ -61,7 +61,7 @@ extern "C" {
/* ---------------------------------------------------------------------------------------------- */
/**
* Defines the `ZydisFormatterStyle` enum.
* Enum selecting the syntax to format the disassembly in.
*/
typedef enum ZydisFormatterStyle_
{
@@ -96,7 +96,7 @@ typedef enum ZydisFormatterStyle_
/* ---------------------------------------------------------------------------------------------- */
/**
* Defines the `ZydisFormatterProperty` enum.
* Enum selecting a property of the formatter.
*/
typedef enum ZydisFormatterProperty_
{
@@ -176,16 +176,16 @@ typedef enum ZydisFormatterProperty_
/**
* Controls the padding of absolute address values.
*
* Pass `ZYDIS_PADDING_DISABLED` to disable padding, `ZYDIS_PADDING_AUTO` to padd all
* addresses to the current stack width (hexadecimal only), or any other integer value for
* Pass `ZYDIS_PADDING_DISABLED` to disable padding, `ZYDIS_PADDING_AUTO` to pad all
* addresses to the current address width (hexadecimal only), or any other integer value for
* custom padding.
*/
ZYDIS_FORMATTER_PROP_ADDR_PADDING_ABSOLUTE,
/**
* Controls the padding of relative address values.
*
* Pass `ZYDIS_PADDING_DISABLED` to disable padding, `ZYDIS_PADDING_AUTO` to padd all
* addresses to the current stack width (hexadecimal only), or any other integer value for
* Pass `ZYDIS_PADDING_DISABLED` to disable padding, `ZYDIS_PADDING_AUTO` to pad all
* addresses to the current address width (hexadecimal only), or any other integer value for
* custom padding.
*/
ZYDIS_FORMATTER_PROP_ADDR_PADDING_RELATIVE,
@@ -262,6 +262,8 @@ typedef enum ZydisFormatterProperty_
* Controls the letter-case for decorators.
*
* Pass `ZYAN_TRUE` as value to format in uppercase or `ZYAN_FALSE` to format in lowercase.
*
* WARNING: this is currently not implemented (ignored).
*/
ZYDIS_FORMATTER_PROP_UPPERCASE_DECORATORS,
@@ -298,6 +300,16 @@ typedef enum ZydisFormatterProperty_
* The default value is `ZYAN_TRUE`.
*/
ZYDIS_FORMATTER_PROP_HEX_UPPERCASE,
/**
* Controls whether to prepend hexadecimal values with a leading zero if the first character
* is non-numeric.
*
* Pass `ZYAN_TRUE` to prepend a leading zero if the first character is non-numeric or
* `ZYAN_FALSE` to disable this functionality.
*
* The default value is `ZYAN_FALSE`.
*/
ZYDIS_FORMATTER_PROP_HEX_FORCE_LEADING_NUMBER,
/**
* Controls the prefix for hexadecimal values.
*
@@ -332,7 +344,7 @@ typedef enum ZydisFormatterProperty_
/* ---------------------------------------------------------------------------------------------- */
/**
* Defines the `ZydisNumericBase` enum.
* Enum defining different mantissae to be used during formatting.
*/
typedef enum ZydisNumericBase_
{
@@ -358,7 +370,7 @@ typedef enum ZydisNumericBase_
/* ---------------------------------------------------------------------------------------------- */
/**
* Defines the `ZydisSignedness` enum.
* Enum defining the signeness of integers to be used during formatting.
*/
typedef enum ZydisSignedness_
{
@@ -389,7 +401,8 @@ typedef enum ZydisSignedness_
/* ---------------------------------------------------------------------------------------------- */
/**
* Defines the `ZydisPadding` enum.
* Enum definining magic values that receive special treatment when used as padding properties
* of the formatter.
*/
typedef enum ZydisPadding_
{
@@ -418,7 +431,7 @@ typedef enum ZydisPadding_
/* ---------------------------------------------------------------------------------------------- */
/**
* Defines the `ZydisFormatterFunction` enum.
* Enum selecting a formatter function to be replaced with hooks.
*
* Do NOT change the order of the values this enum or the function fields inside the
* `ZydisFormatter` struct.
@@ -582,7 +595,7 @@ typedef enum ZydisFormatterFunction_
/* ---------------------------------------------------------------------------------------------- */
/**
* Defines the `ZydisDecorator` enum.
* Enum of all decorator types.
*/
typedef enum ZydisDecorator_
{
@@ -633,7 +646,7 @@ typedef enum ZydisDecorator_
typedef struct ZydisFormatter_ ZydisFormatter;
/**
* Defines the `ZydisFormatterContext` struct.
* Context structure that that is passed to all formatter.
*/
typedef struct ZydisFormatterContext_
{
@@ -641,6 +654,10 @@ typedef struct ZydisFormatterContext_
* A pointer to the `ZydisDecodedInstruction` struct.
*/
const ZydisDecodedInstruction* instruction;
/**
* A pointer to the first `ZydisDecodedOperand` struct of the instruction.
*/
const ZydisDecodedOperand* operands;
/**
* A pointer to the `ZydisDecodedOperand` struct.
*/
@@ -651,6 +668,9 @@ typedef struct ZydisFormatterContext_
ZyanU64 runtime_address;
/**
* A pointer to user-defined data.
*
* This is the value that was previously passed as the `user_data` argument to
* @ref ZydisFormatterFormatInstruction or @ref ZydisFormatterTokenizeOperand.
*/
void* user_data;
} ZydisFormatterContext;
@@ -741,7 +761,7 @@ typedef ZyanStatus (*ZydisFormatterDecoratorFunc)(const ZydisFormatter* formatte
/* ---------------------------------------------------------------------------------------------- */
/**
* Defines the `ZydisFormatter` struct.
* Context structure keeping track of internal state of the formatter.
*
* All fields in this struct should be considered as "private". Any changes may lead to unexpected
* behavior.
@@ -780,73 +800,77 @@ struct ZydisFormatter_
*/
ZyanBool print_branch_size;
/**
* The `ZYDIS_FORMATTER_DETAILED_PREFIXES` property.
* The `ZYDIS_FORMATTER_PROP_DETAILED_PREFIXES` property.
*/
ZyanBool detailed_prefixes;
/**
* The `ZYDIS_FORMATTER_ADDR_BASE` property.
* The `ZYDIS_FORMATTER_PROP_ADDR_BASE` property.
*/
ZydisNumericBase addr_base;
/**
* The `ZYDIS_FORMATTER_ADDR_SIGNEDNESS` property.
* The `ZYDIS_FORMATTER_PROP_ADDR_SIGNEDNESS` property.
*/
ZydisSignedness addr_signedness;
/**
* The `ZYDIS_FORMATTER_ADDR_PADDING_ABSOLUTE` property.
* The `ZYDIS_FORMATTER_PROP_ADDR_PADDING_ABSOLUTE` property.
*/
ZydisPadding addr_padding_absolute;
/**
* The `ZYDIS_FORMATTER_ADDR_PADDING_RELATIVE` property.
* The `ZYDIS_FORMATTER_PROP_ADDR_PADDING_RELATIVE` property.
*/
ZydisPadding addr_padding_relative;
/**
* The `ZYDIS_FORMATTER_DISP_BASE` property.
* The `ZYDIS_FORMATTER_PROP_DISP_BASE` property.
*/
ZydisNumericBase disp_base;
/**
* The `ZYDIS_FORMATTER_DISP_SIGNEDNESS` property.
* The `ZYDIS_FORMATTER_PROP_DISP_SIGNEDNESS` property.
*/
ZydisSignedness disp_signedness;
/**
* The `ZYDIS_FORMATTER_DISP_PADDING` property.
* The `ZYDIS_FORMATTER_PROP_DISP_PADDING` property.
*/
ZydisPadding disp_padding;
/**
* The `ZYDIS_FORMATTER_IMM_BASE` property.
* The `ZYDIS_FORMATTER_PROP_IMM_BASE` property.
*/
ZydisNumericBase imm_base;
/**
* The `ZYDIS_FORMATTER_IMM_SIGNEDNESS` property.
* The `ZYDIS_FORMATTER_PROP_IMM_SIGNEDNESS` property.
*/
ZydisSignedness imm_signedness;
/**
* The `ZYDIS_FORMATTER_IMM_PADDING` property.
* The `ZYDIS_FORMATTER_PROP_IMM_PADDING` property.
*/
ZydisPadding imm_padding;
/**
* The `ZYDIS_FORMATTER_UPPERCASE_PREFIXES` property.
* The `ZYDIS_FORMATTER_PROP_UPPERCASE_PREFIXES` property.
*/
ZyanI32 case_prefixes;
/**
* The `ZYDIS_FORMATTER_UPPERCASE_MNEMONIC` property.
* The `ZYDIS_FORMATTER_PROP_UPPERCASE_MNEMONIC` property.
*/
ZyanI32 case_mnemonic;
/**
* The `ZYDIS_FORMATTER_UPPERCASE_REGISTERS` property.
* The `ZYDIS_FORMATTER_PROP_UPPERCASE_REGISTERS` property.
*/
ZyanI32 case_registers;
/**
* The `ZYDIS_FORMATTER_UPPERCASE_TYPECASTS` property.
* The `ZYDIS_FORMATTER_PROP_UPPERCASE_TYPECASTS` property.
*/
ZyanI32 case_typecasts;
/**
* The `ZYDIS_FORMATTER_UPPERCASE_DECORATORS` property.
* The `ZYDIS_FORMATTER_PROP_UPPERCASE_DECORATORS` property.
*/
ZyanI32 case_decorators;
/**
* The `ZYDIS_FORMATTER_HEX_UPPERCASE` property.
* The `ZYDIS_FORMATTER_PROP_HEX_UPPERCASE` property.
*/
ZyanBool hex_uppercase;
/**
* The `ZYDIS_FORMATTER_PROP_HEX_FORCE_LEADING_NUMBER` property.
*/
ZyanBool hex_force_leading_number;
/**
* The number formats for all numeric bases.
*
@@ -1020,45 +1044,35 @@ ZYDIS_EXPORT ZyanStatus ZydisFormatterSetHook(ZydisFormatter* formatter,
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param buffer A pointer to the output buffer.
* @param length The length of the output buffer (in characters).
* @param runtime_address The runtime address of the instruction or `ZYDIS_RUNTIME_ADDRESS_NONE`
* to print relative addresses.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatInstruction(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, char* buffer, ZyanUSize length,
ZyanU64 runtime_address);
/**
* Formats the given instruction and writes it into the output buffer.
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param operands A pointer to the decoded operands array.
* @param operand_count The length of the `operands` array. Must be equal to or greater than
* the value of `instruction->operand_count_visible`.
* @param buffer A pointer to the output buffer.
* @param length The length of the output buffer (in characters).
* @param runtime_address The runtime address of the instruction or `ZYDIS_RUNTIME_ADDRESS_NONE`
* to print relative addresses.
* @param user_data A pointer to user-defined data which can be used in custom formatter
* callbacks.
* callbacks. Can be `ZYAN_NULL`.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, char* buffer, ZyanUSize length,
ZyanU64 runtime_address, void* user_data);
ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatInstruction(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operands,
ZyanU8 operand_count, char* buffer, ZyanUSize length, ZyanU64 runtime_address,
void* user_data);
/**
* Formats the given operand and writes it into the output buffer.
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param index The index of the operand to format.
* @param operand A pointer to the `ZydisDecodedOperand` struct of the operand to format.
* @param buffer A pointer to the output buffer.
* @param length The length of the output buffer (in characters).
* @param runtime_address The runtime address of the instruction or `ZYDIS_RUNTIME_ADDRESS_NONE`
* to print relative addresses.
* @param user_data A pointer to user-defined data which can be used in custom formatter
* callbacks. Can be `ZYAN_NULL`.
*
* @return A zyan status code.
*
@@ -1066,30 +1080,8 @@ ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter*
* complete instruction.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatOperand(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, ZyanU8 index, char* buffer, ZyanUSize length,
ZyanU64 runtime_address);
/**
* Formats the given operand and writes it into the output buffer.
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param index The index of the operand to format.
* @param buffer A pointer to the output buffer.
* @param length The length of the output buffer (in characters).
* @param runtime_address The runtime address of the instruction or `ZYDIS_RUNTIME_ADDRESS_NONE`
* to print relative addresses.
* @param user_data A pointer to user-defined data which can be used in custom formatter
* callbacks.
*
* @return A zyan status code.
*
* Use `ZydisFormatterFormatInstruction` or `ZydisFormatterFormatInstructionEx` to format a
* complete instruction.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatOperandEx(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, ZyanU8 index, char* buffer, ZyanUSize length,
ZyanU64 runtime_address, void* user_data);
const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand,
char* buffer, ZyanUSize length, ZyanU64 runtime_address, void* user_data);
/* ---------------------------------------------------------------------------------------------- */
/* Tokenizing */
@@ -1100,80 +1092,46 @@ ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatOperandEx(const ZydisFormatter* form
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param operands A pointer to the decoded operands array.
* @param operand_count The length of the `operands` array. Must be equal to or greater than
* the value of `instruction->operand_count_visible`.
* @param buffer A pointer to the output buffer.
* @param length The length of the output buffer (in bytes).
* @param runtime_address The runtime address of the instruction or `ZYDIS_RUNTIME_ADDRESS_NONE`
* to print relative addresses.
* @param token Receives a pointer to the first token in the output buffer.
* @param user_data A pointer to user-defined data which can be used in custom formatter
* callbacks. Can be `ZYAN_NULL`.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenizeInstruction(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, void* buffer, ZyanUSize length,
ZyanU64 runtime_address, ZydisFormatterTokenConst** token);
/**
* Tokenizes the given instruction and writes it into the output buffer.
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param buffer A pointer to the output buffer.
* @param length The length of the output buffer (in bytes).
* @param runtime_address The runtime address of the instruction or `ZYDIS_RUNTIME_ADDRESS_NONE`
* to print relative addresses.
* @param token Receives a pointer to the first token in the output buffer.
* @param user_data A pointer to user-defined data which can be used in custom formatter
* callbacks.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenizeInstructionEx(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, void* buffer, ZyanUSize length,
ZyanU64 runtime_address, ZydisFormatterTokenConst** token, void* user_data);
const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operands,
ZyanU8 operand_count, void* buffer, ZyanUSize length, ZyanU64 runtime_address,
ZydisFormatterTokenConst** token, void* user_data);
/**
* Tokenizes the given operand and writes it into the output buffer.
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param index The index of the operand to format.
* @param operand A pointer to the `ZydisDecodedOperand` struct of the operand to format.
* @param buffer A pointer to the output buffer.
* @param length The length of the output buffer (in bytes).
* @param runtime_address The runtime address of the instruction or `ZYDIS_RUNTIME_ADDRESS_NONE`
* to print relative addresses.
* @param token Receives a pointer to the first token in the output buffer.
* @param user_data A pointer to user-defined data which can be used in custom formatter
* callbacks. Can be `ZYAN_NULL`.
*
* @return A zyan status code.
*
* Use `ZydisFormatterTokenizeInstruction` or `ZydisFormatterTokenizeInstructionEx` to tokenize a
* complete instruction.
* Use `ZydisFormatterTokenizeInstruction` to tokenize a complete instruction.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenizeOperand(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, ZyanU8 index, void* buffer, ZyanUSize length,
ZyanU64 runtime_address, ZydisFormatterTokenConst** token);
/**
* Tokenizes the given operand and writes it into the output buffer.
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param index The index of the operand to format.
* @param buffer A pointer to the output buffer.
* @param length The length of the output buffer (in bytes).
* @param runtime_address The runtime address of the instruction or `ZYDIS_RUNTIME_ADDRESS_NONE`
* to print relative addresses.
* @param token Receives a pointer to the first token in the output buffer.
* @param user_data A pointer to user-defined data which can be used in custom formatter
* callbacks.
*
* @return A zyan status code.
*
* Use `ZydisFormatterTokenizeInstruction` or `ZydisFormatterTokenizeInstructionEx` to tokenize a
* complete instruction.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenizeOperandEx(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, ZyanU8 index, void* buffer, ZyanUSize length,
ZyanU64 runtime_address, ZydisFormatterTokenConst** token, void* user_data);
const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand,
void* buffer, ZyanUSize length, ZyanU64 runtime_address, ZydisFormatterTokenConst** token,
void* user_data);
/* ---------------------------------------------------------------------------------------------- */

View File

@@ -32,9 +32,9 @@
#ifndef ZYDIS_FORMATTER_TOKEN_H
#define ZYDIS_FORMATTER_TOKEN_H
#include <ZydisExportConfig.h>
#include <Zycore/String.h>
#include <Zycore/Types.h>
#include <Zydis/Defines.h>
#include <Zydis/Status.h>
#ifdef __cplusplus
@@ -50,7 +50,7 @@ extern "C" {
/* ---------------------------------------------------------------------------------------------- */
/**
* @biref Defines the `ZydisTokenType` data-type.
* Defines the `ZydisTokenType` data-type.
*/
typedef ZyanU8 ZydisTokenType;

View File

@@ -10,6 +10,7 @@ typedef enum ZydisISAExt_
ZYDIS_ISA_EXT_AMD3DNOW_PREFETCH,
ZYDIS_ISA_EXT_AMD_INVLPGB,
ZYDIS_ISA_EXT_AMX_BF16,
ZYDIS_ISA_EXT_AMX_FP16,
ZYDIS_ISA_EXT_AMX_INT8,
ZYDIS_ISA_EXT_AMX_TILE,
ZYDIS_ISA_EXT_AVX,
@@ -18,7 +19,11 @@ typedef enum ZydisISAExt_
ZYDIS_ISA_EXT_AVX512EVEX,
ZYDIS_ISA_EXT_AVX512VEX,
ZYDIS_ISA_EXT_AVXAES,
ZYDIS_ISA_EXT_AVX_IFMA,
ZYDIS_ISA_EXT_AVX_NE_CONVERT,
ZYDIS_ISA_EXT_AVX_VNNI,
ZYDIS_ISA_EXT_AVX_VNNI_INT16,
ZYDIS_ISA_EXT_AVX_VNNI_INT8,
ZYDIS_ISA_EXT_BASE,
ZYDIS_ISA_EXT_BMI1,
ZYDIS_ISA_EXT_BMI2,
@@ -34,6 +39,7 @@ typedef enum ZydisISAExt_
ZYDIS_ISA_EXT_FMA4,
ZYDIS_ISA_EXT_GFNI,
ZYDIS_ISA_EXT_HRESET,
ZYDIS_ISA_EXT_ICACHE_PREFETCH,
ZYDIS_ISA_EXT_INVPCID,
ZYDIS_ISA_EXT_KEYLOCKER,
ZYDIS_ISA_EXT_KEYLOCKER_WIDE,
@@ -49,13 +55,17 @@ typedef enum ZydisISAExt_
ZYDIS_ISA_EXT_MOVBE,
ZYDIS_ISA_EXT_MOVDIR,
ZYDIS_ISA_EXT_MPX,
ZYDIS_ISA_EXT_MSRLIST,
ZYDIS_ISA_EXT_PADLOCK,
ZYDIS_ISA_EXT_PAUSE,
ZYDIS_ISA_EXT_PBNDKB,
ZYDIS_ISA_EXT_PCLMULQDQ,
ZYDIS_ISA_EXT_PCOMMIT,
ZYDIS_ISA_EXT_PCONFIG,
ZYDIS_ISA_EXT_PKU,
ZYDIS_ISA_EXT_PREFETCHWT1,
ZYDIS_ISA_EXT_PT,
ZYDIS_ISA_EXT_RAO_INT,
ZYDIS_ISA_EXT_RDPID,
ZYDIS_ISA_EXT_RDPRU,
ZYDIS_ISA_EXT_RDRAND,
@@ -67,6 +77,9 @@ typedef enum ZydisISAExt_
ZYDIS_ISA_EXT_SGX,
ZYDIS_ISA_EXT_SGX_ENCLV,
ZYDIS_ISA_EXT_SHA,
ZYDIS_ISA_EXT_SHA512,
ZYDIS_ISA_EXT_SM3,
ZYDIS_ISA_EXT_SM4,
ZYDIS_ISA_EXT_SMAP,
ZYDIS_ISA_EXT_SMX,
ZYDIS_ISA_EXT_SNP,
@@ -86,6 +99,7 @@ typedef enum ZydisISAExt_
ZYDIS_ISA_EXT_VPCLMULQDQ,
ZYDIS_ISA_EXT_VTX,
ZYDIS_ISA_EXT_WAITPKG,
ZYDIS_ISA_EXT_WRMSRNS,
ZYDIS_ISA_EXT_X87,
ZYDIS_ISA_EXT_XOP,
ZYDIS_ISA_EXT_XSAVE,

View File

@@ -8,7 +8,9 @@ typedef enum ZydisISASet_
ZYDIS_ISA_SET_AES,
ZYDIS_ISA_SET_AMD,
ZYDIS_ISA_SET_AMD3DNOW,
ZYDIS_ISA_SET_AMD_INVLPGB,
ZYDIS_ISA_SET_AMX_BF16,
ZYDIS_ISA_SET_AMX_FP16,
ZYDIS_ISA_SET_AMX_INT8,
ZYDIS_ISA_SET_AMX_TILE,
ZYDIS_ISA_SET_AVX,
@@ -80,7 +82,11 @@ typedef enum ZydisISASet_
ZYDIS_ISA_SET_AVX512_VPOPCNTDQ_512,
ZYDIS_ISA_SET_AVXAES,
ZYDIS_ISA_SET_AVX_GFNI,
ZYDIS_ISA_SET_AVX_IFMA,
ZYDIS_ISA_SET_AVX_NE_CONVERT,
ZYDIS_ISA_SET_AVX_VNNI,
ZYDIS_ISA_SET_AVX_VNNI_INT16,
ZYDIS_ISA_SET_AVX_VNNI_INT8,
ZYDIS_ISA_SET_BMI1,
ZYDIS_ISA_SET_BMI2,
ZYDIS_ISA_SET_CET,
@@ -95,6 +101,7 @@ typedef enum ZydisISASet_
ZYDIS_ISA_SET_F16C,
ZYDIS_ISA_SET_FAT_NOP,
ZYDIS_ISA_SET_FCMOV,
ZYDIS_ISA_SET_FCOMI,
ZYDIS_ISA_SET_FMA,
ZYDIS_ISA_SET_FMA4,
ZYDIS_ISA_SET_FXSAVE,
@@ -108,6 +115,7 @@ typedef enum ZydisISASet_
ZYDIS_ISA_SET_I486,
ZYDIS_ISA_SET_I486REAL,
ZYDIS_ISA_SET_I86,
ZYDIS_ISA_SET_ICACHE_PREFETCH,
ZYDIS_ISA_SET_INVPCID,
ZYDIS_ISA_SET_KEYLOCKER,
ZYDIS_ISA_SET_KEYLOCKER_WIDE,
@@ -127,12 +135,15 @@ typedef enum ZydisISASet_
ZYDIS_ISA_SET_MOVBE,
ZYDIS_ISA_SET_MOVDIR,
ZYDIS_ISA_SET_MPX,
ZYDIS_ISA_SET_MSRLIST,
ZYDIS_ISA_SET_PADLOCK_ACE,
ZYDIS_ISA_SET_PADLOCK_PHE,
ZYDIS_ISA_SET_PADLOCK_PMM,
ZYDIS_ISA_SET_PADLOCK_RNG,
ZYDIS_ISA_SET_PAUSE,
ZYDIS_ISA_SET_PBNDKB,
ZYDIS_ISA_SET_PCLMULQDQ,
ZYDIS_ISA_SET_PCOMMIT,
ZYDIS_ISA_SET_PCONFIG,
ZYDIS_ISA_SET_PENTIUMMMX,
ZYDIS_ISA_SET_PENTIUMREAL,
@@ -142,6 +153,7 @@ typedef enum ZydisISASet_
ZYDIS_ISA_SET_PREFETCHWT1,
ZYDIS_ISA_SET_PREFETCH_NOP,
ZYDIS_ISA_SET_PT,
ZYDIS_ISA_SET_RAO_INT,
ZYDIS_ISA_SET_RDPID,
ZYDIS_ISA_SET_RDPMC,
ZYDIS_ISA_SET_RDPRU,
@@ -154,8 +166,12 @@ typedef enum ZydisISASet_
ZYDIS_ISA_SET_SGX,
ZYDIS_ISA_SET_SGX_ENCLV,
ZYDIS_ISA_SET_SHA,
ZYDIS_ISA_SET_SHA512,
ZYDIS_ISA_SET_SM3,
ZYDIS_ISA_SET_SM4,
ZYDIS_ISA_SET_SMAP,
ZYDIS_ISA_SET_SMX,
ZYDIS_ISA_SET_SNP,
ZYDIS_ISA_SET_SSE,
ZYDIS_ISA_SET_SSE2,
ZYDIS_ISA_SET_SSE2MMX,
@@ -178,6 +194,7 @@ typedef enum ZydisISASet_
ZYDIS_ISA_SET_VPCLMULQDQ,
ZYDIS_ISA_SET_VTX,
ZYDIS_ISA_SET_WAITPKG,
ZYDIS_ISA_SET_WRMSRNS,
ZYDIS_ISA_SET_X87,
ZYDIS_ISA_SET_XOP,
ZYDIS_ISA_SET_XSAVE,

View File

@@ -17,6 +17,7 @@ typedef enum ZydisInstructionCategory_
ZYDIS_CATEGORY_AVX512_BITALG,
ZYDIS_CATEGORY_AVX512_VBMI,
ZYDIS_CATEGORY_AVX512_VP2INTERSECT,
ZYDIS_CATEGORY_AVX_IFMA,
ZYDIS_CATEGORY_BINARY,
ZYDIS_CATEGORY_BITBYTE,
ZYDIS_CATEGORY_BLEND,
@@ -63,9 +64,12 @@ typedef enum ZydisInstructionCategory_
ZYDIS_CATEGORY_MMX,
ZYDIS_CATEGORY_MOVDIR,
ZYDIS_CATEGORY_MPX,
ZYDIS_CATEGORY_MSRLIST,
ZYDIS_CATEGORY_NOP,
ZYDIS_CATEGORY_PADLOCK,
ZYDIS_CATEGORY_PBNDKB,
ZYDIS_CATEGORY_PCLMULQDQ,
ZYDIS_CATEGORY_PCOMMIT,
ZYDIS_CATEGORY_PCONFIG,
ZYDIS_CATEGORY_PKU,
ZYDIS_CATEGORY_POP,
@@ -87,6 +91,7 @@ typedef enum ZydisInstructionCategory_
ZYDIS_CATEGORY_SETCC,
ZYDIS_CATEGORY_SGX,
ZYDIS_CATEGORY_SHA,
ZYDIS_CATEGORY_SHA512,
ZYDIS_CATEGORY_SHIFT,
ZYDIS_CATEGORY_SMAP,
ZYDIS_CATEGORY_SSE,
@@ -108,6 +113,7 @@ typedef enum ZydisInstructionCategory_
ZYDIS_CATEGORY_VTX,
ZYDIS_CATEGORY_WAITPKG,
ZYDIS_CATEGORY_WIDENOP,
ZYDIS_CATEGORY_WRMSRNS,
ZYDIS_CATEGORY_X87_ALU,
ZYDIS_CATEGORY_XOP,
ZYDIS_CATEGORY_XSAVE,

View File

@@ -6,7 +6,9 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_INVALID,
ZYDIS_MNEMONIC_AAA,
ZYDIS_MNEMONIC_AAD,
ZYDIS_MNEMONIC_AADD,
ZYDIS_MNEMONIC_AAM,
ZYDIS_MNEMONIC_AAND,
ZYDIS_MNEMONIC_AAS,
ZYDIS_MNEMONIC_ADC,
ZYDIS_MNEMONIC_ADCX,
@@ -38,7 +40,9 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_ANDNPS,
ZYDIS_MNEMONIC_ANDPD,
ZYDIS_MNEMONIC_ANDPS,
ZYDIS_MNEMONIC_AOR,
ZYDIS_MNEMONIC_ARPL,
ZYDIS_MNEMONIC_AXOR,
ZYDIS_MNEMONIC_BEXTR,
ZYDIS_MNEMONIC_BLCFILL,
ZYDIS_MNEMONIC_BLCI,
@@ -519,6 +523,7 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_PAVGW,
ZYDIS_MNEMONIC_PBLENDVB,
ZYDIS_MNEMONIC_PBLENDW,
ZYDIS_MNEMONIC_PBNDKB,
ZYDIS_MNEMONIC_PCLMULQDQ,
ZYDIS_MNEMONIC_PCMPEQB,
ZYDIS_MNEMONIC_PCMPEQD,
@@ -532,6 +537,7 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_PCMPGTW,
ZYDIS_MNEMONIC_PCMPISTRI,
ZYDIS_MNEMONIC_PCMPISTRM,
ZYDIS_MNEMONIC_PCOMMIT,
ZYDIS_MNEMONIC_PCONFIG,
ZYDIS_MNEMONIC_PDEP,
ZYDIS_MNEMONIC_PEXT,
@@ -615,6 +621,8 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_POPFQ,
ZYDIS_MNEMONIC_POR,
ZYDIS_MNEMONIC_PREFETCH,
ZYDIS_MNEMONIC_PREFETCHIT0,
ZYDIS_MNEMONIC_PREFETCHIT1,
ZYDIS_MNEMONIC_PREFETCHNTA,
ZYDIS_MNEMONIC_PREFETCHT0,
ZYDIS_MNEMONIC_PREFETCHT1,
@@ -675,6 +683,7 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_RDFSBASE,
ZYDIS_MNEMONIC_RDGSBASE,
ZYDIS_MNEMONIC_RDMSR,
ZYDIS_MNEMONIC_RDMSRLIST,
ZYDIS_MNEMONIC_RDPID,
ZYDIS_MNEMONIC_RDPKRU,
ZYDIS_MNEMONIC_RDPMC,
@@ -788,6 +797,7 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_TDPBSUD,
ZYDIS_MNEMONIC_TDPBUSD,
ZYDIS_MNEMONIC_TDPBUUD,
ZYDIS_MNEMONIC_TDPFP16PS,
ZYDIS_MNEMONIC_TEST,
ZYDIS_MNEMONIC_TESTUI,
ZYDIS_MNEMONIC_TILELOADD,
@@ -839,6 +849,8 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_VANDNPS,
ZYDIS_MNEMONIC_VANDPD,
ZYDIS_MNEMONIC_VANDPS,
ZYDIS_MNEMONIC_VBCSTNEBF162PS,
ZYDIS_MNEMONIC_VBCSTNESH2PS,
ZYDIS_MNEMONIC_VBLENDMPD,
ZYDIS_MNEMONIC_VBLENDMPS,
ZYDIS_MNEMONIC_VBLENDPD,
@@ -880,6 +892,10 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_VCVTFXPNTPS2UDQ,
ZYDIS_MNEMONIC_VCVTFXPNTUDQ2PS,
ZYDIS_MNEMONIC_VCVTNE2PS2BF16,
ZYDIS_MNEMONIC_VCVTNEEBF162PS,
ZYDIS_MNEMONIC_VCVTNEEPH2PS,
ZYDIS_MNEMONIC_VCVTNEOBF162PS,
ZYDIS_MNEMONIC_VCVTNEOPH2PS,
ZYDIS_MNEMONIC_VCVTNEPS2BF16,
ZYDIS_MNEMONIC_VCVTPD2DQ,
ZYDIS_MNEMONIC_VCVTPD2PH,
@@ -1341,10 +1357,22 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_VPCOMW,
ZYDIS_MNEMONIC_VPCONFLICTD,
ZYDIS_MNEMONIC_VPCONFLICTQ,
ZYDIS_MNEMONIC_VPDPBSSD,
ZYDIS_MNEMONIC_VPDPBSSDS,
ZYDIS_MNEMONIC_VPDPBSUD,
ZYDIS_MNEMONIC_VPDPBSUDS,
ZYDIS_MNEMONIC_VPDPBUSD,
ZYDIS_MNEMONIC_VPDPBUSDS,
ZYDIS_MNEMONIC_VPDPBUUD,
ZYDIS_MNEMONIC_VPDPBUUDS,
ZYDIS_MNEMONIC_VPDPWSSD,
ZYDIS_MNEMONIC_VPDPWSSDS,
ZYDIS_MNEMONIC_VPDPWSUD,
ZYDIS_MNEMONIC_VPDPWSUDS,
ZYDIS_MNEMONIC_VPDPWUSD,
ZYDIS_MNEMONIC_VPDPWUSDS,
ZYDIS_MNEMONIC_VPDPWUUD,
ZYDIS_MNEMONIC_VPDPWUUDS,
ZYDIS_MNEMONIC_VPERM2F128,
ZYDIS_MNEMONIC_VPERM2I128,
ZYDIS_MNEMONIC_VPERMB,
@@ -1681,12 +1709,20 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_VSCATTERPF1QPS,
ZYDIS_MNEMONIC_VSCATTERQPD,
ZYDIS_MNEMONIC_VSCATTERQPS,
ZYDIS_MNEMONIC_VSHA512MSG1,
ZYDIS_MNEMONIC_VSHA512MSG2,
ZYDIS_MNEMONIC_VSHA512RNDS2,
ZYDIS_MNEMONIC_VSHUFF32X4,
ZYDIS_MNEMONIC_VSHUFF64X2,
ZYDIS_MNEMONIC_VSHUFI32X4,
ZYDIS_MNEMONIC_VSHUFI64X2,
ZYDIS_MNEMONIC_VSHUFPD,
ZYDIS_MNEMONIC_VSHUFPS,
ZYDIS_MNEMONIC_VSM3MSG1,
ZYDIS_MNEMONIC_VSM3MSG2,
ZYDIS_MNEMONIC_VSM3RNDS2,
ZYDIS_MNEMONIC_VSM4KEY4,
ZYDIS_MNEMONIC_VSM4RNDS4,
ZYDIS_MNEMONIC_VSQRTPD,
ZYDIS_MNEMONIC_VSQRTPH,
ZYDIS_MNEMONIC_VSQRTPS,
@@ -1719,6 +1755,8 @@ typedef enum ZydisMnemonic_
ZYDIS_MNEMONIC_WRFSBASE,
ZYDIS_MNEMONIC_WRGSBASE,
ZYDIS_MNEMONIC_WRMSR,
ZYDIS_MNEMONIC_WRMSRLIST,
ZYDIS_MNEMONIC_WRMSRNS,
ZYDIS_MNEMONIC_WRPKRU,
ZYDIS_MNEMONIC_WRSSD,
ZYDIS_MNEMONIC_WRSSQ,

View File

@@ -26,6 +26,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_R13B,
ZYDIS_REGISTER_R14B,
ZYDIS_REGISTER_R15B,
// General purpose registers 16-bit
ZYDIS_REGISTER_AX,
ZYDIS_REGISTER_CX,
@@ -43,6 +44,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_R13W,
ZYDIS_REGISTER_R14W,
ZYDIS_REGISTER_R15W,
// General purpose registers 32-bit
ZYDIS_REGISTER_EAX,
ZYDIS_REGISTER_ECX,
@@ -60,6 +62,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_R13D,
ZYDIS_REGISTER_R14D,
ZYDIS_REGISTER_R15D,
// General purpose registers 64-bit
ZYDIS_REGISTER_RAX,
ZYDIS_REGISTER_RCX,
@@ -77,6 +80,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_R13,
ZYDIS_REGISTER_R14,
ZYDIS_REGISTER_R15,
// Floating point legacy registers
ZYDIS_REGISTER_ST0,
ZYDIS_REGISTER_ST1,
@@ -89,6 +93,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_X87CONTROL,
ZYDIS_REGISTER_X87STATUS,
ZYDIS_REGISTER_X87TAG,
// Floating point multimedia registers
ZYDIS_REGISTER_MM0,
ZYDIS_REGISTER_MM1,
@@ -98,6 +103,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_MM5,
ZYDIS_REGISTER_MM6,
ZYDIS_REGISTER_MM7,
// Floating point vector registers 128-bit
ZYDIS_REGISTER_XMM0,
ZYDIS_REGISTER_XMM1,
@@ -131,6 +137,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_XMM29,
ZYDIS_REGISTER_XMM30,
ZYDIS_REGISTER_XMM31,
// Floating point vector registers 256-bit
ZYDIS_REGISTER_YMM0,
ZYDIS_REGISTER_YMM1,
@@ -164,6 +171,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_YMM29,
ZYDIS_REGISTER_YMM30,
ZYDIS_REGISTER_YMM31,
// Floating point vector registers 512-bit
ZYDIS_REGISTER_ZMM0,
ZYDIS_REGISTER_ZMM1,
@@ -197,6 +205,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_ZMM29,
ZYDIS_REGISTER_ZMM30,
ZYDIS_REGISTER_ZMM31,
// Matrix registers
ZYDIS_REGISTER_TMM0,
ZYDIS_REGISTER_TMM1,
@@ -206,14 +215,17 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_TMM5,
ZYDIS_REGISTER_TMM6,
ZYDIS_REGISTER_TMM7,
// Flags registers
ZYDIS_REGISTER_FLAGS,
ZYDIS_REGISTER_EFLAGS,
ZYDIS_REGISTER_RFLAGS,
// Instruction-pointer registers
ZYDIS_REGISTER_IP,
ZYDIS_REGISTER_EIP,
ZYDIS_REGISTER_RIP,
// Segment registers
ZYDIS_REGISTER_ES,
ZYDIS_REGISTER_CS,
@@ -221,11 +233,13 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_DS,
ZYDIS_REGISTER_FS,
ZYDIS_REGISTER_GS,
// Table registers
ZYDIS_REGISTER_GDTR,
ZYDIS_REGISTER_LDTR,
ZYDIS_REGISTER_IDTR,
ZYDIS_REGISTER_TR,
// Test registers
ZYDIS_REGISTER_TR0,
ZYDIS_REGISTER_TR1,
@@ -235,6 +249,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_TR5,
ZYDIS_REGISTER_TR6,
ZYDIS_REGISTER_TR7,
// Control registers
ZYDIS_REGISTER_CR0,
ZYDIS_REGISTER_CR1,
@@ -252,6 +267,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_CR13,
ZYDIS_REGISTER_CR14,
ZYDIS_REGISTER_CR15,
// Debug registers
ZYDIS_REGISTER_DR0,
ZYDIS_REGISTER_DR1,
@@ -269,6 +285,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_DR13,
ZYDIS_REGISTER_DR14,
ZYDIS_REGISTER_DR15,
// Mask registers
ZYDIS_REGISTER_K0,
ZYDIS_REGISTER_K1,
@@ -278,6 +295,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_K5,
ZYDIS_REGISTER_K6,
ZYDIS_REGISTER_K7,
// Bound registers
ZYDIS_REGISTER_BND0,
ZYDIS_REGISTER_BND1,
@@ -285,6 +303,7 @@ typedef enum ZydisRegister_
ZYDIS_REGISTER_BND3,
ZYDIS_REGISTER_BNDCFG,
ZYDIS_REGISTER_BNDSTATUS,
// Uncategorized
ZYDIS_REGISTER_MXCSR,
ZYDIS_REGISTER_PKRU,

View File

@@ -28,7 +28,8 @@
#define ZYDIS_INTERNAL_DECODERDATA_H
#include <Zycore/Defines.h>
#include <Zydis/DecoderTypes.h>
#include <Zycore/Types.h>
#include <Zydis/Defines.h>
#ifdef __cplusplus
extern "C" {
@@ -172,7 +173,15 @@ enum ZydisDecoderTreeNodeTypes
/**
* Reference to a CLDEMOTE-mode filter.
*/
ZYDIS_NODETYPE_FILTER_MODE_CLDEMOTE = 0x1B
ZYDIS_NODETYPE_FILTER_MODE_CLDEMOTE = 0x1B,
/**
* Reference to a IPREFETCH-mode filter.
*/
ZYDIS_NODETYPE_FILTER_MODE_IPREFETCH = 0x1C,
/**
* Reference to a UD0_COMPAT-mode filter.
*/
ZYDIS_NODETYPE_FILTER_MODE_UD0_COMPAT = 0x1D
};
/* ---------------------------------------------------------------------------------------------- */

View File

@@ -0,0 +1,253 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Mappa
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_INTERNAL_ENCODERDATA_H
#define ZYDIS_INTERNAL_ENCODERDATA_H
#include <Zycore/Defines.h>
#include <Zydis/Mnemonic.h>
#include <Zydis/SharedTypes.h>
/**
* Used in encoder's table to represent standard ISA sizes in form of bit flags.
*/
typedef enum ZydisWidthFlag_
{
ZYDIS_WIDTH_INVALID = 0x00,
ZYDIS_WIDTH_16 = 0x01,
ZYDIS_WIDTH_32 = 0x02,
ZYDIS_WIDTH_64 = 0x04,
/**
* Maximum value of this enum.
*/
ZYDIS_WIDTH_MAX_VALUE = (ZYDIS_WIDTH_64 | (ZYDIS_WIDTH_64 - 1)),
/**
* The minimum number of bits required to represent all values of this enum.
*/
ZYDIS_WIDTH_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_WIDTH_MAX_VALUE)
} ZydisWidthFlag;
/**
* Used in encoder's table to represent mandatory instruction prefix. Using this enum instead of
* actual prefix value saves space.
*/
typedef enum ZydisMandatoryPrefix_
{
ZYDIS_MANDATORY_PREFIX_NONE,
ZYDIS_MANDATORY_PREFIX_66,
ZYDIS_MANDATORY_PREFIX_F2,
ZYDIS_MANDATORY_PREFIX_F3,
/**
* Maximum value of this enum.
*/
ZYDIS_MANDATORY_PREFIX_MAX_VALUE = ZYDIS_MANDATORY_PREFIX_F3,
/**
* The minimum number of bits required to represent all values of this enum.
*/
ZYDIS_MANDATORY_PREFIX_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_MANDATORY_PREFIX_MAX_VALUE)
} ZydisMandatoryPrefix;
/**
* Used in encoder's table to represent vector size supported by instruction definition.
*/
typedef enum ZydisVectorLength_
{
ZYDIS_VECTOR_LENGTH_INVALID,
ZYDIS_VECTOR_LENGTH_128,
ZYDIS_VECTOR_LENGTH_256,
ZYDIS_VECTOR_LENGTH_512,
/**
* Maximum value of this enum.
*/
ZYDIS_VECTOR_LENGTH_MAX_VALUE = ZYDIS_VECTOR_LENGTH_512,
/**
* The minimum number of bits required to represent all values of this enum.
*/
ZYDIS_VECTOR_LENGTH_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_VECTOR_LENGTH_MAX_VALUE)
} ZydisVectorLength;
/**
* Used in encoder's table to represent hint type supported by instruction definition.
*/
typedef enum ZydisSizeHint_
{
ZYDIS_SIZE_HINT_NONE,
ZYDIS_SIZE_HINT_ASZ,
ZYDIS_SIZE_HINT_OSZ,
/**
* Maximum value of this enum.
*/
ZYDIS_SIZE_HINT_MAX_VALUE = ZYDIS_SIZE_HINT_OSZ,
/**
* The minimum number of bits required to represent all values of this enum.
*/
ZYDIS_SIZE_HINT_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_SIZE_HINT_MAX_VALUE)
} ZydisSizeHint;
/**
* Used in encoder's primary lookup table which allows to access a set of instruction definitions
* for specified mnemonic in constant time.
*/
typedef struct ZydisEncoderLookupEntry_
{
/**
* Index to main array of `ZydisEncodableInstruction`.
*/
ZyanU16 encoder_reference;
/**
* The number of entries.
*/
ZyanU8 instruction_count;
} ZydisEncoderLookupEntry;
#pragma pack(push, 1)
/**
* This structure is encoder's internal representation of encodable instruction definition.
*/
typedef struct ZydisEncodableInstruction_
{
/**
* Index to one of decoder's instruction definition arrays.
*/
ZyanU16 instruction_reference;
/**
* Compressed information about operand count and types. Operand count is stored in lowest bits.
* Types of subsequent operands are stored in higher bits.
*/
ZyanU16 operand_mask;
/**
* The instruction-opcode.
*/
ZyanU8 opcode;
/**
* The mandatory ModR/M value.
*/
ZyanU8 modrm;
/**
* The instruction-encoding.
*/
ZyanU8 encoding ZYAN_BITFIELD(ZYDIS_INSTRUCTION_ENCODING_REQUIRED_BITS);
/**
* The opcode map.
*/
ZyanU8 opcode_map ZYAN_BITFIELD(ZYDIS_OPCODE_MAP_REQUIRED_BITS);
/**
* The combination of allowed processor modes.
*/
ZyanU8 modes ZYAN_BITFIELD(ZYDIS_WIDTH_REQUIRED_BITS);
/**
* The combination of allowed address sizes.
*/
ZyanU8 address_sizes ZYAN_BITFIELD(ZYDIS_WIDTH_REQUIRED_BITS);
/**
* The combination of allowed operand sizes.
*/
ZyanU8 operand_sizes ZYAN_BITFIELD(ZYDIS_WIDTH_REQUIRED_BITS);
/**
* The mandatory prefix.
*/
ZyanU8 mandatory_prefix ZYAN_BITFIELD(ZYDIS_MANDATORY_PREFIX_REQUIRED_BITS);
/**
* True if `REX.W` is required for this definition.
*/
ZyanU8 rex_w ZYAN_BITFIELD(1);
/**
* The vector length.
*/
ZyanU8 vector_length ZYAN_BITFIELD(ZYDIS_MANDATORY_PREFIX_REQUIRED_BITS);
/**
* The accepted sizing hint.
*/
ZyanU8 accepts_hint ZYAN_BITFIELD(ZYDIS_SIZE_HINT_REQUIRED_BITS);
/**
* Indicates that next instruction definition can be safely used instead of current one. This
* is used with some `VEX` instructions to take advantage of 2-byte `VEX` prefix when possible.
* 2-byte `VEX` allows to use high registers only when operand is encoded in `modrm_reg`
* (high bit in `REX.R`). Encoder uses swappable definitions to take advantage of this
* optimization opportunity.
*
* Second use of this field is to handle special case for `mov` instruction. This particular
* conflict is described in detail inside `ZydisHandleSwappableDefinition`.
*/
ZyanU8 swappable ZYAN_BITFIELD(1);
} ZydisEncodableInstruction;
#pragma pack(pop)
/**
* Contains information used by instruction size prediction algorithm inside
* `ZydisEncoderEncodeInstructionAbsolute`.
*/
typedef struct ZydisEncoderRelInfo_
{
/**
* Sizes of instruction variants. First index is effective address size. Second index is
* desired immediate size (8, 16 and 32 bits respectively).
*/
ZyanU8 size[3][3];
/**
* See `ZydisSizeHint`.
*/
ZyanU8 accepts_scaling_hints;
/**
* True if instruction accepts branch hint prefixes.
*/
ZyanBool accepts_branch_hints;
/**
* True if instruction accepts bound (`BND`) prefix.
*/
ZyanBool accepts_bound;
} ZydisEncoderRelInfo;
/**
* Fetches array of `ZydisEncodableInstruction` structures and its size for given instruction
* mnemonic.
*
* @param mnemonic Instruction mnemonic.
* @param instruction This variable will receive a pointer to the array of
* `ZydisEncodableInstruction` structures.
*
* @return Entry count (0 if function failed).
*/
ZyanU8 ZydisGetEncodableInstructions(ZydisMnemonic mnemonic,
const ZydisEncodableInstruction **instruction);
/**
* Fetches `ZydisEncoderRelInfo` record for given instruction mnemonic.
*
* @param mnemonic Instruction mnemonic.
*
* @return Pointer to `ZydisEncoderRelInfo` structure or `ZYAN_NULL` if instruction doesn't have
* relative operands.
*/
const ZydisEncoderRelInfo *ZydisGetRelInfo(ZydisMnemonic mnemonic);
#endif /* ZYDIS_INTERNAL_ENCODERDATA_H */

View File

@@ -92,83 +92,84 @@ ZyanStatus ZydisFormatterATTPrintIMM(const ZydisFormatter* formatter,
*/
static const ZydisFormatter FORMATTER_ATT =
{
/* style */ ZYDIS_FORMATTER_STYLE_ATT,
/* force_memory_size */ ZYAN_FALSE,
/* force_memory_seg */ ZYAN_FALSE,
/* force_memory_scale */ ZYAN_TRUE,
/* force_relative_branches */ ZYAN_FALSE,
/* force_relative_riprel */ ZYAN_FALSE,
/* print_branch_size */ ZYAN_FALSE,
/* detailed_prefixes */ ZYAN_FALSE,
/* addr_base */ ZYDIS_NUMERIC_BASE_HEX,
/* addr_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* addr_padding_absolute */ ZYDIS_PADDING_AUTO,
/* addr_padding_relative */ 2,
/* disp_base */ ZYDIS_NUMERIC_BASE_HEX,
/* disp_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* disp_padding */ 2,
/* imm_base */ ZYDIS_NUMERIC_BASE_HEX,
/* imm_signedness */ ZYDIS_SIGNEDNESS_AUTO,
/* imm_padding */ 2,
/* case_prefixes */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_mnemonic */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_registers */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_typecasts */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_decorators */ ZYDIS_LETTER_CASE_DEFAULT,
/* hex_uppercase */ ZYAN_TRUE,
/* number_format */
/* style */ ZYDIS_FORMATTER_STYLE_ATT,
/* force_memory_size */ ZYAN_FALSE,
/* force_memory_seg */ ZYAN_FALSE,
/* force_memory_scale */ ZYAN_TRUE,
/* force_relative_branches */ ZYAN_FALSE,
/* force_relative_riprel */ ZYAN_FALSE,
/* print_branch_size */ ZYAN_FALSE,
/* detailed_prefixes */ ZYAN_FALSE,
/* addr_base */ ZYDIS_NUMERIC_BASE_HEX,
/* addr_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* addr_padding_absolute */ ZYDIS_PADDING_AUTO,
/* addr_padding_relative */ 2,
/* disp_base */ ZYDIS_NUMERIC_BASE_HEX,
/* disp_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* disp_padding */ 2,
/* imm_base */ ZYDIS_NUMERIC_BASE_HEX,
/* imm_signedness */ ZYDIS_SIGNEDNESS_AUTO,
/* imm_padding */ 2,
/* case_prefixes */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_mnemonic */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_registers */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_typecasts */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_decorators */ ZYDIS_LETTER_CASE_DEFAULT,
/* hex_uppercase */ ZYAN_TRUE,
/* hex_force_leading_number */ ZYAN_FALSE,
/* number_format */
{
// ZYDIS_NUMERIC_BASE_DEC
{
// Prefix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
},
// Suffix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
}
},
// ZYDIS_NUMERIC_BASE_HEX
{
// Prefix
{
/* string */ &FORMATTER_ATT.number_format[
ZYDIS_NUMERIC_BASE_HEX][0].string_data,
/* string_data */ ZYAN_DEFINE_STRING_VIEW("0x"),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ &FORMATTER_ATT.number_format[
ZYDIS_NUMERIC_BASE_HEX][0].string_data,
/* string_data */ ZYAN_DEFINE_STRING_VIEW("0x"),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
},
// Suffix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
}
}
},
/* func_pre_instruction */ ZYAN_NULL,
/* func_post_instruction */ ZYAN_NULL,
/* func_format_instruction */ &ZydisFormatterATTFormatInstruction,
/* func_pre_operand */ ZYAN_NULL,
/* func_post_operand */ ZYAN_NULL,
/* func_format_operand_reg */ &ZydisFormatterBaseFormatOperandREG,
/* func_format_operand_mem */ &ZydisFormatterATTFormatOperandMEM,
/* func_format_operand_ptr */ &ZydisFormatterBaseFormatOperandPTR,
/* func_format_operand_imm */ &ZydisFormatterBaseFormatOperandIMM,
/* func_print_mnemonic */ &ZydisFormatterATTPrintMnemonic,
/* func_print_register */ &ZydisFormatterATTPrintRegister,
/* func_print_address_abs */ &ZydisFormatterATTPrintAddressABS,
/* func_print_address_rel */ &ZydisFormatterBasePrintAddressREL,
/* func_print_disp */ &ZydisFormatterATTPrintDISP,
/* func_print_imm */ &ZydisFormatterATTPrintIMM,
/* func_print_typecast */ ZYAN_NULL,
/* func_print_segment */ &ZydisFormatterBasePrintSegment,
/* func_print_prefixes */ &ZydisFormatterBasePrintPrefixes,
/* func_print_decorator */ &ZydisFormatterBasePrintDecorator
/* func_pre_instruction */ ZYAN_NULL,
/* func_post_instruction */ ZYAN_NULL,
/* func_format_instruction */ &ZydisFormatterATTFormatInstruction,
/* func_pre_operand */ ZYAN_NULL,
/* func_post_operand */ ZYAN_NULL,
/* func_format_operand_reg */ &ZydisFormatterBaseFormatOperandREG,
/* func_format_operand_mem */ &ZydisFormatterATTFormatOperandMEM,
/* func_format_operand_ptr */ &ZydisFormatterBaseFormatOperandPTR,
/* func_format_operand_imm */ &ZydisFormatterBaseFormatOperandIMM,
/* func_print_mnemonic */ &ZydisFormatterATTPrintMnemonic,
/* func_print_register */ &ZydisFormatterATTPrintRegister,
/* func_print_address_abs */ &ZydisFormatterATTPrintAddressABS,
/* func_print_address_rel */ &ZydisFormatterBasePrintAddressREL,
/* func_print_disp */ &ZydisFormatterATTPrintDISP,
/* func_print_imm */ &ZydisFormatterATTPrintIMM,
/* func_print_typecast */ ZYAN_NULL,
/* func_print_segment */ &ZydisFormatterBasePrintSegment,
/* func_print_prefixes */ &ZydisFormatterBasePrintPrefixes,
/* func_print_decorator */ &ZydisFormatterBasePrintDecorator
};
/* ---------------------------------------------------------------------------------------------- */

View File

@@ -50,13 +50,16 @@ extern "C" {
/**
* Appends an unsigned numeric value to the given string.
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param base The numeric base.
* @param str The destination string.
* @param value The value.
* @param padding_length The padding length.
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param base The numeric base.
* @param str The destination string.
* @param value The value to append.
* @param padding_length The padding length.
* @param force_leading_number Enable this option to prepend a leading `0` if the first
* character is non-numeric.
*/
#define ZYDIS_STRING_APPEND_NUM_U(formatter, base, str, value, padding_length) \
#define ZYDIS_STRING_APPEND_NUM_U(formatter, base, str, value, padding_length, \
force_leading_number) \
switch (base) \
{ \
case ZYDIS_NUMERIC_BASE_DEC: \
@@ -65,7 +68,7 @@ extern "C" {
(formatter)->number_format[base][1].string)); \
break; \
case ZYDIS_NUMERIC_BASE_HEX: \
ZYAN_CHECK(ZydisStringAppendHexU(str, value, padding_length, \
ZYAN_CHECK(ZydisStringAppendHexU(str, value, padding_length, force_leading_number, \
(formatter)->hex_uppercase, \
(formatter)->number_format[base][0].string, \
(formatter)->number_format[base][1].string)); \
@@ -77,14 +80,17 @@ extern "C" {
/**
* Appends a signed numeric value to the given string.
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param base The numeric base.
* @param str The destination string.
* @param value The value.
* @param padding_length The padding length.
* @param force_sign Forces printing of the '+' sign for positive numbers.
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param base The numeric base.
* @param str The destination string.
* @param value The value to append.
* @param padding_length The padding length.
* @param force_leading_number Enable this option to prepend a leading `0`, if the first
* character is non-numeric.
* @param force_sign Enable to print the '+' sign for positive numbers.
*/
#define ZYDIS_STRING_APPEND_NUM_S(formatter, base, str, value, padding_length, force_sign) \
#define ZYDIS_STRING_APPEND_NUM_S(formatter, base, str, value, padding_length, \
force_leading_number, force_sign) \
switch (base) \
{ \
case ZYDIS_NUMERIC_BASE_DEC: \
@@ -93,7 +99,7 @@ extern "C" {
(formatter)->number_format[base][1].string)); \
break; \
case ZYDIS_NUMERIC_BASE_HEX: \
ZYAN_CHECK(ZydisStringAppendHexS(str, value, padding_length, \
ZYAN_CHECK(ZydisStringAppendHexS(str, value, padding_length, force_leading_number, \
(formatter)->hex_uppercase, force_sign, \
(formatter)->number_format[base][0].string, \
(formatter)->number_format[base][1].string)); \
@@ -162,7 +168,7 @@ extern "C" {
*
* @param buffer A pointer to the `ZydisFormatterBuffer` struct.
* @param name The base name (without prefix) of the string- or token.
* @param letter-case The desired letter-case.
* @param letter_case The desired letter-case.
*/
#define ZYDIS_BUFFER_APPEND_CASE(buffer, name, letter_case) \
if ((buffer)->is_token_list) \
@@ -252,7 +258,7 @@ ZYAN_INLINE ZyanStatus ZydisFormatterBufferAppendPredefined(ZydisFormatterBuffer
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param context A pointer to the `ZydisFormatterContext` struct.
* @param memop_id The operand-id of the instructions first memory operand.
* @param operand The instructions first memory operand.
*
* @return Returns the explicit size, if required, or `0`, if not needed.
*
@@ -260,7 +266,7 @@ ZYAN_INLINE ZyanStatus ZydisFormatterBufferAppendPredefined(ZydisFormatterBuffer
* is set to `ZYAN_TRUE`.
*/
ZyanU32 ZydisFormatterHelperGetExplicitSize(const ZydisFormatter* formatter,
ZydisFormatterContext* context, ZyanU8 memop_id);
ZydisFormatterContext* context, const ZydisDecodedOperand* operand);
/* ---------------------------------------------------------------------------------------------- */

View File

@@ -91,83 +91,84 @@ ZyanStatus ZydisFormatterIntelPrintAddressMASM(const ZydisFormatter* formatter,
*/
static const ZydisFormatter FORMATTER_INTEL =
{
/* style */ ZYDIS_FORMATTER_STYLE_INTEL,
/* force_memory_size */ ZYAN_FALSE,
/* force_memory_seg */ ZYAN_FALSE,
/* force_memory_scale */ ZYAN_TRUE,
/* force_relative_branches */ ZYAN_FALSE,
/* force_relative_riprel */ ZYAN_FALSE,
/* print_branch_size */ ZYAN_FALSE,
/* detailed_prefixes */ ZYAN_FALSE,
/* addr_base */ ZYDIS_NUMERIC_BASE_HEX,
/* addr_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* addr_padding_absolute */ ZYDIS_PADDING_AUTO,
/* addr_padding_relative */ 2,
/* disp_base */ ZYDIS_NUMERIC_BASE_HEX,
/* disp_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* disp_padding */ 2,
/* imm_base */ ZYDIS_NUMERIC_BASE_HEX,
/* imm_signedness */ ZYDIS_SIGNEDNESS_UNSIGNED,
/* imm_padding */ 2,
/* case_prefixes */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_mnemonic */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_registers */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_typecasts */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_decorators */ ZYDIS_LETTER_CASE_DEFAULT,
/* hex_uppercase */ ZYAN_TRUE,
/* number_format */
/* style */ ZYDIS_FORMATTER_STYLE_INTEL,
/* force_memory_size */ ZYAN_FALSE,
/* force_memory_seg */ ZYAN_FALSE,
/* force_memory_scale */ ZYAN_TRUE,
/* force_relative_branches */ ZYAN_FALSE,
/* force_relative_riprel */ ZYAN_FALSE,
/* print_branch_size */ ZYAN_FALSE,
/* detailed_prefixes */ ZYAN_FALSE,
/* addr_base */ ZYDIS_NUMERIC_BASE_HEX,
/* addr_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* addr_padding_absolute */ ZYDIS_PADDING_AUTO,
/* addr_padding_relative */ 2,
/* disp_base */ ZYDIS_NUMERIC_BASE_HEX,
/* disp_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* disp_padding */ 2,
/* imm_base */ ZYDIS_NUMERIC_BASE_HEX,
/* imm_signedness */ ZYDIS_SIGNEDNESS_UNSIGNED,
/* imm_padding */ 2,
/* case_prefixes */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_mnemonic */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_registers */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_typecasts */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_decorators */ ZYDIS_LETTER_CASE_DEFAULT,
/* hex_uppercase */ ZYAN_TRUE,
/* hex_force_leading_number */ ZYAN_FALSE,
/* number_format */
{
// ZYDIS_NUMERIC_BASE_DEC
{
// Prefix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
},
// Suffix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
}
},
// ZYDIS_NUMERIC_BASE_HEX
{
// Prefix
{
/* string */ &FORMATTER_INTEL.number_format[
ZYDIS_NUMERIC_BASE_HEX][0].string_data,
/* string_data */ ZYAN_DEFINE_STRING_VIEW("0x"),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ &FORMATTER_INTEL.number_format[
ZYDIS_NUMERIC_BASE_HEX][0].string_data,
/* string_data */ ZYAN_DEFINE_STRING_VIEW("0x"),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
},
// Suffix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
}
}
},
/* func_pre_instruction */ ZYAN_NULL,
/* func_post_instruction */ ZYAN_NULL,
/* func_format_instruction */ &ZydisFormatterIntelFormatInstruction,
/* func_pre_operand */ ZYAN_NULL,
/* func_post_operand */ ZYAN_NULL,
/* func_format_operand_reg */ &ZydisFormatterBaseFormatOperandREG,
/* func_format_operand_mem */ &ZydisFormatterIntelFormatOperandMEM,
/* func_format_operand_ptr */ &ZydisFormatterBaseFormatOperandPTR,
/* func_format_operand_imm */ &ZydisFormatterBaseFormatOperandIMM,
/* func_print_mnemonic */ &ZydisFormatterIntelPrintMnemonic,
/* func_print_register */ &ZydisFormatterIntelPrintRegister,
/* func_print_address_abs */ &ZydisFormatterBasePrintAddressABS,
/* func_print_address_rel */ &ZydisFormatterBasePrintAddressREL,
/* func_print_disp */ &ZydisFormatterIntelPrintDISP,
/* func_print_imm */ &ZydisFormatterBasePrintIMM,
/* func_print_typecast */ &ZydisFormatterIntelPrintTypecast,
/* func_print_segment */ &ZydisFormatterBasePrintSegment,
/* func_print_prefixes */ &ZydisFormatterBasePrintPrefixes,
/* func_print_decorator */ &ZydisFormatterBasePrintDecorator
/* func_pre_instruction */ ZYAN_NULL,
/* func_post_instruction */ ZYAN_NULL,
/* func_format_instruction */ &ZydisFormatterIntelFormatInstruction,
/* func_pre_operand */ ZYAN_NULL,
/* func_post_operand */ ZYAN_NULL,
/* func_format_operand_reg */ &ZydisFormatterBaseFormatOperandREG,
/* func_format_operand_mem */ &ZydisFormatterIntelFormatOperandMEM,
/* func_format_operand_ptr */ &ZydisFormatterBaseFormatOperandPTR,
/* func_format_operand_imm */ &ZydisFormatterBaseFormatOperandIMM,
/* func_print_mnemonic */ &ZydisFormatterIntelPrintMnemonic,
/* func_print_register */ &ZydisFormatterIntelPrintRegister,
/* func_print_address_abs */ &ZydisFormatterBasePrintAddressABS,
/* func_print_address_rel */ &ZydisFormatterBasePrintAddressREL,
/* func_print_disp */ &ZydisFormatterIntelPrintDISP,
/* func_print_imm */ &ZydisFormatterBasePrintIMM,
/* func_print_typecast */ &ZydisFormatterIntelPrintTypecast,
/* func_print_segment */ &ZydisFormatterBasePrintSegment,
/* func_print_prefixes */ &ZydisFormatterBasePrintPrefixes,
/* func_print_decorator */ &ZydisFormatterBasePrintDecorator
};
/* ---------------------------------------------------------------------------------------------- */
@@ -179,83 +180,84 @@ static const ZydisFormatter FORMATTER_INTEL =
*/
static const ZydisFormatter FORMATTER_INTEL_MASM =
{
/* style */ ZYDIS_FORMATTER_STYLE_INTEL_MASM,
/* force_memory_size */ ZYAN_TRUE,
/* force_memory_seg */ ZYAN_FALSE,
/* force_memory_scale */ ZYAN_TRUE,
/* force_relative_branches */ ZYAN_FALSE,
/* force_relative_riprel */ ZYAN_FALSE,
/* print_branch_size */ ZYAN_FALSE,
/* detailed_prefixes */ ZYAN_FALSE,
/* addr_base */ ZYDIS_NUMERIC_BASE_HEX,
/* addr_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* addr_padding_absolute */ ZYDIS_PADDING_DISABLED,
/* addr_padding_relative */ ZYDIS_PADDING_DISABLED,
/* disp_base */ ZYDIS_NUMERIC_BASE_HEX,
/* disp_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* disp_padding */ ZYDIS_PADDING_DISABLED,
/* imm_base */ ZYDIS_NUMERIC_BASE_HEX,
/* imm_signedness */ ZYDIS_SIGNEDNESS_AUTO,
/* imm_padding */ ZYDIS_PADDING_DISABLED,
/* case_prefixes */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_mnemonic */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_registers */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_typecasts */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_decorators */ ZYDIS_LETTER_CASE_DEFAULT,
/* hex_uppercase */ ZYAN_TRUE,
/* number_format */
/* style */ ZYDIS_FORMATTER_STYLE_INTEL_MASM,
/* force_memory_size */ ZYAN_TRUE,
/* force_memory_seg */ ZYAN_FALSE,
/* force_memory_scale */ ZYAN_TRUE,
/* force_relative_branches */ ZYAN_FALSE,
/* force_relative_riprel */ ZYAN_FALSE,
/* print_branch_size */ ZYAN_FALSE,
/* detailed_prefixes */ ZYAN_FALSE,
/* addr_base */ ZYDIS_NUMERIC_BASE_HEX,
/* addr_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* addr_padding_absolute */ ZYDIS_PADDING_DISABLED,
/* addr_padding_relative */ ZYDIS_PADDING_DISABLED,
/* disp_base */ ZYDIS_NUMERIC_BASE_HEX,
/* disp_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* disp_padding */ ZYDIS_PADDING_DISABLED,
/* imm_base */ ZYDIS_NUMERIC_BASE_HEX,
/* imm_signedness */ ZYDIS_SIGNEDNESS_AUTO,
/* imm_padding */ ZYDIS_PADDING_DISABLED,
/* case_prefixes */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_mnemonic */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_registers */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_typecasts */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_decorators */ ZYDIS_LETTER_CASE_DEFAULT,
/* hex_uppercase */ ZYAN_TRUE,
/* hex_force_leading_number */ ZYAN_TRUE,
/* number_format */
{
// ZYDIS_NUMERIC_BASE_DEC
{
// Prefix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
},
// Suffix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
}
},
// ZYDIS_NUMERIC_BASE_HEX
{
// Prefix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
},
// Suffix
{
/* string */ &FORMATTER_INTEL_MASM.number_format[
ZYDIS_NUMERIC_BASE_HEX][1].string_data,
/* string_data */ ZYAN_DEFINE_STRING_VIEW("h"),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* string */ &FORMATTER_INTEL_MASM.number_format[
ZYDIS_NUMERIC_BASE_HEX][1].string_data,
/* string_data */ ZYAN_DEFINE_STRING_VIEW("h"),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
}
}
},
/* func_pre_instruction */ ZYAN_NULL,
/* func_post_instruction */ ZYAN_NULL,
/* func_format_instruction */ &ZydisFormatterIntelFormatInstructionMASM,
/* func_pre_operand */ ZYAN_NULL,
/* func_post_operand */ ZYAN_NULL,
/* func_format_operand_reg */ &ZydisFormatterBaseFormatOperandREG,
/* func_format_operand_mem */ &ZydisFormatterIntelFormatOperandMEM,
/* func_format_operand_ptr */ &ZydisFormatterBaseFormatOperandPTR,
/* func_format_operand_imm */ &ZydisFormatterBaseFormatOperandIMM,
/* func_print_mnemonic */ &ZydisFormatterIntelPrintMnemonic,
/* func_print_register */ &ZydisFormatterIntelPrintRegister,
/* func_print_address_abs */ &ZydisFormatterIntelPrintAddressMASM,
/* func_print_address_rel */ &ZydisFormatterIntelPrintAddressMASM,
/* func_print_disp */ &ZydisFormatterIntelPrintDISP,
/* func_print_imm */ &ZydisFormatterBasePrintIMM,
/* func_print_typecast */ &ZydisFormatterIntelPrintTypecast,
/* func_print_segment */ &ZydisFormatterBasePrintSegment,
/* func_print_prefixes */ &ZydisFormatterBasePrintPrefixes,
/* func_print_decorator */ &ZydisFormatterBasePrintDecorator
/* func_pre_instruction */ ZYAN_NULL,
/* func_post_instruction */ ZYAN_NULL,
/* func_format_instruction */ &ZydisFormatterIntelFormatInstructionMASM,
/* func_pre_operand */ ZYAN_NULL,
/* func_post_operand */ ZYAN_NULL,
/* func_format_operand_reg */ &ZydisFormatterBaseFormatOperandREG,
/* func_format_operand_mem */ &ZydisFormatterIntelFormatOperandMEM,
/* func_format_operand_ptr */ &ZydisFormatterBaseFormatOperandPTR,
/* func_format_operand_imm */ &ZydisFormatterBaseFormatOperandIMM,
/* func_print_mnemonic */ &ZydisFormatterIntelPrintMnemonic,
/* func_print_register */ &ZydisFormatterIntelPrintRegister,
/* func_print_address_abs */ &ZydisFormatterIntelPrintAddressMASM,
/* func_print_address_rel */ &ZydisFormatterIntelPrintAddressMASM,
/* func_print_disp */ &ZydisFormatterIntelPrintDISP,
/* func_print_imm */ &ZydisFormatterBasePrintIMM,
/* func_print_typecast */ &ZydisFormatterIntelPrintTypecast,
/* func_print_segment */ &ZydisFormatterBasePrintSegment,
/* func_print_prefixes */ &ZydisFormatterBasePrintPrefixes,
/* func_print_decorator */ &ZydisFormatterBasePrintDecorator
};
/* ---------------------------------------------------------------------------------------------- */

View File

@@ -116,11 +116,15 @@ typedef enum ZydisInternalElementType_
ZYDIS_IELEMENT_TYPE_UINT,
ZYDIS_IELEMENT_TYPE_INT1,
ZYDIS_IELEMENT_TYPE_INT8,
ZYDIS_IELEMENT_TYPE_INT8X4,
ZYDIS_IELEMENT_TYPE_INT16,
ZYDIS_IELEMENT_TYPE_INT16X2,
ZYDIS_IELEMENT_TYPE_INT32,
ZYDIS_IELEMENT_TYPE_INT64,
ZYDIS_IELEMENT_TYPE_UINT8,
ZYDIS_IELEMENT_TYPE_UINT8X4,
ZYDIS_IELEMENT_TYPE_UINT16,
ZYDIS_IELEMENT_TYPE_UINT16X2,
ZYDIS_IELEMENT_TYPE_UINT32,
ZYDIS_IELEMENT_TYPE_UINT64,
ZYDIS_IELEMENT_TYPE_UINT128,
@@ -130,6 +134,7 @@ typedef enum ZydisInternalElementType_
ZYDIS_IELEMENT_TYPE_FLOAT32,
ZYDIS_IELEMENT_TYPE_FLOAT64,
ZYDIS_IELEMENT_TYPE_FLOAT80,
ZYDIS_IELEMENT_TYPE_BFLOAT16X2,
ZYDIS_IELEMENT_TYPE_BCD80,
ZYDIS_IELEMENT_TYPE_CC3,
ZYDIS_IELEMENT_TYPE_CC5,
@@ -151,12 +156,13 @@ typedef enum ZydisInternalElementType_
*/
typedef enum ZydisImplicitRegisterType_
{
// TODO: Rename OSZ|ASZ|SSZ_
ZYDIS_IMPLREG_TYPE_STATIC,
ZYDIS_IMPLREG_TYPE_GPR_OSZ,
ZYDIS_IMPLREG_TYPE_GPR_ASZ,
ZYDIS_IMPLREG_TYPE_GPR_SSZ,
ZYDIS_IMPLREG_TYPE_IP_ASZ,
ZYDIS_IMPLREG_TYPE_IP_SSZ,
ZYDIS_IMPLREG_TYPE_GPR_SSZ,
ZYDIS_IMPLREG_TYPE_FLAGS_SSZ,
/**
@@ -176,6 +182,7 @@ typedef enum ZydisImplicitRegisterType_
*/
typedef enum ZydisImplicitMemBase_
{
// TODO: Rename OSZ|ASZ|SSZ_
ZYDIS_IMPLMEM_BASE_AGPR_REG,
ZYDIS_IMPLMEM_BASE_AGPR_RM,
ZYDIS_IMPLMEM_BASE_AAX,
@@ -267,35 +274,6 @@ typedef enum ZydisReadWriteAction_
/* ---------------------------------------------------------------------------------------------- */
/**
* Defines the `ZydisRegisterConstraint` enum.
*/
typedef enum ZydisRegisterConstraint_
{
ZYDIS_REG_CONSTRAINTS_UNUSED,
ZYDIS_REG_CONSTRAINTS_NONE,
ZYDIS_REG_CONSTRAINTS_GPR,
ZYDIS_REG_CONSTRAINTS_SR_DEST,
ZYDIS_REG_CONSTRAINTS_SR,
ZYDIS_REG_CONSTRAINTS_CR,
ZYDIS_REG_CONSTRAINTS_DR,
ZYDIS_REG_CONSTRAINTS_MASK,
ZYDIS_REG_CONSTRAINTS_BND,
ZYDIS_REG_CONSTRAINTS_VSIB,
ZYDIS_REG_CONSTRAINTS_NO_REL,
/**
* Maximum value of this enum.
*/
ZYDIS_REG_CONSTRAINTS_MAX_VALUE = ZYDIS_REG_CONSTRAINTS_NO_REL,
/**
* The minimum number of bits required to represent all values of this enum.
*/
ZYDIS_REG_CONSTRAINTS_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_REG_CONSTRAINTS_MAX_VALUE)
} ZydisRegisterConstraint;
/* ---------------------------------------------------------------------------------------------- */
/**
* Defines the `ZydisInternalVectorLength` enum.
*/
@@ -442,7 +420,7 @@ typedef enum ZydisEVEXTupleType_
/**
* Quarter of the vector-length.
*/
ZYDIS_TUPLETYPE_QUARTER,
ZYDIS_TUPLETYPE_QUARTER,
/**
* Maximum value of this enum.
@@ -713,6 +691,21 @@ typedef enum ZydisMaskOverride_
/* ---------------------------------------------------------------------------------------------- */
#define ZYDIS_OPDEF_REQUIRED_BITS \
ZYAN_MAX(ZYDIS_REGKIND_REQUIRED_BITS, ZYDIS_MEMOP_TYPE_REQUIRED_BITS + 1) + 1
#define ZYDIS_OPDEF_GET_REG(operand_definition) \
((operand_definition) & ((1 << ZYDIS_REGKIND_REQUIRED_BITS ) - 1))
#define ZYDIS_OPDEF_GET_MEM(operand_definition) \
((operand_definition) & ((1 << ZYDIS_MEMOP_TYPE_REQUIRED_BITS) - 1))
#define ZYDIS_OPDEF_GET_REG_HIGH_BIT(operand_definition) \
(((operand_definition) >> ZYDIS_REGKIND_REQUIRED_BITS ) & 0x01)
#define ZYDIS_OPDEF_GET_MEM_HIGH_BIT(operand_definition) \
(((operand_definition) >> ZYDIS_MEMOP_TYPE_REQUIRED_BITS) & 0x01)
// MSVC does not correctly execute the `pragma pack(1)` compiler-directive, if we use the correct
// enum types
ZYAN_STATIC_ASSERT(ZYDIS_MNEMONIC_REQUIRED_BITS <= 16);
@@ -721,13 +714,14 @@ ZYAN_STATIC_ASSERT(ZYDIS_ISA_SET_REQUIRED_BITS <= 8);
ZYAN_STATIC_ASSERT(ZYDIS_ISA_EXT_REQUIRED_BITS <= 8);
ZYAN_STATIC_ASSERT(ZYDIS_BRANCH_TYPE_REQUIRED_BITS <= 8);
ZYAN_STATIC_ASSERT(ZYDIS_EXCEPTION_CLASS_REQUIRED_BITS <= 8);
ZYAN_STATIC_ASSERT(ZYDIS_REG_CONSTRAINTS_REQUIRED_BITS <= 8);
ZYAN_STATIC_ASSERT(ZYDIS_OPDEF_REQUIRED_BITS <= 8);
ZYAN_STATIC_ASSERT(ZYDIS_RW_ACTION_REQUIRED_BITS <= 8);
#ifndef ZYDIS_MINIMAL_MODE
# define ZYDIS_INSTRUCTION_DEFINITION_BASE \
ZyanU16 mnemonic ZYAN_BITFIELD(ZYDIS_MNEMONIC_REQUIRED_BITS); \
ZyanU8 operand_count ZYAN_BITFIELD( 4); \
ZyanU8 operand_count_visible ZYAN_BITFIELD( 3); \
ZyanU16 operand_reference ZYAN_BITFIELD(15); \
ZyanU8 operand_size_map ZYAN_BITFIELD( 3); \
ZyanU8 address_size_map ZYAN_BITFIELD( 2); \
@@ -739,8 +733,8 @@ ZYAN_STATIC_ASSERT(ZYDIS_RW_ACTION_REQUIRED_BITS <= 8);
ZyanU8 isa_ext ZYAN_BITFIELD(ZYDIS_ISA_EXT_REQUIRED_BITS); \
ZyanU8 branch_type ZYAN_BITFIELD(ZYDIS_BRANCH_TYPE_REQUIRED_BITS); \
ZyanU8 exception_class ZYAN_BITFIELD(ZYDIS_EXCEPTION_CLASS_REQUIRED_BITS); \
ZyanU8 constr_REG ZYAN_BITFIELD(ZYDIS_REG_CONSTRAINTS_REQUIRED_BITS); \
ZyanU8 constr_RM ZYAN_BITFIELD(ZYDIS_REG_CONSTRAINTS_REQUIRED_BITS); \
ZyanU8 op_reg ZYAN_BITFIELD(ZYDIS_OPDEF_REQUIRED_BITS); \
ZyanU8 op_rm ZYAN_BITFIELD(ZYDIS_OPDEF_REQUIRED_BITS); \
ZyanU8 cpu_state ZYAN_BITFIELD(ZYDIS_RW_ACTION_REQUIRED_BITS); \
ZyanU8 fpu_state ZYAN_BITFIELD(ZYDIS_RW_ACTION_REQUIRED_BITS); \
ZyanU8 xmm_state ZYAN_BITFIELD(ZYDIS_RW_ACTION_REQUIRED_BITS); \
@@ -751,18 +745,20 @@ ZYAN_STATIC_ASSERT(ZYDIS_RW_ACTION_REQUIRED_BITS <= 8);
ZyanU8 operand_size_map ZYAN_BITFIELD( 3); \
ZyanU8 address_size_map ZYAN_BITFIELD( 2); \
ZyanBool requires_protected_mode ZYAN_BITFIELD( 1); \
ZyanU8 constr_REG ZYAN_BITFIELD(ZYDIS_REG_CONSTRAINTS_REQUIRED_BITS); \
ZyanU8 constr_RM ZYAN_BITFIELD(ZYDIS_REG_CONSTRAINTS_REQUIRED_BITS)
ZyanBool no_compat_mode ZYAN_BITFIELD( 1); \
ZyanU8 op_reg ZYAN_BITFIELD(ZYDIS_OPDEF_REQUIRED_BITS); \
ZyanU8 op_rm ZYAN_BITFIELD(ZYDIS_OPDEF_REQUIRED_BITS)
#endif
#define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR \
ZYDIS_INSTRUCTION_DEFINITION_BASE; \
ZyanU8 constr_NDSNDD ZYAN_BITFIELD(ZYDIS_REG_CONSTRAINTS_REQUIRED_BITS)
ZyanU8 op_ndsndd ZYAN_BITFIELD(ZYDIS_OPDEF_REQUIRED_BITS)
#define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_INTEL \
ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR; \
ZyanBool is_gather ZYAN_BITFIELD( 1); \
ZyanBool no_source_dest_match ZYAN_BITFIELD( 1)
ZyanBool no_source_dest_match ZYAN_BITFIELD( 1); \
ZyanBool no_source_source_match ZYAN_BITFIELD( 1) // TODO: Could be moved to VEX
/**
* Defines the `ZydisInstructionDefinition` struct.
@@ -882,19 +878,6 @@ typedef struct ZydisInstructionDefinitionMVEX_
} ZydisInstructionDefinitionMVEX;
#endif
/* ---------------------------------------------------------------------------------------------- */
/* Accessed CPU flags */
/* ---------------------------------------------------------------------------------------------- */
typedef struct ZydisAccessedFlags_
{
ZydisCPUFlagAction action[ZYDIS_CPUFLAG_MAX_VALUE + 1];
ZyanU32 cpu_flags_read ZYAN_BITFIELD(22);
ZyanU32 cpu_flags_written ZYAN_BITFIELD(22);
ZyanU8 fpu_flags_read ZYAN_BITFIELD( 4);
ZyanU8 fpu_flags_written ZYAN_BITFIELD( 4);
} ZydisAccessedFlags;
/* ---------------------------------------------------------------------------------------------- */
#pragma pack(pop)
@@ -903,6 +886,24 @@ typedef struct ZydisAccessedFlags_
# pragma warning(pop)
#endif
/* ---------------------------------------------------------------------------------------------- */
/* Accessed CPU/FPU flags */
/* ---------------------------------------------------------------------------------------------- */
/*
* Contains information about the CPU/FPU flags accessed by an instruction.
*
* We don't want this struct to be packed! A pointer to the individual members will be used by the
* `ZydisDecodedInstruction` struct.
*/
typedef struct ZydisDefinitionAccessedFlags_
{
ZydisAccessedFlags cpu_flags;
ZydisAccessedFlags fpu_flags;
} ZydisDefinitionAccessedFlags;
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Functions */
/* ============================================================================================== */
@@ -931,13 +932,11 @@ ZYDIS_NO_EXPORT void ZydisGetInstructionDefinition(ZydisInstructionEncoding enco
* Returns the the operand-definitions for the given instruction-`definition`.
*
* @param definition A pointer to the instruction-definition.
* @param operand A pointer to the variable that receives a pointer to the first operand-
* definition of the instruction.
*
* @return The number of operands for the given instruction-definition.
* @return A pointer to the first operand definition of the instruction, or `ZYAN_NULL`.
*/
ZYDIS_NO_EXPORT ZyanU8 ZydisGetOperandDefinitions(const ZydisInstructionDefinition* definition,
const ZydisOperandDefinition** operand);
ZYDIS_NO_EXPORT const ZydisOperandDefinition* ZydisGetOperandDefinitions(
const ZydisInstructionDefinition* definition);
#endif
/* ---------------------------------------------------------------------------------------------- */
@@ -965,12 +964,13 @@ ZYDIS_NO_EXPORT void ZydisGetElementInfo(ZydisInternalElementType element, Zydis
* Returns the the operand-definitions for the given instruction-`definition`.
*
* @param definition A pointer to the instruction-definition.
* @param flags A pointer to the variable that receives the `ZydisAccessedFlags` struct.
* @param flags A pointer to the variable that receives the `ZydisDefinitionAccessedFlags`
* struct.
*
* @return `ZYAN_TRUE`, if the instruction accesses any flags, or `ZYAN_FALSE`, if not.
*/
ZYDIS_NO_EXPORT ZyanBool ZydisGetAccessedFlags(const ZydisInstructionDefinition* definition,
const ZydisAccessedFlags** flags);
const ZydisDefinitionAccessedFlags** flags);
#endif
/* ---------------------------------------------------------------------------------------------- */

View File

@@ -45,7 +45,9 @@
#include <Zycore/Types.h>
#include <Zycore/Format.h>
#include <Zydis/ShortString.h>
#include <Zydis/Status.h>
#include <Zycore/Defines.h>
#include <Zycore/Status.h>
#include <Zycore/Vector.h>
#ifdef __cplusplus
extern "C" {
@@ -327,7 +329,7 @@ ZYAN_INLINE ZyanStatus ZydisStringAppendShortCase(ZyanString* destination,
* appends it to the `string`.
*
* @param string A pointer to the `ZyanString` instance.
* @param value The value.
* @param value The value to append.
* @param padding_length Padds the converted value with leading zeros, if the number of chars is
* less than the `padding_length`.
* @param prefix The string to use as prefix or `ZYAN_NULL`, if not needed.
@@ -346,10 +348,10 @@ ZyanStatus ZydisStringAppendDecU(ZyanString* string, ZyanU64 value, ZyanU8 paddi
* appends it to the `string`.
*
* @param string A pointer to the `ZyanString` instance.
* @param value The value.
* @param value The value to append.
* @param padding_length Padds the converted value with leading zeros, if the number of chars is
* less than the `padding_length`.
* @param force_sign Set `ZYAN_TRUE`, to force printing of the `+` sign for positive numbers.
* @param force_sign Enable this option to print the `+` sign for positive numbers.
* @param prefix The string to use as prefix or `ZYAN_NULL`, if not needed.
* @param suffix The string to use as suffix or `ZYAN_NULL`, if not needed.
*
@@ -388,14 +390,16 @@ ZYAN_INLINE ZyanStatus ZydisStringAppendDecS(ZyanString* string, ZyanI64 value,
* Formats the given unsigned ordinal `value` to its hexadecimal text-representation and
* appends it to the `string`.
*
* @param string A pointer to the `ZyanString` instance.
* @param value The value.
* @param padding_length Padds the converted value with leading zeros, if the number of chars is
* less than the `padding_length`.
* @param uppercase Set `ZYAN_TRUE` to use uppercase letters ('A'-'F') instead of lowercase
* ones ('a'-'f').
* @param prefix The string to use as prefix or `ZYAN_NULL`, if not needed.
* @param suffix The string to use as suffix or `ZYAN_NULL`, if not needed.
* @param string A pointer to the `ZyanString` instance.
* @param value The value to append.
* @param padding_length Pads the converted value with leading zeros if the number of
* chars is less than the `padding_length`.
* @param force_leading_number Enable this option to prepend a leading `0` if the first
* character is non-numeric.
* @param uppercase Enable this option to use uppercase letters ('A'-'F') instead
* of lowercase ones ('a'-'f').
* @param prefix The string to use as prefix or `ZYAN_NULL`, if not needed.
* @param suffix The string to use as suffix or `ZYAN_NULL`, if not needed.
*
* @return A zyan status code.
*
@@ -403,33 +407,34 @@ ZYAN_INLINE ZyanStatus ZydisStringAppendDecS(ZyanString* string, ZyanI64 value,
* `ZyanString` instance.
*/
ZyanStatus ZydisStringAppendHexU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length,
ZyanBool uppercase, const ZyanStringView* prefix, const ZyanStringView* suffix);
ZyanBool force_leading_number, ZyanBool uppercase, const ZyanStringView* prefix,
const ZyanStringView* suffix);
/**
* Formats the given signed ordinal `value` to its hexadecimal text-representation and
* appends it to the `string`.
*
* @param string A pointer to the string.
* @param value The value.
* @param padding_length Padds the converted value with leading zeros, if the number of chars is
* less than the `padding_length` (the sign char is ignored).
* @param uppercase Set `ZYAN_TRUE` to print the hexadecimal value in uppercase letters
* instead of lowercase ones.
* @param force_sign Set to `ZYAN_TRUE`, to force printing of the `+` sign for positive
* numbers.
* @param prefix The string to use as prefix or `NULL`, if not needed.
* @param suffix The string to use as suffix or `NULL`, if not needed.
* @param string A pointer to the `ZyanString` instance.
* @param value The value to append.
* @param padding_length Padds the converted value with leading zeros, if the number of
* chars is less than the `padding_length` (the sign char does not
* count).
* @param force_leading_number Enable this option to prepend a leading `0`, if the first
* character is non-numeric.
* @param uppercase Enable this option to use uppercase letters ('A'-'F') instead
* of lowercase ones ('a'-'f').
* @param force_sign Enable this option to print the `+` sign for positive numbers.
* @param prefix The string to use as prefix or `ZYAN_NULL`, if not needed.
* @param suffix The string to use as suffix or `ZYAN_NULL`, if not needed.
*
* @return `ZYAN_STATUS_SUCCESS`, if the function succeeded, or
* `ZYAN_STATUS_INSUFFICIENT_BUFFER_SIZE`, if the size of the buffer was not
* sufficient to append the given `value`.
* @return A zyan status code.
*
* The string-buffer pointer is increased by the number of chars written, if the call was
* successful.
* This function will fail if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
* `ZyanString` instance.
*/
ZYAN_INLINE ZyanStatus ZydisStringAppendHexS(ZyanString* string, ZyanI64 value,
ZyanU8 padding_length, ZyanBool uppercase, ZyanBool force_sign, const ZyanStringView* prefix,
const ZyanStringView* suffix)
ZyanU8 padding_length, ZyanBool force_leading_number, ZyanBool uppercase, ZyanBool force_sign,
const ZyanStringView* prefix, const ZyanStringView* suffix)
{
static const ZydisShortString str_add = ZYDIS_MAKE_SHORTSTRING("+");
static const ZydisShortString str_sub = ZYDIS_MAKE_SHORTSTRING("-");
@@ -441,8 +446,8 @@ ZYAN_INLINE ZyanStatus ZydisStringAppendHexS(ZyanString* string, ZyanI64 value,
{
ZYAN_CHECK(ZydisStringAppend(string, prefix));
}
return ZydisStringAppendHexU(string, ZyanAbsI64(value), padding_length, uppercase,
(const ZyanStringView*)ZYAN_NULL, suffix);
return ZydisStringAppendHexU(string, ZyanAbsI64(value), padding_length,
force_leading_number, uppercase, (const ZyanStringView*)ZYAN_NULL, suffix);
}
if (force_sign)
@@ -450,7 +455,8 @@ ZYAN_INLINE ZyanStatus ZydisStringAppendHexS(ZyanString* string, ZyanI64 value,
ZYAN_ASSERT(value >= 0);
ZYAN_CHECK(ZydisStringAppendShort(string, &str_add));
}
return ZydisStringAppendHexU(string, value, padding_length, uppercase, prefix, suffix);
return ZydisStringAppendHexU(string, value, padding_length, force_leading_number, uppercase,
prefix, suffix);
}
/* ---------------------------------------------------------------------------------------------- */

View File

@@ -32,9 +32,7 @@
#ifndef ZYDIS_METAINFO_H
#define ZYDIS_METAINFO_H
#include <ZydisExportConfig.h>
#include <Zycore/Defines.h>
#include <Zycore/Types.h>
#include <Zydis/Defines.h>
#ifdef __cplusplus
extern "C" {

View File

@@ -32,7 +32,7 @@
#ifndef ZYDIS_MNEMONIC_H
#define ZYDIS_MNEMONIC_H
#include <Zycore/Types.h>
#include <Zydis/Defines.h>
#include <Zydis/ShortString.h>
#ifdef __cplusplus

View File

@@ -34,6 +34,7 @@
#include <Zycore/Defines.h>
#include <Zycore/Types.h>
#include <Zydis/Defines.h>
#include <Zydis/SharedTypes.h>
#include <Zydis/ShortString.h>
@@ -51,6 +52,45 @@ extern "C" {
#include <Zydis/Generated/EnumRegister.h>
/* ---------------------------------------------------------------------------------------------- */
/* Register kinds */
/* ---------------------------------------------------------------------------------------------- */
/**
* Defines the `ZydisRegisterKind` enum.
*
* Please note that this enum does not contain a matching entry for all values of the
* `ZydisRegister` enum, but only for those registers where it makes sense to logically group them
* for decoding/encoding purposes.
*
* These are mainly the registers that can be identified by an id within their corresponding
* register-class.
*/
typedef enum ZydisRegisterKind_
{
ZYDIS_REGKIND_INVALID,
ZYDIS_REGKIND_GPR,
ZYDIS_REGKIND_X87,
ZYDIS_REGKIND_MMX,
ZYDIS_REGKIND_VR,
ZYDIS_REGKIND_TMM,
ZYDIS_REGKIND_SEGMENT,
ZYDIS_REGKIND_TEST,
ZYDIS_REGKIND_CONTROL,
ZYDIS_REGKIND_DEBUG,
ZYDIS_REGKIND_MASK,
ZYDIS_REGKIND_BOUND,
/**
* Maximum value of this enum.
*/
ZYDIS_REGKIND_MAX_VALUE = ZYDIS_REGKIND_BOUND,
/**
* The minimum number of bits required to represent all values of this enum.
*/
ZYDIS_REGKIND_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_REGKIND_MAX_VALUE)
} ZydisRegisterKind;
/* ---------------------------------------------------------------------------------------------- */
/* Register classes */
/* ---------------------------------------------------------------------------------------------- */
@@ -120,6 +160,10 @@ typedef enum ZydisRegisterClass_
* Segment registers.
*/
ZYDIS_REGCLASS_SEGMENT,
/**
* Table registers.
*/
ZYDIS_REGCLASS_TABLE,
/**
* Test registers.
*/
@@ -238,7 +282,7 @@ ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterGetWidth(ZydisMachineMode mode, Zyd
* @param reg The register.
*
* @return The largest enclosing register of the given register, or `ZYDIS_REGISTER_NONE` if the
* register is invalid for the active machine-mode or does not have an enclosing-register.
* register is invalid for the active machine-mode.
*/
ZYDIS_EXPORT ZydisRegister ZydisRegisterGetLargestEnclosing(ZydisMachineMode mode,
ZydisRegister reg);

178
3rdparty/zydis/include/Zydis/Segment.h vendored Normal file
View File

@@ -0,0 +1,178 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Florian Bernd
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
* Functions and types providing encoding information about individual instruction bytes.
*/
#ifndef ZYDIS_SEGMENT_H
#define ZYDIS_SEGMENT_H
#include <Zycore/Defines.h>
#include <Zydis/DecoderTypes.h>
#include <Zydis/Status.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup segment Segment
* Functions and types providing encoding information about individual instruction bytes.
* @{
*/
/* ============================================================================================== */
/* Macros */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Constants */
/* ---------------------------------------------------------------------------------------------- */
#define ZYDIS_MAX_INSTRUCTION_SEGMENT_COUNT 9
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Enums and types */
/* ============================================================================================== */
/**
* Defines the `ZydisInstructionSegment` struct.
*/
typedef enum ZydisInstructionSegment_
{
ZYDIS_INSTR_SEGMENT_NONE,
/**
* The legacy prefixes (including ignored `REX` prefixes).
*/
ZYDIS_INSTR_SEGMENT_PREFIXES,
/**
* The effective `REX` prefix byte.
*/
ZYDIS_INSTR_SEGMENT_REX,
/**
* The `XOP` prefix bytes.
*/
ZYDIS_INSTR_SEGMENT_XOP,
/**
* The `VEX` prefix bytes.
*/
ZYDIS_INSTR_SEGMENT_VEX,
/**
* The `EVEX` prefix bytes.
*/
ZYDIS_INSTR_SEGMENT_EVEX,
/**
* The `MVEX` prefix bytes.
*/
ZYDIS_INSTR_SEGMENT_MVEX,
/**
* The opcode bytes.
*/
ZYDIS_INSTR_SEGMENT_OPCODE,
/**
* The `ModRM` byte.
*/
ZYDIS_INSTR_SEGMENT_MODRM,
/**
* The `SIB` byte.
*/
ZYDIS_INSTR_SEGMENT_SIB,
/**
* The displacement bytes.
*/
ZYDIS_INSTR_SEGMENT_DISPLACEMENT,
/**
* The immediate bytes.
*/
ZYDIS_INSTR_SEGMENT_IMMEDIATE,
/**
* Maximum value of this enum.
*/
ZYDIS_INSTR_SEGMENT_MAX_VALUE = ZYDIS_INSTR_SEGMENT_IMMEDIATE,
/**
* The minimum number of bits required to represent all values of this enum.
*/
ZYDIS_INSTR_SEGMENT_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_INSTR_SEGMENT_MAX_VALUE)
} ZydisInstructionSegment;
/**
* Defines the `ZydisInstructionSegments` struct.
*/
typedef struct ZydisInstructionSegments_
{
/**
* The number of logical instruction segments.
*/
ZyanU8 count;
struct
{
/**
* The type of the segment.
*/
ZydisInstructionSegment type;
/**
* The offset of the segment relative to the start of the instruction (in bytes).
*/
ZyanU8 offset;
/**
* The size of the segment, in bytes.
*/
ZyanU8 size;
} segments[ZYDIS_MAX_INSTRUCTION_SEGMENT_COUNT];
} ZydisInstructionSegments;
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
/**
* Returns offsets and sizes of all logical instruction segments (e.g. `OPCODE`,
* `MODRM`, ...).
*
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param segments Receives the instruction segments information.
*
* @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisGetInstructionSegments(const ZydisDecodedInstruction* instruction,
ZydisInstructionSegments* segments);
/* ============================================================================================== */
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_SEGMENT_H */

Some files were not shown because too many files have changed in this diff Show More