Recent

Author Topic: Windows API schema targets utility  (Read 676 times)

440bx

  • Hero Member
  • *****
  • Posts: 4029
Windows API schema targets utility
« on: November 14, 2022, 04:01:58 pm »
Hello,

This utility is for programmers who routinely disassemble Windows system dlls. 

Starting with Windows 7, MS created API schemas that are just redirection stubs presumably to group APIs by their function instead of by the DLL that implements them.

This is inconvenient when looking at disassemblies because instead of seeing the real target dll (e.g, ntdll, kernel32, gdi32, etc) what appears is some long, not particularly enlightening name along the lines of api-ms-core-bla-bla-bla-l0-l1.dll

SchemaTargets (this utility) replaces all references to API schemas found in a dll with their real target dll names.  Therefore if api-ms-bla-bla-bla.dll refers to functions in ntdll, SchemaTargets replaces api-ms-bla-bla-bla.dll with ntdll.dll

Note that SchemaTargets _never_ modifies the original dlls (Windows wouldn't let it even if it tried), it creates patched dlls under directories named "x32" or "x64" (depending on the dll's bitness) and a subdirectory indicating the applicable Windows version.

Pascal source and, Lazarus project (for ease of compilation) included.  No executables included.  Sample run screenshot attached (note: make the console very wide, 160 columns or more.)  Read the "Notes.pas" file for additional information.

Questions and comments welcome.

Enjoy!

« Last Edit: November 14, 2022, 04:05:49 pm by 440bx »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

silvestre

  • Jr. Member
  • **
  • Posts: 77
Re: Windows API schema targets utility
« Reply #1 on: November 14, 2022, 05:57:33 pm »
Nice code! ;D

Hello,

This utility is for programmers who routinely disassemble Windows system dlls.... 

« Last Edit: November 14, 2022, 06:18:41 pm by silvestre »

440bx

  • Hero Member
  • *****
  • Posts: 4029
Re: Windows API schema targets utility
« Reply #2 on: November 14, 2022, 06:35:59 pm »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018