├── .gitignore ├── Asset └── Screenshots │ ├── 1-Main.png │ ├── 6-ClassProp.png │ ├── 2-FindWindow.png │ ├── 3-GeneralProp.png │ ├── 4-ResourceProp.png │ ├── 7-OperationProp.png │ └── 5-RelationshipProp.png ├── Source ├── AlleyWind │ ├── Resource │ │ ├── App.ico │ │ ├── Pick.cur │ │ ├── Capture.cur │ │ ├── Icon32.png │ │ ├── Icon48.png │ │ └── Icon64.png │ ├── 3rdParty │ │ ├── include │ │ │ └── NTAssassin │ │ │ │ ├── NTATypes.h │ │ │ │ ├── NTADbg.h │ │ │ │ ├── NTAWS.h │ │ │ │ ├── NTAHook.h │ │ │ │ ├── NTAOpCode.h │ │ │ │ ├── NTConst.h │ │ │ │ ├── NTAData.h │ │ │ │ ├── NTAssassin.h │ │ │ │ ├── NTAShell.h │ │ │ │ ├── NTATime.h │ │ │ │ ├── NTObject.h │ │ │ │ ├── NTTypes.h │ │ │ │ ├── NTACtl_ColorPicker.h │ │ │ │ ├── NTAMath.h │ │ │ │ ├── NTAIO.h │ │ │ │ ├── NTAConst.h │ │ │ │ ├── NTASys.h │ │ │ │ ├── NTAMem.h │ │ │ │ ├── NTAOptions.h │ │ │ │ ├── NTAMacro.h │ │ │ │ ├── NTADPI.h │ │ │ │ ├── NTANT_UCRT.h │ │ │ │ ├── NTACon.h │ │ │ │ ├── NTAI18N.h │ │ │ │ ├── NTAKNS.h │ │ │ │ ├── NTAFile.h │ │ │ │ ├── NTAEH.h │ │ │ │ ├── NTAGDIP.h │ │ │ │ ├── NTAHijack.h │ │ │ │ ├── NTAData_List.h │ │ │ │ ├── NTAGDI.h │ │ │ │ ├── NTAPE.h │ │ │ │ ├── NTAProc.h │ │ │ │ ├── NTACtl.h │ │ │ │ ├── NTADlg.h │ │ │ │ ├── NTARProc.h │ │ │ │ ├── NTStruct.h │ │ │ │ ├── NTAUI.h │ │ │ │ └── NTADef.h │ │ ├── bin │ │ │ └── Precomp4C │ │ │ │ ├── Precomp4C.dll │ │ │ │ ├── Precomp4C.exe │ │ │ │ ├── Precomp4C.pdb │ │ │ │ ├── Precomp4C.runtimeconfig.json │ │ │ │ └── Precomp4C.deps.json │ │ └── lib │ │ │ ├── x64 │ │ │ ├── Debug │ │ │ │ └── NTAssassin.lib │ │ │ └── Release │ │ │ │ └── NTAssassin.lib │ │ │ └── x86 │ │ │ ├── Debug │ │ │ └── NTAssassin.lib │ │ │ └── Release │ │ │ └── NTAssassin.lib │ ├── AWSettings.h │ ├── Precomp4C.config.json │ ├── AWSettings.c │ ├── AlleyWind.I18N.json │ ├── AWWndIO.h │ ├── FindWnd.I18N.json │ ├── Class.I18N.json │ ├── WndProp.I18N.json │ ├── DB_StyleEditor.h │ ├── AWWndProp.h │ ├── Resource.I18N.json │ ├── General.I18N.json │ ├── MainDlg.I18N.json │ ├── AlleyWind.c │ ├── Relationship.I18N.json │ ├── Operation.I18N.json │ ├── DB_Message.h │ ├── WndProp.c │ ├── AlleyWind.h │ ├── AWWndIO.c │ ├── Message.I18N.json │ ├── AWDatabase.I18N.json │ ├── AlleyWind.vcxproj.filters │ ├── Precomp4C.Output.h │ ├── Class.c │ ├── AWWndProp.c │ ├── General.c │ ├── resource.h │ └── AlleyWind.vcxproj ├── .gitignore ├── KNSoft.Before.Cpp.props ├── Directory.Build.props ├── AlleyWind.sln └── .editorconfig ├── Publish.cmd ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .vs 2 | /Release -------------------------------------------------------------------------------- /Asset/Screenshots/1-Main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Asset/Screenshots/1-Main.png -------------------------------------------------------------------------------- /Asset/Screenshots/6-ClassProp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Asset/Screenshots/6-ClassProp.png -------------------------------------------------------------------------------- /Source/AlleyWind/Resource/App.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/Resource/App.ico -------------------------------------------------------------------------------- /Asset/Screenshots/2-FindWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Asset/Screenshots/2-FindWindow.png -------------------------------------------------------------------------------- /Asset/Screenshots/3-GeneralProp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Asset/Screenshots/3-GeneralProp.png -------------------------------------------------------------------------------- /Source/AlleyWind/Resource/Pick.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/Resource/Pick.cur -------------------------------------------------------------------------------- /Asset/Screenshots/4-ResourceProp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Asset/Screenshots/4-ResourceProp.png -------------------------------------------------------------------------------- /Asset/Screenshots/7-OperationProp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Asset/Screenshots/7-OperationProp.png -------------------------------------------------------------------------------- /Source/AlleyWind/Resource/Capture.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/Resource/Capture.cur -------------------------------------------------------------------------------- /Source/AlleyWind/Resource/Icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/Resource/Icon32.png -------------------------------------------------------------------------------- /Source/AlleyWind/Resource/Icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/Resource/Icon48.png -------------------------------------------------------------------------------- /Source/AlleyWind/Resource/Icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/Resource/Icon64.png -------------------------------------------------------------------------------- /Asset/Screenshots/5-RelationshipProp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Asset/Screenshots/5-RelationshipProp.png -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTATypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define PTR32 __ptr32 4 | #define PTR64 __ptr64 5 | -------------------------------------------------------------------------------- /Source/.gitignore: -------------------------------------------------------------------------------- 1 | .vs 2 | /x86 3 | /x64 4 | /AlleyWind/x86 5 | /AlleyWind/x64 6 | *.vcxproj.user 7 | *.aps 8 | /AlleyWind/Resource/*.fla -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTADbg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | #if _DEBUG 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/bin/Precomp4C/Precomp4C.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/3rdParty/bin/Precomp4C/Precomp4C.dll -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/bin/Precomp4C/Precomp4C.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/3rdParty/bin/Precomp4C/Precomp4C.exe -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/bin/Precomp4C/Precomp4C.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/3rdParty/bin/Precomp4C/Precomp4C.pdb -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/lib/x64/Debug/NTAssassin.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/3rdParty/lib/x64/Debug/NTAssassin.lib -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/lib/x86/Debug/NTAssassin.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/3rdParty/lib/x86/Debug/NTAssassin.lib -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/lib/x64/Release/NTAssassin.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/3rdParty/lib/x64/Release/NTAssassin.lib -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/lib/x86/Release/NTAssassin.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KNSoft/AlleyWind/HEAD/Source/AlleyWind/3rdParty/lib/x86/Release/NTAssassin.lib -------------------------------------------------------------------------------- /Source/KNSoft.Before.Cpp.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | $(DefaultPlatformToolset) 4 | 5 | -------------------------------------------------------------------------------- /Source/AlleyWind/AWSettings.h: -------------------------------------------------------------------------------- 1 | typedef enum _AW_SETTING_INDEX { 2 | AWSetting_ResponseTimeout 3 | } AW_SETTING_INDEX, * PAW_SETTING_INDEX; 4 | 5 | VOID AWSettings_Init(); 6 | DWORD AWSettings_GetItemValueEx(INT Index); -------------------------------------------------------------------------------- /Publish.cmd: -------------------------------------------------------------------------------- 1 | RD /S /Q "%~dp0Release" 2 | MD "%~dp0Release" 3 | COPY /Y "%~dp0Source\x86\Release\AlleyWind.exe" "%~dp0Release\AlleyWind_x86.exe" 4 | COPY /Y "%~dp0Source\x64\Release\AlleyWind.exe" "%~dp0Release\AlleyWind_x64.exe" 5 | PAUSE -------------------------------------------------------------------------------- /Source/AlleyWind/Precomp4C.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "NTAssassinIntegrate": "3rdParty\\include\\NTAssassin\\NTAssassin.h", 3 | "Loaders": { 4 | "I18N": { 5 | "Pattern": "*.I18N.json", 6 | "Default": "en" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /Source/AlleyWind/AWSettings.c: -------------------------------------------------------------------------------- 1 | #include "AlleyWind.h" 2 | 3 | UINT uSendMsgTO = 200; 4 | 5 | VOID AWSettings_Init() { 6 | 7 | } 8 | 9 | DWORD AWSettings_GetItemValueEx(INT Index) { 10 | if (Index == AWSetting_ResponseTimeout) 11 | return uSendMsgTO; 12 | return TRUE; 13 | } -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/bin/Precomp4C/Precomp4C.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "net6.0", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "6.0.0" 7 | }, 8 | "configProperties": { 9 | "System.Reflection.Metadata.MetadataUpdater.IsSupported": false 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAWS.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | #include 6 | 7 | #define WS_Htons(x) (((x & 0x00FF) << 8) | ((x & 0xFF00) >> 8)) 8 | 9 | NTA_API BOOL NTAPI WS_Startup(); 10 | 11 | _Check_return_ NTA_API SOCKET NTAPI WS_CreateIPv4ListenSocket(IPPROTO Protocol, PIN_ADDR Address, USHORT Port); 12 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAHook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | #pragma region C-style wrappers of Microsoft Detours 6 | 7 | NTA_API BOOL NTAPI Hook_Begin(); 8 | NTA_API BOOL NTAPI Hook_Set(BOOL Enable, PVOID* Address, PVOID HookAddress); 9 | NTA_API BOOL NTAPI Hook_Attach(PVOID* Address, PVOID HookAddress); 10 | NTA_API BOOL NTAPI Hook_Detach(PVOID* Address, PVOID HookAddress); 11 | NTA_API BOOL NTAPI Hook_Commit(); 12 | 13 | #pragma endregion 14 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/bin/Precomp4C/Precomp4C.deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeTarget": { 3 | "name": ".NETCoreApp,Version=v6.0", 4 | "signature": "" 5 | }, 6 | "compilationOptions": {}, 7 | "targets": { 8 | ".NETCoreApp,Version=v6.0": { 9 | "Precomp4C/1.0.0.0": { 10 | "runtime": { 11 | "Precomp4C.dll": {} 12 | } 13 | } 14 | } 15 | }, 16 | "libraries": { 17 | "Precomp4C/1.0.0.0": { 18 | "type": "project", 19 | "serviceable": false, 20 | "sha512": "" 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAOpCode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | #define OPCODE_X86_NOP ((BYTE)0x90) 6 | #define OPCODE_X64_NOP ((BYTE)0x90) 7 | #define OPCODE_X86_INT3_CC ((BYTE)0xCC) 8 | #define OPCODE_X64_INT3_CC ((BYTE)0xCC) 9 | 10 | #if _M_IX86 11 | #define OPCODE_NOP OPCODE_X86_NOP 12 | #define OPCODE_INT3_CC OPCODE_X86_INT3_CC 13 | #elif _M_X64 14 | #define OPCODE_NOP OPCODE_X64_NOP 15 | #define OPCODE_INT3_CC OPCODE_X64_INT3_CC 16 | #else 17 | #error OPCODE_NOP not supported current platform! 18 | #endif 19 | -------------------------------------------------------------------------------- /Source/AlleyWind/AlleyWind.I18N.json: -------------------------------------------------------------------------------- 1 | { 2 | "None": { 3 | "en": "None", 4 | "zh-Hans": "无" 5 | }, 6 | "OK": { 7 | "en": "OK", 8 | "zh-Hans": "确定" 9 | }, 10 | "Apply": { 11 | "en": "Apply", 12 | "zh-Hans": "应用" 13 | }, 14 | "NotApplicable": { 15 | "en": "(N/A)", 16 | "zh-Hans": "(不可用)" 17 | }, 18 | "Refresh": { 19 | "en": "Refresh", 20 | "zh-Hans": "刷新" 21 | }, 22 | "Cancel": { 23 | "en": "Cancel", 24 | "zh-Hans": "取消" 25 | } 26 | } -------------------------------------------------------------------------------- /Source/AlleyWind/AWWndIO.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "AlleyWind.h" 4 | 5 | typedef struct _AW_ENUMCHILDREN { 6 | HTREEITEM hParentNode; 7 | UINT uCount; 8 | } AW_ENUMCHILDREN, * PAW_ENUMCHILDREN; 9 | 10 | LRESULT AW_SendMsgTO(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, PDWORD_PTR lpdwResult); 11 | 12 | UINT AW_GetWindowTextEx(HWND hWnd, PWSTR psz, UINT cCh); 13 | #define AW_GetWindowText(hWnd, psz) AW_GetWindowTextEx(hWnd, psz, ARRAYSIZE(psz)) 14 | 15 | VOID AW_HighlightWindow(HWND hWnd); 16 | 17 | PCSTR AW_GetWindowLongFunc(BOOL ClassLong, BOOL b32Proc, BOOL bUnicode); -------------------------------------------------------------------------------- /Source/AlleyWind/FindWnd.I18N.json: -------------------------------------------------------------------------------- 1 | { 2 | "FindWindow": { 3 | "en": "Find Window", 4 | "zh-Hans": "查找窗口" 5 | }, 6 | "Capture": { 7 | "en": "Capture", 8 | "zh-Hans": "捕获" 9 | }, 10 | "Ignore": { 11 | "en": "Ignore", 12 | "zh-Hans": "忽略" 13 | }, 14 | "ChildLevel": { 15 | "en": "Child level", 16 | "zh-Hans": "子级" 17 | }, 18 | "Transparent": { 19 | "en": "Transparent", 20 | "zh-Hans": "透明" 21 | }, 22 | "Find": { 23 | "en": "Find", 24 | "zh-Hans": "查找" 25 | } 26 | } -------------------------------------------------------------------------------- /Source/AlleyWind/Class.I18N.json: -------------------------------------------------------------------------------- 1 | { 2 | "Name": { 3 | "en": "Name", 4 | "zh-Hans": "名称" 5 | }, 6 | "MenuResource": { 7 | "en": "Menu Resource", 8 | "zh-Hans": "菜单资源" 9 | }, 10 | "Icon": { 11 | "en": "Icon", 12 | "zh-Hans": "图标" 13 | }, 14 | "SmallIcon": { 15 | "en": "Small Icon", 16 | "zh-Hans": "小图标" 17 | }, 18 | "BackgroundBrush": { 19 | "en": "Background Brush", 20 | "zh-Hans": "背景画刷" 21 | }, 22 | "WindowBytesSize": { 23 | "en": "Window Bytes Size", 24 | "zh-Hans": "窗口字节大小" 25 | } 26 | } -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTConst.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Windows NT 4 | 5 | #define STRSAFE_MAX_CCH 2147483647 6 | #define STRSAFE_MAX_LENGTH (STRSAFE_MAX_CCH - 1) 7 | #define PROCESSOR_FEATURE_MAX 64 8 | #define MM_SHARED_USER_DATA_VA 0x7FFE0000 9 | 10 | // User32 11 | #ifndef WM_COPYGLOBALDATA 12 | #define WM_COPYGLOBALDATA 0x49 13 | #endif 14 | 15 | // Patches C26454 warning 16 | 17 | #undef NM_FIRST 18 | #define NM_FIRST 4294967296 19 | 20 | #undef TCN_FIRST 21 | #define TCN_FIRST 4294966746 22 | 23 | #undef TVN_FIRST 24 | #define TVN_FIRST 0xFFFFFE70 25 | 26 | #undef LVN_FIRST 27 | #define LVN_FIRST 0xFFFFFF9C 28 | -------------------------------------------------------------------------------- /Source/AlleyWind/WndProp.I18N.json: -------------------------------------------------------------------------------- 1 | { 2 | "General": { 3 | "en": "General", 4 | "zh-Hans": "常规" 5 | }, 6 | "Resource": { 7 | "en": "Resource", 8 | "zh-Hans": "资源" 9 | }, 10 | "Relationship": { 11 | "en": "Relationship", 12 | "zh-Hans": "关系" 13 | }, 14 | "Class": { 15 | "en": "Class", 16 | "zh-Hans": "类" 17 | }, 18 | "Operation": { 19 | "en": "Operation", 20 | "zh-Hans": "操作" 21 | }, 22 | "Message": { 23 | "en": "Message", 24 | "zh-Hans": "消息" 25 | }, 26 | "Window": { 27 | "en": "Window", 28 | "zh-Hans": "窗口" 29 | } 30 | } -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | /// 6 | /// Combines groups of structures into a new allocated buffer 7 | /// 8 | /// Number of groups 9 | /// Size of single structure in bytes 10 | /// pst1, u1, pst2, u2, ... 11 | /// New allocated buffer that combined groups of structures input, should be freed by calling "Mem_Free" 12 | NTA_API _Check_return_ PVOID WINAPIV Data_StructCombineEx(_In_ UINT GroupCount, _In_ UINT Size, ...); 13 | 14 | #define Data_StructCombine(GroupCount, Type, ...) (Type*)Data_StructCombineEx(GroupCount, sizeof(Type), __VA_ARGS__) 15 | -------------------------------------------------------------------------------- /Source/AlleyWind/DB_StyleEditor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "AlleyWind.h" 4 | 5 | EXTERN_C PCWSTR DB_lpszDVE[7]; 6 | EXTERN_C PCWSTR DB_lpszDRE[9]; 7 | 8 | typedef struct _AW_SYSCLASSINFO { 9 | PTSTR ClassName; 10 | union { 11 | UINT_PTR I18NIndex; 12 | PWSTR DisplayName; 13 | }; 14 | PDLG_VALUEEDITOR_CONST StyleConsts; 15 | UINT StyleConstsCount; 16 | } AW_SYSCLASSINFO, * PAW_SYSCLASSINFO; 17 | 18 | typedef enum _AW_VALUETYPE { 19 | AWValueStyle, 20 | AWValueExStyle, 21 | AWValueClass 22 | } AW_VALUETYPE, *PAW_VALUETYPE; 23 | 24 | PAW_SYSCLASSINFO AW_DBFindSysClassInfoByName(PTSTR pszClassName); 25 | PAW_SYSCLASSINFO AW_DBFindSysClassInfo(HWND hWnd); 26 | 27 | BOOL AW_DBEditValue(HWND hDlg, HWND hWnd, AW_VALUETYPE eType, PDWORD lpdwValue); -------------------------------------------------------------------------------- /Source/AlleyWind/AWWndProp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "AlleyWind.h" 4 | 5 | #define AW_WNDPROP_HWND TEXT("AlleyWind.WndProp.hWnd") 6 | 7 | CTL_LISTCTL_COLUME aExtraBytesListCol[2]; 8 | 9 | HWND AW_GetWndPropHWnd(HWND hDlg); 10 | BOOL AW_SetWndPropHWnd(HWND hDlg, HWND hWnd); 11 | HWND AW_RemoveWndPropHWnd(HWND hDlg); 12 | 13 | VOID AW_SetPropCtlFormat(HWND hDlg, UINT uCtlID, BOOL bSuccess, _Printf_format_string_ LPTSTR lpszFormat, ...); 14 | 15 | VOID AW_SetPropCtlString(HWND hDlg, UINT uCtlID, LPCWSTR lpszString, BOOL bSuccess); 16 | 17 | VOID AW_SetPropCtlCheck(HWND hDlg, UINT uCtlID, UINT_PTR uCheck, BOOL bSuccess); 18 | 19 | VOID AW_SetPropCtlRect(HWND hDlg, UINT uCtlID, PRECT lpRect, BOOL bSuccess); 20 | 21 | BOOL CALLBACK AW_WndPropExtraBytesEnumProc(DWORD dwOffset, LONG_PTR lBytes, UINT uSize, DWORD dwError, LPARAM lParam); 22 | BOOL AW_EnumExtraBytes(HWND hWnd, BOOL bClassExtraBytes, LPARAM lParam); -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAssassin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | EXTERN_C_START 6 | 7 | #include "NTAOpCode.h" 8 | #include "NTANT_UCRT.h" 9 | #include "NTANT.h" 10 | #include "NTAEH.h" 11 | #include "NTAData.h" 12 | #include "NTADbg.h" 13 | #include "NTAMath.h" 14 | #include "NTAStr.h" 15 | #include "NTAData_List.h" 16 | #include "NTAMem.h" 17 | #include "NTAPE.h" 18 | #include "NTAProc.h" 19 | #include "NTARProc.h" 20 | #include "NTACon.h" 21 | #include "NTAUI.h" 22 | #include "NTACtl.h" 23 | #include "NTAGDI.h" 24 | #include "NTADlg.h" 25 | #include "NTAI18N.h" 26 | #include "NTAFile.h" 27 | #include "NTAIO.h" 28 | #include "NTATime.h" 29 | #include "NTASys.h" 30 | #include "NTAHijack.h" 31 | #include "NTADPI.h" 32 | #include "NTAGDIP.h" 33 | #include "NTAHook.h" 34 | #include "NTAShell.h" 35 | #include "NTAWS.h" 36 | #include "NTAKNS.h" 37 | 38 | EXTERN_C_END 39 | -------------------------------------------------------------------------------- /Source/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MsbuildThisFileDirectory)\KNSoft.Before.Cpp.props 5 | 6 | 7 | 8 | 9 | stdcpp20 10 | stdc17 11 | pch.h 12 | false 13 | 14 | 15 | 16 | 17 | $([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../')) 18 | 19 | 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 KNSoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAShell.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | /// 6 | NTA_API BOOL NTAPI Shell_Exec(_In_ PCWSTR File, _In_opt_ PCWSTR Param, PCWSTR Verb, INT ShowCmd, PHANDLE ProcessHandle); 7 | 8 | /// 9 | /// Locates specified file or directory in explorer 10 | /// 11 | /// Path of file or directory 12 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last ERROR 13 | NTA_API BOOL NTAPI Shell_Locate(_In_ PCWSTR Path); 14 | 15 | /// 16 | /// Resolves a shortcut link 17 | /// 18 | /// Path to the shortcut file 19 | /// Pointer to the buffer to receive path 20 | /// The size of the Path buffer in characters 21 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last ERROR 22 | _Success_(return != FALSE) NTA_API BOOL NTAPI Shell_GetLinkPath(_In_ PCWSTR LinkFile, _Out_writes_z_(PathCchSize) PWSTR Path, _In_ INT PathCchSize); 23 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTATime.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | /// 6 | /// Gets time interval like stop watch 7 | /// 8 | /// Reference time to calcuate interval, or pass 0 to have a new one 9 | /// Time interval from PrevTime to now, or current time if PrevTime is 0 10 | /// Time_StopWatch[Unit], Unit is time unit used in the function. "Time_StopWatch" equals to "Time_StopWatch1ms", which unit is 1ms 11 | NTA_API ULONGLONG NTAPI Time_StopWatch100nm(ULONGLONG PrevTime); 12 | NTA_API ULONGLONG NTAPI Time_StopWatch1ms(ULONGLONG PrevTime); 13 | NTA_API ULONGLONG NTAPI Time_StopWatch1us(ULONGLONG PrevTime); 14 | #define Time_StopWatch Time_StopWatch1ms 15 | 16 | /// 17 | /// Converts Unix timestamp to FILETIME 18 | /// 19 | /// Converting a time_t value to a FILETIME - Microsoft Learn 20 | NTA_API VOID NTAPI Time_UnixTimeToFileTime(time_t UnixTime, PFILETIME FileTime); 21 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTStruct.h" 4 | 5 | // Well-known SIDs 6 | EXTERN_C PSID PSID_EVERYONE; 7 | EXTERN_C PSID PSID_SYSTEM; 8 | EXTERN_C PSID PSID_ADMINISTRATORS; 9 | EXTERN_C PSID PSID_USERS; 10 | EXTERN_C PSID PSID_AUTHENTICATED_USER; 11 | EXTERN_C PSID PSID_LOCAL_SERVICE; 12 | EXTERN_C PSID PSID_NETWORK_SERVICE; 13 | EXTERN_C PSID PSID_TRUSTED_INSTALLER; 14 | 15 | EXTERN_C PSID PSID_LOCAL_ACCOUNT; 16 | EXTERN_C PSID PSID_LOCAL_ACCOUNT_AND_ADMIN; 17 | EXTERN_C PSID PSID_LOCAL; 18 | EXTERN_C PSID PSID_LOCAL_LOGON; 19 | EXTERN_C PSID PSID_INTERACTIVE; 20 | EXTERN_C PSID PSID_NTLM; 21 | EXTERN_C PSID PSID_THIS_ORGANIZATION; 22 | 23 | EXTERN_C PSID PSID_MANDATORY_UNTRUSTED; 24 | EXTERN_C PSID PSID_MANDATORY_LOW; 25 | EXTERN_C PSID PSID_MANDATORY_MEDIUM; 26 | EXTERN_C PSID PSID_MANDATORY_MEDIUM_PLUS; 27 | EXTERN_C PSID PSID_MANDATORY_HIGH; 28 | EXTERN_C PSID PSID_MANDATORY_SYSTEM; 29 | EXTERN_C PSID PSID_MANDATORY_PROTECTED_PROCESS; 30 | 31 | // Well-known privileges 32 | EXTERN_C PSE_PRIVILEGE WELL_KNOWN_PRIVILEGES; 33 | EXTERN_C DWORD WELL_KNOWN_PRIVILEGES_SIZE; 34 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | typedef DWORD64 QWORD, *PQWORD, *LPQWORD; 6 | typedef SID* PSID; 7 | 8 | typedef BOOL(WINAPI* PFNCreateProcessInternalW)( 9 | _In_opt_ HANDLE hToken, 10 | _In_opt_ LPCWSTR lpApplicationName, 11 | _Inout_opt_ LPWSTR lpCommandLine, 12 | _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, 13 | _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, 14 | _In_ BOOL bInheritHandles, 15 | _In_ DWORD dwCreationFlags, 16 | _In_opt_ LPVOID lpEnvironment, 17 | _In_opt_ LPCWSTR lpCurrentDirectory, 18 | _In_ LPSTARTUPINFOW lpStartupInfo, 19 | _Out_ LPPROCESS_INFORMATION lpProcessInformation, 20 | _Out_opt_ PHANDLE hNewToken 21 | ); 22 | 23 | typedef NTSTATUS(NTAPI* PFNLdrLoadDll)( 24 | IN PWSTR SearchPath OPTIONAL, 25 | IN PULONG DllCharacteristics OPTIONAL, 26 | IN PUNICODE_STRING DllName, 27 | OUT PVOID* BaseAddress 28 | ); 29 | 30 | typedef NTSTATUS(NTAPI* PFNLdrGetProcedureAddress)( 31 | IN PVOID BaseAddress, 32 | IN PANSI_STRING Name, 33 | IN ULONG Ordinal, 34 | OUT PVOID* ProcedureAddress 35 | ); 36 | -------------------------------------------------------------------------------- /Source/AlleyWind/Resource.I18N.json: -------------------------------------------------------------------------------- 1 | { 2 | "ClientAreaImage": { 3 | "en": "Client Area Image", 4 | "zh-Hans": "客户区域图像" 5 | }, 6 | "Copy": { 7 | "en": "Copy", 8 | "zh-Hans": "复制" 9 | }, 10 | "Save": { 11 | "en": "Save", 12 | "zh-Hans": "保存" 13 | }, 14 | "SaveImageFailed": { 15 | "en": "Save image failed", 16 | "zh-Hans": "保存图像失败" 17 | }, 18 | "InstanceHandle": { 19 | "en": "Instance Handle", 20 | "zh-Hans": "实例句柄" 21 | }, 22 | "FontHandle": { 23 | "en": "Font Handle", 24 | "zh-Hans": "字体句柄" 25 | }, 26 | "MenuHandle": { 27 | "en": "Menu Handle", 28 | "zh-Hans": "菜单句柄" 29 | }, 30 | "Icons": { 31 | "en": "Icons", 32 | "zh-Hans": "图标" 33 | }, 34 | "HotKey": { 35 | "en": "Hot Key", 36 | "zh-Hans": "热键" 37 | }, 38 | "Cursor": { 39 | "en": "Cursor", 40 | "zh-Hans": "光标" 41 | }, 42 | "PropertyList": { 43 | "en": "Property List", 44 | "zh-Hans": "属性列表" 45 | }, 46 | "Entry": { 47 | "en": "Entry", 48 | "zh-Hans": "条目" 49 | } 50 | } -------------------------------------------------------------------------------- /Source/AlleyWind/General.I18N.json: -------------------------------------------------------------------------------- 1 | { 2 | "Caption": { 3 | "en": "Caption", 4 | "zh-Hans": "标题" 5 | }, 6 | "Handle": { 7 | "en": "Handle", 8 | "zh-Hans": "句柄" 9 | }, 10 | "WindowProcedure": { 11 | "en": "Window Procedure", 12 | "zh-Hans": "窗口过程" 13 | }, 14 | "ControlID": { 15 | "en": "Control ID", 16 | "zh-Hans": "控件ID" 17 | }, 18 | "SystemClass": { 19 | "en": "System Class", 20 | "zh-Hans": "系统类" 21 | }, 22 | "Style": { 23 | "en": "Style", 24 | "zh-Hans": "样式" 25 | }, 26 | "ExtendedStyle": { 27 | "en": "Extended Style", 28 | "zh-Hans": "扩展样式" 29 | }, 30 | "UserData": { 31 | "en": "User Data", 32 | "zh-Hans": "用户数据" 33 | }, 34 | "Rectangle": { 35 | "en": "Rectangle", 36 | "zh-Hans": "矩形" 37 | }, 38 | "RelativePosition": { 39 | "en": "Relative Position", 40 | "zh-Hans": "相对位置" 41 | }, 42 | "ExtraBytes": { 43 | "en": "Extra Bytes", 44 | "zh-Hans": "附加数据" 45 | }, 46 | "Offset": { 47 | "en": "Offset", 48 | "zh-Hans": "偏移" 49 | }, 50 | "Data": { 51 | "en": "Data", 52 | "zh-Hans": "数据" 53 | } 54 | } -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTACtl_ColorPicker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | /// 6 | /// Subclasses a button control to be a RGB color picker 7 | /// 8 | /// Handle to the button control 9 | /// Initial color, or CTL_COLORPICKER_NOCOLOR 10 | /// TRUE if succeeded, or FALSE if failed, no error code reports due to SetWindowSubclass does 11 | NTA_API BOOL NTAPI Ctl_SetColorPickerSubclass(HWND ButtonCtl, COLORREF Color); 12 | 13 | /// 14 | /// Gets RGB value of color picker subclassed by "Ctl_SetColorPickerSubclass" 15 | /// 16 | /// Handle to the button control 17 | /// RGB value or CTL_COLORPICKER_NOCOLOR 18 | NTA_API COLORREF NTAPI Ctl_GetColorPickerValue(HWND ButtonCtl); 19 | 20 | /// 21 | /// Sets RGB value of color picker subclassed by "Ctl_SetColorPickerSubclass" 22 | /// 23 | /// Handle to the button control 24 | /// RGB value to set or CTL_COLORPICKER_NOCOLOR 25 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last ERROR 26 | NTA_API BOOL NTAPI Ctl_SetColorPickerValue(HWND ButtonCtl, COLORREF Color); 27 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAMath.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | /// 6 | /// Rounds a value 7 | /// 8 | #define Math_RoundUInt(val) ((UINT)((val) + 0.5)) 9 | #define Math_RoundInt(val) ((INT)((val) + ((val) > 0 ? 0.5 : -0.5))) 10 | #define Math_RoundUIntPtr(val) ((INT_PTR)((val) + 0.5)) 11 | #define Math_RoundIntPtr(val) ((INT_PTR)((val) + ((val) > 0 ? 0.5 : -0.5))) 12 | 13 | /// 14 | /// Generates a random 15 | /// 16 | /// 17 | /// A random number within [0, MAXLONG-1] 18 | NTA_API ULONG NTAPI Math_Random(); 19 | 20 | /// 21 | /// Generates a random within specified range 22 | /// 23 | /// 24 | /// Minimum, within [0, MAXLONG-1] 25 | /// Maximum, within [Min, MAXLONG-1] 26 | /// A random number within [Min, Max] 27 | NTA_API ULONG NTAPI Math_RangedRandom(ULONG Min, ULONG Max); 28 | 29 | /// 30 | /// Checks the number is a power of 2 31 | /// 32 | #define Math_IsPowerOf2(n) ((n != 0) && ((n & (n - 1)) == 0)) 33 | 34 | /// 35 | /// Gets the absolute difference between two numbers 36 | /// 37 | #define Math_AbsDiff(v1, v2) ((v1) > (v2) ? (v1) - (v2) : (v2) - (v1)) 38 | -------------------------------------------------------------------------------- /Source/AlleyWind/MainDlg.I18N.json: -------------------------------------------------------------------------------- 1 | { 2 | "File": { 3 | "en": "File", 4 | "zh-Hans": "文件" 5 | }, 6 | "Tool": { 7 | "en": "Tool", 8 | "zh-Hans": "工具" 9 | }, 10 | "Help": { 11 | "en": "Help", 12 | "zh-Hans": "帮助" 13 | }, 14 | "MenuReload": { 15 | "en": "Reload\tF5", 16 | "zh-Hans": "重新加载\tF5" 17 | }, 18 | "MenuSaveTree": { 19 | "en": "Save Tree\tCtrl+S", 20 | "zh-Hans": "保存树\tCtrl+S" 21 | }, 22 | "Options": { 23 | "en": "Options", 24 | "zh-Hans": "选项" 25 | }, 26 | "MenuExit": { 27 | "en": "Exit\tAlt+F4", 28 | "zh-Hans": "退出\tAlt+F4" 29 | }, 30 | "MenuFindWindow": { 31 | "en": "Find Window\tCtrl+F", 32 | "zh-Hans": "查找窗口\tCtrl+F" 33 | }, 34 | "About": { 35 | "en": "About", 36 | "zh-Hans": "关于" 37 | }, 38 | "Homepage": { 39 | "en": "Homepage", 40 | "zh-Hans": "主页" 41 | }, 42 | "ExportTreeFilter": { 43 | "en": "Text Files(*.txt)\u0000*.txt\u0000", 44 | "zh-Hans": "文本文档(*.txt)\u0000*.txt\u0000" 45 | }, 46 | "ExportTreeFailed": { 47 | "en": "Export window tree failed", 48 | "zh-Hans": "导出窗口树失败" 49 | }, 50 | "SearchResult": { 51 | "en": "Search Result", 52 | "zh-Hans": "搜索结果" 53 | } 54 | } -------------------------------------------------------------------------------- /Source/AlleyWind/AlleyWind.c: -------------------------------------------------------------------------------- 1 | #include "AlleyWind.h" 2 | 3 | KNS_INFO stKNSInfo = { 4 | KNS_NAME, 5 | TRUE, 6 | { 1, 1, 0, 21224, KNS_VERSION_GA }, 7 | { 8 | RGB(255, 140, 0), 9 | IDI_APP, 10 | IDD_MAIN, 11 | IDR_MAIN, 12 | MainDlgProc, 13 | IDC_MAINBANNER, 14 | 0, 15 | 0, 16 | FALSE 17 | }, 18 | { Precomp4C_I18N_Lang_Table, ARRAYSIZE(Precomp4C_I18N_Lang_Table), Precomp4C_I18N_ITEM_COUNT }, 19 | { 20 | TEXT("https://github.com/KNSoft/AlleyWind/"), 21 | TEXT("https://knsoft.org/Products/AlleyWind/"), 22 | TEXT("https://knsoft.org/Products/AlleyWind/Download/Update.xml"), 23 | NULL 24 | } 25 | }; 26 | 27 | DWORD Main() 28 | { 29 | NTSTATUS Status; 30 | 31 | /* Initialize */ 32 | ULONG_PTR ulpGdipToken; 33 | if (!GDIP_Startup(&ulpGdipToken)) { 34 | Status = STATUS_INSUFFICIENT_RESOURCES; 35 | goto Exit_0; 36 | } 37 | 38 | HRESULT hr; 39 | hr = CoInitializeEx(NULL, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE); 40 | if (FAILED(hr)) { 41 | Status = hr; 42 | goto Exit_1; 43 | } 44 | 45 | /* Run */ 46 | Status = (NTSTATUS)KNS_Startup(&stKNSInfo); 47 | 48 | /* Exit */ 49 | CoUninitialize(); 50 | Exit_1: 51 | GDIP_Shutdown(ulpGdipToken); 52 | Exit_0: 53 | return NtTerminateProcess(CURRENT_PROCESS_HANDLE, Status); 54 | } -------------------------------------------------------------------------------- /Source/AlleyWind/Relationship.I18N.json: -------------------------------------------------------------------------------- 1 | { 2 | "Process": { 3 | "en": "Process", 4 | "zh-Hans": "进程" 5 | }, 6 | "Thread": { 7 | "en": "Thread", 8 | "zh-Hans": "线程" 9 | }, 10 | "Explore": { 11 | "en": "Explore", 12 | "zh-Hans": "浏览" 13 | }, 14 | "Terminate": { 15 | "en": "Terminate", 16 | "zh-Hans": "终止" 17 | }, 18 | "Properties": { 19 | "en": "Properties", 20 | "zh-Hans": "属性" 21 | }, 22 | "LocateInList": { 23 | "en": "Locate in list", 24 | "zh-Hans": "在列表中定位" 25 | }, 26 | "RelatedWindow": { 27 | "en": "Related Window", 28 | "zh-Hans": "相关窗口" 29 | }, 30 | "ParentWindow": { 31 | "en": "Parent Window", 32 | "zh-Hans": "父窗口" 33 | }, 34 | "OwnerWindow": { 35 | "en": "Owner Window", 36 | "zh-Hans": "所有者窗口" 37 | }, 38 | "PreviousWindow": { 39 | "en": "Previous Window", 40 | "zh-Hans": "上一个窗口" 41 | }, 42 | "NextWindow": { 43 | "en": "Next Window", 44 | "zh-Hans": "下一个窗口" 45 | }, 46 | "FirstChildWindow": { 47 | "en": "First Child Window", 48 | "zh-Hans": "首个子窗口" 49 | }, 50 | "FirstEqualWindow": { 51 | "en": "First Equal Window", 52 | "zh-Hans": "首个同级窗口" 53 | }, 54 | "LastEqualWindow": { 55 | "en": "Last Equal Window", 56 | "zh-Hans": "末个同级窗口" 57 | } 58 | } -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAIO.h: -------------------------------------------------------------------------------- 1 | // I/O a file or device 2 | 3 | #pragma once 4 | 5 | #include "NTADef.h" 6 | 7 | /// 8 | /// Writes data to specified file or device 9 | /// 10 | /// Handle to the file 11 | /// Offset to write 12 | /// Data to write 13 | /// Size of data in bytes 14 | /// TRUE if succeeded, or NULL if failed, error code storaged in last STATUS 15 | NTA_API BOOL NTAPI IO_Write(HANDLE FileHandle, ULONGLONG ByteOffset, _In_reads_bytes_(Length) PVOID Buffer, ULONG Length); 16 | 17 | /// 18 | /// Writes string to specified file or device 19 | /// 20 | /// 21 | NTA_API BOOL NTAPI IO_WriteStringW(HANDLE FileHandle, _In_z_ PCWSTR String); 22 | NTA_API BOOL NTAPI IO_WriteStringA(HANDLE FileHandle, _In_z_ PCSTR String); 23 | #ifdef UNICODE 24 | #define IO_WriteString IO_WriteStringW 25 | #else 26 | #define IO_WriteString IO_WriteStringA 27 | #endif 28 | 29 | /// 30 | /// Writes string to specified file or device and starts a new line 31 | /// 32 | /// 33 | NTA_API BOOL NTAPI IO_WriteLineW(HANDLE FileHandle, _In_z_ PCWSTR String); 34 | NTA_API BOOL NTAPI IO_WriteLineA(HANDLE FileHandle, _In_z_ PCSTR String); 35 | #ifdef UNICODE 36 | #define IO_WriteLine IO_WriteLineW 37 | #else 38 | #define IO_WriteLine IO_WriteLineA 39 | #endif 40 | -------------------------------------------------------------------------------- /Source/AlleyWind.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32210.238 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AlleyWind", "AlleyWind\AlleyWind.vcxproj", "{975A445D-9333-401B-868E-6283C7B464D0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {975A445D-9333-401B-868E-6283C7B464D0}.Debug|x64.ActiveCfg = Debug|x64 17 | {975A445D-9333-401B-868E-6283C7B464D0}.Debug|x64.Build.0 = Debug|x64 18 | {975A445D-9333-401B-868E-6283C7B464D0}.Debug|x86.ActiveCfg = Debug|Win32 19 | {975A445D-9333-401B-868E-6283C7B464D0}.Debug|x86.Build.0 = Debug|Win32 20 | {975A445D-9333-401B-868E-6283C7B464D0}.Release|x64.ActiveCfg = Release|x64 21 | {975A445D-9333-401B-868E-6283C7B464D0}.Release|x64.Build.0 = Release|x64 22 | {975A445D-9333-401B-868E-6283C7B464D0}.Release|x86.ActiveCfg = Release|Win32 23 | {975A445D-9333-401B-868E-6283C7B464D0}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {ED37D4BE-8792-4E53-AF03-D44F610E98E7} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Source/AlleyWind/Operation.I18N.json: -------------------------------------------------------------------------------- 1 | { 2 | "QuickStyle": { 3 | "en": "Quick Style", 4 | "zh-Hans": "快速样式" 5 | }, 6 | "Visible": { 7 | "en": "Visible", 8 | "zh-Hans": "可见" 9 | }, 10 | "Enable": { 11 | "en": "Enable", 12 | "zh-Hans": "启用" 13 | }, 14 | "Topmost": { 15 | "en": "Topmost", 16 | "zh-Hans": "置顶" 17 | }, 18 | "Layered": { 19 | "en": "Layered", 20 | "zh-Hans": "分层" 21 | }, 22 | "Opacity": { 23 | "en": "Opacity", 24 | "zh-Hans": "不透明度" 25 | }, 26 | "ColorKey": { 27 | "en": "Color Key", 28 | "zh-Hans": "过滤色" 29 | }, 30 | "VisualStyle": { 31 | "en": "Visual Style", 32 | "zh-Hans": "视觉样式" 33 | }, 34 | "Display": { 35 | "en": "Display", 36 | "zh-Hans": "显示" 37 | }, 38 | "AntiCapture": { 39 | "en": "Anti Capture", 40 | "zh-Hans": "防捕获" 41 | }, 42 | "SwitchTo": { 43 | "en": "Switch To", 44 | "zh-Hans": "切换到" 45 | }, 46 | "Redraw": { 47 | "en": "Redraw", 48 | "zh-Hans": "重绘" 49 | }, 50 | "Highlight": { 51 | "en": "Highlight", 52 | "zh-Hans": "突出显示" 53 | }, 54 | "Fill": { 55 | "en": "Fill", 56 | "zh-Hans": "填涂" 57 | }, 58 | "Close": { 59 | "en": "Close", 60 | "zh-Hans": "关闭" 61 | }, 62 | "EndTask": { 63 | "en": "End Task", 64 | "zh-Hans": "结束任务" 65 | } 66 | } -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAConst.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Memory alignment 4 | #define PAGE_SIZE 0x1000 5 | #define CODE_ALIGNMENT 0x10 6 | #define STRING_ALIGNMENT 0x4 7 | 8 | #define ASCII_CASE_MASK 0b100000 9 | #define MAX_WORD_IN_DEC_CCH 6 // Max WORD in decimal is 65535 10 | #define MAX_QWORD_IN_HEX_CCH 17 11 | #define MAX_CLASSNAME_CCH 256 12 | #define MAX_CIDENTIFIERNAME_CCH 247 13 | #define MAX_ATOM_CCH 255 14 | #define MAX_REG_KEYNAME_CCH 255 15 | #define MAX_REG_VALUENAME_CCH 16383 16 | #define HEXRGB_CCH 8 // #RRGGBB 17 | #define MAX_POINTER_CCH (sizeof(PVOID) * 2 + 1) 18 | #define CURRENT_PROCESS_HANDLE ((HANDLE)-1) 19 | #define CURRENT_THREAD_HANDLE ((HANDLE)-2) 20 | #define CURRENT_PROCESS_TOKEN_HANDLE ((HANDLE)-4) 21 | #define CURRENT_THREAD_TOKEN_HANDLE ((HANDLE)-5) 22 | #define CURRENT_THREAD_EFFECTIVETOKEN_HANDLE ((HANDLE)-6) 23 | #define FIXED_IMAGE_BASE32 ((HINSTANCE)0x00400000) 24 | #define FIXED_IMAGE_BASE64 ((HINSTANCE)0x0000000140000000) 25 | 26 | #define EOLW ((DWORD)0x000A000D) 27 | #define EOLA ((WORD)0x0A0D) 28 | #ifdef UNICODE 29 | #define EOL EOLW 30 | #else 31 | #define EOL EOLA 32 | #endif 33 | -------------------------------------------------------------------------------- /Source/AlleyWind/DB_Message.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "AlleyWind.h" 4 | 5 | typedef enum _AW_MSGPARAMTYPE { 6 | MsgParamTypeUnknow, 7 | // wParam and lParam types 8 | MsgParamTypeNotUsed, 9 | MsgParamTypeNum, 10 | MsgParamTypeBoolean, 11 | MsgParamTypeString, 12 | MsgParamTypeHandle, 13 | MsgParamTypeRaw, 14 | // Custom types 15 | MsgParamTypeEnumeration, 16 | MsgParamTypeCombination, 17 | MsgParamTypeUseCallback, 18 | MsgParamTypeOthers 19 | } AW_MSGPARAMTYPE, * PAW_MSGPARAMTYPE; 20 | 21 | typedef struct _AW_MSGPARAMENUMITEM { 22 | union { 23 | UINT_PTR I18NIndex; 24 | PCTSTR Text; 25 | }; 26 | LONG_PTR Value; 27 | } AW_MSGPARAMENUMITEM, * PAW_MSGPARAMENUMITEM; 28 | 29 | typedef struct _AW_MSGPARAMENUM { 30 | PCTL_COMBOBOXCTL_ITEM Items; 31 | UINT Count; 32 | } AW_MSGPARAMENUM, * PAW_MSGPARAMENUM; 33 | 34 | typedef struct _AW_MSGPARAM_INFO { 35 | AW_MSGPARAMTYPE Type; 36 | union { 37 | UINT_PTR CueI18NIndex; 38 | PWSTR CueText; 39 | }; 40 | union { 41 | PAW_MSGPARAMENUM EnumValue; 42 | PVOID Callback; 43 | }; // Reserved 44 | } AW_MSGPARAM_INFO, * PAW_MSGPARAM_INFO; 45 | 46 | typedef struct _AW_SYSMSGINFO { 47 | UINT Msg; 48 | PTSTR Name; 49 | AW_MSGPARAM_INFO WParamInfo; 50 | AW_MSGPARAM_INFO LParamInfo; 51 | AW_MSGPARAM_INFO RetValInfo; 52 | PCTSTR MSDNDocLink; 53 | } AW_SYSMSGINFO, * PAW_SYSMSGINFO; 54 | 55 | EXTERN_C AW_SYSMSGINFO DB_stMsgInfo[246]; -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTASys.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | #include "NTANT.h" 5 | 6 | typedef enum _SYS_DLL_NAME { 7 | SysDllNameNTDll = 0, 8 | SysDllNameKernel32, 9 | SysDllNameUser32, 10 | SysDllNameComDlg32, 11 | SysDllNameOle32, 12 | SysDllNameUxTheme, 13 | SysDllNameDwmapi, 14 | SysDllNameShcore, 15 | SysDllNameWs2_32, 16 | SysDllNameWinmm, 17 | SysDllNameMax 18 | } SYS_DLL_NAME, * PSYS_DLL_NAME; 19 | 20 | /// 21 | /// Loads specified system DLL with cache 22 | /// 23 | /// 24 | /// System DLL 25 | /// Handle to the DLL loaded, or NULL if failed 26 | NTA_API HMODULE NTAPI Sys_LoadDll(SYS_DLL_NAME SysDll); 27 | 28 | /// 29 | /// Loads API from specified system DLL 30 | /// 31 | /// 32 | /// System DLL 33 | /// API name 34 | /// Address of API, or NULL if failed 35 | NTA_API PVOID NTAPI Sys_LoadAPI(SYS_DLL_NAME SysDll, _In_z_ PCSTR APIName); 36 | 37 | /// 38 | /// Gets Unicode message text in specified module by message ID 39 | /// 40 | /// 41 | /// Handle to the module 42 | /// 43 | /// Pointer to the message string, or NULL if failed 44 | NTA_API PCWSTR NTAPI Sys_GetMessage(HMODULE ModuleHandle, DWORD MessageId); 45 | 46 | /// 47 | NTA_API BOOL NTAPI Sys_EqualGUID(REFGUID GUID1, REFGUID GUID2); 48 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAMem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | #include "NTAProc.h" 5 | 6 | /// 7 | /// Allocates heap memory 8 | /// 9 | /// 10 | /// Both of last error and last status will set if failed 11 | #define Mem_HeapAllocEx(Flags, Size) RtlAllocateHeap(Proc_GetHeap(), Flags, Size) 12 | #define Mem_HeapAlloc(Size) RtlAllocateHeap(Proc_GetHeap(), 0, Size) 13 | 14 | /// 15 | /// Frees heap memory 16 | /// 17 | /// 18 | #define Mem_HeapFree(BaseAddress) RtlFreeHeap(Proc_GetHeap(), 0, BaseAddress) 19 | 20 | /// 21 | /// Allocates memory pages 22 | /// 23 | /// 24 | /// Error code storaged in last STATUS 25 | NTA_API _Check_return_ _Ret_maybenull_ _Post_writable_byte_size_(Size) PVOID NTAPI Mem_PageAlloc(_In_ SIZE_T Size, _In_ ULONG Protect); 26 | 27 | /// 28 | /// Changes the protection of memory pages 29 | /// 30 | /// 31 | /// Error code storaged in last STATUS 32 | NTA_API BOOL NTAPI Mem_PageProt(_In_ PVOID BaseAddress, _In_ SIZE_T Size, ULONG Protect, _Out_ PULONG OldProtect); 33 | 34 | /// 35 | /// Frees memory pages 36 | /// 37 | /// 38 | /// Error code storaged in last STATUS 39 | NTA_API BOOL NTAPI Mem_PageFree(__drv_freesMem(Mem) _Frees_ptr_ _In_ PVOID BaseAddress); 40 | 41 | // Alias of "Mem_HeapAlloc" 42 | #define Mem_Alloc Mem_HeapAlloc 43 | 44 | // Alias of "Mem_HeapFree" 45 | #define Mem_Free Mem_HeapFree 46 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAOptions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NTA_DLL 4 | // 0-lib 1-dll 5 | #if !defined(NTA_DLL) 6 | #define NTA_DLL 0 7 | #endif 8 | 9 | // VS Project macros 10 | 11 | #if defined(_M_IX86) 12 | #define VS_PLATFORMTARGET "x86" 13 | #elif defined(_M_X64) 14 | #define VS_PLATFORMTARGET "x64" 15 | #endif 16 | 17 | #if defined(_DEBUG) 18 | #define VS_CONFIGURATION "Debug" 19 | #else 20 | #define VS_CONFIGURATION "Release" 21 | #endif 22 | 23 | #define LIB_PATH_WITH_CONFIG(LibName) VS_PLATFORMTARGET"\\"VS_CONFIGURATION"\\"LibName 24 | 25 | #if NTA_DLL 26 | #ifdef NTA_EXPORTS 27 | #define NTA_API DECLSPEC_EXPORT 28 | #pragma comment(lib, LIB_PATH_WITH_CONFIG("SlimCRT.lib")) 29 | #else 30 | #define NTA_API DECLSPEC_IMPORT 31 | 32 | #endif 33 | #else 34 | #define NTA_API 35 | #endif 36 | 37 | // NTA_CUSTOMENTRY / NTA_NOENTRY 38 | #ifdef NTA_CUSTOMENTRY 39 | #pragma comment(linker, "/ENTRY:" NTA_CUSTOMENTRY) 40 | #endif 41 | 42 | #if defined(NTA_CUSTOMENTRY) || defined(NTA_NOENTRY) 43 | #if _DEBUG 44 | #if _DLL 45 | #pragma comment(lib, "msvcrtd.lib") 46 | #pragma comment(lib, "vcruntimed.lib") 47 | #pragma comment(lib, "ucrtd.lib") 48 | #ifdef __cplusplus 49 | #pragma comment(lib, "msvcprtd.lib") 50 | #endif 51 | #else 52 | #pragma comment(lib, "libcmtd.lib") 53 | #pragma comment(lib, "libvcruntimed.lib") 54 | #pragma comment(lib, "libucrtd.lib") 55 | #ifdef __cplusplus 56 | #pragma comment(lib, "libcpmtd.lib") 57 | #endif 58 | #endif 59 | #else 60 | #if _DLL 61 | #pragma comment(lib, "msvcrt.lib") 62 | #pragma comment(lib, "vcruntime.lib") 63 | #pragma comment(lib, "ucrt.lib") 64 | #ifdef __cplusplus 65 | #pragma comment(lib, "msvcprt.lib") 66 | #endif 67 | #else 68 | #pragma comment(lib, "libcmt.lib") 69 | #pragma comment(lib, "libvcruntime.lib") 70 | #pragma comment(lib, "libucrt.lib") 71 | #ifdef __cplusplus 72 | #pragma comment(lib, "libcpmt.lib") 73 | #endif 74 | #endif 75 | #endif 76 | #endif 77 | -------------------------------------------------------------------------------- /Source/AlleyWind/WndProp.c: -------------------------------------------------------------------------------- 1 | #include "AlleyWind.h" 2 | 3 | CTL_PROPSHEETPAGE astWndPropSheetPage[] = { 4 | { I18NIndex_General, NULL, IDD_WNDPROP_GENERAL, WndPropGeneralDlgProc }, 5 | { I18NIndex_Resource, NULL, IDD_WNDPROP_RESOURCE, WndPropResourceDlgProc }, 6 | { I18NIndex_Relationship, NULL, IDD_WNDPROP_RELATIONSHIP, WndPropRelationshipDlgProc }, 7 | { I18NIndex_Class, NULL, IDD_WNDPROP_CLASS, WndPropClassDlgProc }, 8 | { I18NIndex_Operation, NULL, IDD_WNDPROP_OPERATION, WndPropOperationDlgProc }, 9 | //{ I18NIndex_Message, NULL, IDD_WNDPROP_MESSAGE, WndPropMessageDlgProc } 10 | }; 11 | 12 | INT_PTR WINAPI WndPropDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) 13 | { 14 | if (uMsg == WM_INITDIALOG) { 15 | TCHAR szCaption[MAX_PATH]; 16 | INT iCch; 17 | iCch = Str_Printf(szCaption, TEXT("%ws %08X"), I18N_GetString(I18NIndex_Window), (DWORD)(DWORD_PTR)lParam); 18 | SendMessage(hDlg, WM_SETTEXT, 0, iCch > 0 ? (LPARAM)szCaption : 0); 19 | SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)KNS_GetIcon()); 20 | Ctl_SetPropertySheet(hDlg, IDC_WNDPROPTAB, astWndPropSheetPage, lParam); 21 | KNS_SetDialogSubclass(hDlg, NULL); 22 | } else if (uMsg == WM_DPICHANGED) { 23 | HWND hTab; 24 | UINT i; 25 | RECT rc; 26 | hTab = GetDlgItem(hDlg, IDC_WNDPROPTAB); 27 | UI_GetRelativeRect(hTab, hDlg, &rc); 28 | SendMessage(hTab, TCM_ADJUSTRECT, FALSE, (LPARAM)&rc); 29 | for (i = 0; i < ARRAYSIZE(astWndPropSheetPage); i++) { 30 | SendMessage(astWndPropSheetPage[i].Handle, WM_DPICHANGED, wParam, (LPARAM)&rc); 31 | } 32 | } else if (uMsg == WM_CLOSE) { 33 | EndDialog(hDlg, 0); 34 | SetWindowLongPtr(hDlg, DWLP_MSGRESULT, 0); 35 | } else 36 | return FALSE; 37 | return TRUE; 38 | } 39 | 40 | DWORD WINAPI OpenWndPropDlgThread(PVOID lParam) 41 | { 42 | return (DWORD)DialogBoxParam(NT_GetImageBase(), MAKEINTRESOURCE(IDD_WNDPROP), NULL, WndPropDlgProc, (LPARAM)lParam); 43 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # V2 is working in progress! ~10% 2 | In [Dev_V2 branch](https://github.com/KNSoft/AlleyWind/tree/Dev_V2), with overall improvement: 3 | - UIAccess support 4 | - Improved DPI scaling 5 | - More features 6 | - Support "Always On Top" 7 | - ... 8 | - ... 9 | 10 | # AlleyWind 11 | AlleyWind is an advanced Win32-based and open-source utility manages windows running on system. Likes ``Spy++`` but provides more features, especially modify properties of window. 12 | 13 | AlleyWind could: 14 | + Displays a graphical tree of relationships among windows, and search what you want 15 | + Shows the properties of selected window(s), and some of them could be modified: 16 | + Text, Font, Position, Size, Style, Extended Style and Class Style 17 | + Visibility, Availability, and Topmost property 18 | + Hot Key, Visual Style, Display Affinity and Layered properties 19 | + Shows private properties (e.g., address of window or dialog callback procedure) by using code injection technology 20 | + Supports multiple languages, multiple monitors and High-DPI 21 | 22 | ## Snapshots 23 | ![avatar](Asset/Screenshots/1-Main.png) 24 | Main Window: display tree view for current system windows with icons 25 |
26 |
27 | ![avatar](Asset/Screenshots/2-FindWindow.png) 28 | Window Finder (Tool - Find Window): search window by name or class, or use window capture tool select window by mouse 29 |
30 |
31 | ![avatar](Asset/Screenshots/3-GeneralProp.png) 32 | Window properties - General Tab: window basic properties 33 |
34 |
35 | ![avatar](Asset/Screenshots/4-ResourceProp.png) 36 | Window properties - Resource Tab: window resource 37 |
38 |
39 | ![avatar](Asset/Screenshots/5-RelationshipProp.png) 40 | Window properties - Relationship Tab: window relationship to process, thread and other windows 41 |
42 |
43 | ![avatar](Asset/Screenshots/6-ClassProp.png) 44 | Window properties - Class Tab: window class 45 |
46 |
47 | ![avatar](Asset/Screenshots/7-OperationProp.png) 48 | Window properties - Operation Tab: operations for window -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAMacro.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define DECLSPEC_EXPORT __declspec(dllexport) 4 | 5 | #if _WIN64 6 | #define IS_WIN64 TRUE 7 | #else 8 | #define IS_WIN64 FALSE 9 | #endif 10 | 11 | // Uses an alter value instead if the value is NULL 12 | #define IF_NULL(val, alt_val) ((val) ? (val) : (alt_val)) 13 | // Uses an alter value instead if the value is not NULL 14 | #define IF_NOTNULL(val, alt_val) ((val) ? (alt_val) : (val)) 15 | 16 | // Applies different expression depends on 32-bit or 64-bit architecture 17 | #define IF_ARCH32OR64(expr64, expr32) (_WIN64 ? (expr64) : (expr32)) 18 | 19 | // Makes a DWORD value by LOWORD and HIWORD 20 | #define MAKEDWORD(l, h) ((DWORD)MAKELONG(l, h)) 21 | #define MAKEQWORD(l, h) ((QWORD)(((DWORD)(((DWORD_PTR)(l)) & 0xffffffff)) | ((QWORD)((DWORD)(((DWORD_PTR)(h)) & 0xffffffff))) << 32)) 22 | 23 | // Clear high 32-bit of HWND 24 | #if _WIN64 25 | #define PURGE_HWND(hWnd) ((HWND)((DWORD_PTR)(hWnd) & 0xFFFFFFFF)) 26 | #else 27 | #define PURGE_HWND(hWnd) (hWnd) 28 | #endif 29 | 30 | // Reserves low 32-bit only 31 | #define PURGE_PTR32(p) ((PVOID)((ULONG_PTR)(p) & 0xFFFFFFFF)) 32 | 33 | // Gets equality of two value after masked 34 | #define IS_EQUAL_MASKED(val1, val2, mask) (!(((val1) ^ (val2)) & (mask))) 35 | // Sets or removes a flag from a combination value 36 | #define COMBINE_FLAGS(val, uflag, bEnable) ((bEnable) ? ((val) | (uflag)) : ((val) & ~(uflag))) 37 | 38 | #define BYTE_ALIGN(val, ali) (((val) + (ali) - 1) & (~((ali) - 1))) 39 | #define IS_BYTE_ALIGNED(val, ali) (!((val) & ((ali) - 1))) 40 | 41 | // Gets is the value is within the valid range of an atom 42 | #define IS_ATOM(val) (((ULONG_PTR)(val) & 0xFFFF) > 0 && ((ULONG_PTR)(val) & 0xFFFF) < MAXINTATOM) 43 | 44 | // Moves pointer 45 | #define MOVE_PTR(address, offset, type) ((type *)((PBYTE)(address) + (LONG_PTR)(offset))) 46 | 47 | // Defines structure with variable length field 48 | #define DEFINE_ANYSIZE_STRUCT(var, structure, type, size) struct {\ 49 | structure Base;\ 50 | type Extra[(size) - 1];\ 51 | } var 52 | -------------------------------------------------------------------------------- /Source/AlleyWind/AlleyWind.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define NTA_CUSTOMENTRY "Main" 4 | #include "NTAssassin\NTAssassin.h" 5 | #include "Precomp4C.Output.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include "DB_StyleEditor.h" 12 | #include "DB_Message.h" 13 | #include "AWSettings.h" 14 | #include "AWWndIO.h" 15 | #include "AWWndProp.h" 16 | #include "resource.h" 17 | 18 | #pragma comment(lib, LIB_PATH_WITH_CONFIG("NTAssassin.lib")) 19 | 20 | #pragma comment(lib, "UxTheme.lib") 21 | 22 | #define KNS_NAME TEXT("AlleyWind") 23 | 24 | #define MAX_WNDCAPTION_CCH 128 25 | 26 | INT_PTR WINAPI MainDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 27 | INT_PTR WINAPI FindWndDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); 28 | 29 | LRESULT CALLBACK CaptureWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 30 | LRESULT CALLBACK PickColorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 31 | 32 | INT_PTR WINAPI WndPropGeneralDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 33 | INT_PTR WINAPI WndPropResourceDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 34 | INT_PTR WINAPI WndPropRelationshipDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 35 | INT_PTR WINAPI WndPropClassDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 36 | INT_PTR WINAPI WndPropOperationDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 37 | INT_PTR WINAPI WndPropMessageDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 38 | 39 | HWND AW_GetMainDlg(); 40 | 41 | VOID AWDatabaseInit(); 42 | 43 | VOID FindWndInit(); 44 | VOID FindWndUninit(); 45 | 46 | VOID WndPropRelationshipInit(); 47 | VOID WndPropRelationshipUninit(); 48 | VOID WndPropResourceInit(); 49 | VOID WndPropResourceUninit(); 50 | VOID WndPropOperationInit(); 51 | VOID WndPropOperationUninit(); 52 | 53 | INT_PTR WINAPI WndPropDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 54 | DWORD WINAPI OpenWndPropDlgThread(PVOID lParam); 55 | 56 | BOOL AW_LoadWindowTreeAsync(BOOL bUpdateFilter, LPTSTR lpszCaption, LPTSTR lpszClassName); 57 | BOOL AW_LocateWindowInTree(HWND hWnd); 58 | VOID AW_OpenWndPropDlg(HWND hWnd); 59 | VOID AW_OpenFindWndDlg(HWND hDlg); -------------------------------------------------------------------------------- /Source/AlleyWind/AWWndIO.c: -------------------------------------------------------------------------------- 1 | #include "AlleyWind.h" 2 | 3 | LRESULT AW_SendMsgTO(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, PDWORD_PTR lpdwResult) { 4 | return SendMessageTimeout( 5 | hWnd, 6 | uMsg, 7 | wParam, 8 | lParam, 9 | SMTO_ABORTIFHUNG | SMTO_ERRORONEXIT, 10 | AWSettings_GetItemValueEx(AWSetting_ResponseTimeout), 11 | lpdwResult); 12 | } 13 | 14 | UINT AW_GetWindowTextEx(HWND hWnd, PWSTR psz, UINT cCh) { 15 | DWORD_PTR dwCch; 16 | UINT c; 17 | c = AW_SendMsgTO(hWnd, WM_GETTEXT, cCh, (LPARAM)psz, &dwCch) && (UINT)dwCch < cCh ? (UINT)dwCch : 0; 18 | psz[c] = '\0'; 19 | return c; 20 | } 21 | 22 | DWORD WINAPI HighlightWindowThread(LPVOID lParam) { 23 | HWND hWnd = lParam; 24 | DWORD_PTR dwpStyle; 25 | HDC hDC; 26 | RECT rcClient; 27 | UINT uTimes = 4 * 2; 28 | BOOL bFlash; 29 | bFlash = UI_GetWindowLong(hWnd, FALSE, GWL_STYLE, &dwpStyle) && (dwpStyle & WS_DLGFRAME || dwpStyle & WS_THICKFRAME); 30 | if (bFlash) { 31 | FLASHWINFO fwi = { sizeof(FLASHWINFO), hWnd, FLASHW_ALL, 4, 200 }; 32 | FlashWindowEx(&fwi); 33 | return ERROR_SUCCESS; 34 | } 35 | hDC = GetDC(hWnd); 36 | if (!hDC) 37 | return ERROR_INVALID_HANDLE; 38 | if (!GetClientRect(hWnd, &rcClient)) 39 | return EH_GetLastError(); 40 | do { 41 | GDI_FrameRect(hDC, &rcClient, -3, PATINVERT); 42 | Proc_DelayExec(100); 43 | } while (--uTimes); 44 | return ERROR_SUCCESS; 45 | } 46 | 47 | VOID AW_HighlightWindow(HWND hWnd) { 48 | Proc_CreateThread(HighlightWindowThread, hWnd, FALSE, NULL); 49 | } 50 | 51 | PCSTR pszGWLFunc[] = { 52 | "GetWindowLongPtrA", // 000 53 | "GetWindowLongPtrW", // 001 54 | "GetWindowLongA", // 010 55 | "GetWindowLongW", // 011 56 | "GetClassLongPtrA", // 100 57 | "GetClassLongPtrW", // 101 58 | "GetClassLongA", // 110 59 | "GetClassLongW", // 111 60 | }; 61 | 62 | PCSTR AW_GetWindowLongFunc(BOOL ClassLong, BOOL b32Proc, BOOL bUnicode) { 63 | UINT u = 0; 64 | if (ClassLong) { 65 | u |= 1; 66 | } 67 | u <<= 1; 68 | if (b32Proc) { 69 | u |= 1; 70 | } 71 | u <<= 1; 72 | if (bUnicode) { 73 | u |= 1; 74 | } 75 | return pszGWLFunc[u]; 76 | } -------------------------------------------------------------------------------- /Source/AlleyWind/Message.I18N.json: -------------------------------------------------------------------------------- 1 | { 2 | "SendMethod": { 3 | "en": "Send Method", 4 | "zh-Hans": "发送方式" 5 | }, 6 | "MsgComboxCue": { 7 | "en": "Message code or name", 8 | "zh-Hans": "消息码或名称" 9 | }, 10 | "Timeout": { 11 | "en": "Timeout (ms)", 12 | "zh-Hans": "超时(毫秒)" 13 | }, 14 | "AsyncTimeout": { 15 | "en": "0 (Asynchronous)", 16 | "zh-Hans": "0(异步)" 17 | }, 18 | "SendMethod_LMS": { 19 | "en": "Local Message Sending", 20 | "zh-Hans": "本地发送消息" 21 | }, 22 | "SendMethod_RMS": { 23 | "en": "Remote Message Sending (Code Injection)", 24 | "zh-Hans": "远程发送消息(代码注入)" 25 | }, 26 | "SendMethod_RWPC": { 27 | "en": "Remote Window Procedure Call (Code Injection)", 28 | "zh-Hans": "远程窗口过程调用(代码注入)" 29 | }, 30 | "SendMethod_RWPE": { 31 | "en": "Remote Window Procedure Execution (Code Injection)", 32 | "zh-Hans": "远程窗口过程执行(代码注入)" 33 | }, 34 | "AttachThreadInput": { 35 | "en": "Attach thread input", 36 | "zh-Hans": "附加线程输入" 37 | }, 38 | "ParamTypeNotUsed": { 39 | "en": "Not Used", 40 | "zh-Hans": "未使用" 41 | }, 42 | "ParamValueNotUsed": { 43 | "en": "Not Used (0/NULL)", 44 | "zh-Hans": "未使用(0/NULL)" 45 | }, 46 | "ParamTypeNum": { 47 | "en": "Numerical", 48 | "zh-Hans": "数值" 49 | }, 50 | "ParamTypeBoolean": { 51 | "en": "Boolean", 52 | "zh-Hans": "布尔值" 53 | }, 54 | "ParamTypeString": { 55 | "en": "String", 56 | "zh-Hans": "字符串" 57 | }, 58 | "ParamTypeRaw": { 59 | "en": "Raw Buffer", 60 | "zh-Hans": "原始缓冲区" 61 | }, 62 | "Send": { 63 | "en": "Send", 64 | "zh-Hans": "发送" 65 | }, 66 | "Result": { 67 | "en": "Result", 68 | "zh-Hans": "结果" 69 | }, 70 | "Msg_uMsgErr": { 71 | "en": "Unrecognized message specified\\r\\nSelect an item or enter name or numerical code of a message", 72 | "zh-Hans": "无法识别指定的消息\\r\\n选择一项或输入消息名或数值码。" 73 | }, 74 | "Msg_ParamTypeErr": { 75 | "en": "Select a type of message parameter", 76 | "zh-Hans": "为消息参数选择一个类型" 77 | }, 78 | "Msg_ParamValueErr": { 79 | "en": "Invalid value of message parameter", 80 | "zh-Hans": "参数值非法" 81 | }, 82 | "Msg_TimeoutErr": { 83 | "en": "Invalid value of timeout", 84 | "zh-Hans": "超时值非法" 85 | } 86 | } -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTADPI.h: -------------------------------------------------------------------------------- 1 | // High-DPI support 2 | 3 | #pragma once 4 | 5 | #include "NTADef.h" 6 | 7 | /// 8 | /// Gets DPI of window 9 | /// 10 | /// Handle to the window 11 | /// Pointer to an UINT variable to receive DPI-X 12 | /// Pointer to an UINT variable to receive DPI-Y 13 | /// TRUE if DPI values returned by GetDpiForMonitor, or FALSE if returned by GetDeviceCaps 14 | NTA_API BOOL NTAPI DPI_FromWindow(HWND Window, _Out_ PUINT DPIX, _Out_ PUINT DPIY); 15 | 16 | /// 17 | /// Scales a value according to given DPI 18 | /// 19 | /// Pointer to the value to be scaled 20 | /// Old DPI value 21 | /// New DPI value 22 | NTA_API VOID NTAPI DPI_ScaleInt(_Inout_ PINT Value, _In_ UINT OldDPI, _In_ UINT NewDPI); 23 | NTA_API VOID NTAPI DPI_ScaleUInt(_Inout_ PUINT Value, _In_ UINT OldDPI, _In_ UINT NewDPI); 24 | 25 | /// 26 | /// Scales a RECT according to given DPI 27 | /// 28 | /// Pointer to the RECT structure to be scaled 29 | /// Old DPI-X value 30 | /// New DPI-X value 31 | /// Old DPI-Y value 32 | /// New DPI-Y value 33 | VOID NTAPI DPI_ScaleRect(_Inout_ PRECT Rect, _In_ UINT OldDPIX, _In_ UINT NewDPIX, _In_ UINT OldDPIY, _In_ UINT NewDPIY); 34 | 35 | /// 36 | /// Subclasses a dialog box to support High-DPI 37 | /// 38 | /// Handle to the dialog box 39 | /// Pointer to an ENUMLOGFONTEXDVW structure specifies font to use, NULL to use default UI font 40 | /// TRUE if subclass successfully, or FALSE if failed 41 | NTA_API BOOL NTAPI DPI_SetAutoAdjustSubclass(_In_ HWND Dialog, _In_opt_ PENUMLOGFONTEXDVW FontInfo); 42 | 43 | /// 44 | /// Gets information about a dialog box subclassed by DPI_SetAutoAdjustSubclass 45 | /// 46 | /// Handle to the dialog box 47 | /// Current DPI-X 48 | /// Current DPI-Y 49 | /// Current font 50 | /// TRUE if subclass successfully, or FALSE if failed 51 | NTA_API _Success_(return != FALSE) BOOL NTAPI DPI_GetAutoAdjustSubclass(_In_ HWND Dialog, _Out_opt_ PDWORD NewDPIX, _Out_opt_ PDWORD NewDPIY, _Out_opt_ HFONT * Font); 52 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTANT_UCRT.h: -------------------------------------------------------------------------------- 1 | // UCRT functions exported in ntdll.dll 2 | 3 | #pragma once 4 | 5 | #include "NTADef.h" 6 | 7 | NTA_API _Check_return_ size_t __cdecl NT_wcslen(_In_z_ wchar_t const* _String); 8 | NTA_API _Check_return_ size_t __cdecl NT_strlen(_In_z_ char const* _Str); 9 | 10 | NTA_API _Check_return_ _Ret_maybenull_ 11 | _When_(return != NULL, _Ret_range_(_Str, _Str + _String_length_(_Str) - 1)) 12 | wchar_t _CONST_RETURN* __cdecl NT_wcsstr( 13 | _In_z_ wchar_t const* _Str, 14 | _In_z_ wchar_t const* _SubStr); 15 | NTA_API _Check_return_ _Ret_maybenull_ 16 | _When_(return != NULL, _Ret_range_(_Str, _Str + _String_length_(_Str) - 1)) 17 | char _CONST_RETURN* __cdecl NT_strstr( 18 | _In_z_ char const* _Str, 19 | _In_z_ char const* _SubStr); 20 | 21 | NTA_API _Check_return_ int __cdecl NT_wcscmp(_In_z_ wchar_t const* _String1, _In_z_ wchar_t const* _String2); 22 | NTA_API _Check_return_ int __cdecl NT_strcmp(_In_z_ char const* _Str1, _In_z_ char const* _Str2); 23 | 24 | NTA_API _Success_(return >= 0) _Check_return_ int __CRTDECL NT_vswprintf_s( 25 | _Out_writes_(_BufferCount) _Always_(_Post_z_) wchar_t* const _Buffer, 26 | _In_ size_t const _BufferCount, 27 | _In_z_ _Printf_format_string_ wchar_t const* const _Format, 28 | va_list _ArgList 29 | ); 30 | NTA_API _Success_(return >= 0) _Check_return_ int __CRTDECL NT_vsprintf_s( 31 | _Out_writes_(_BufferCount) _Always_(_Post_z_) char* const _Buffer, 32 | _In_ size_t const _BufferCount, 33 | _In_z_ _Printf_format_string_ char const* const _Format, 34 | va_list _ArgList 35 | ); 36 | 37 | NTA_API _Post_equal_to_(_Dst) 38 | _At_buffer_( 39 | (unsigned char*)_Dst, 40 | _Iter_, 41 | _Size, 42 | _Post_satisfies_(((unsigned char*)_Dst)[_Iter_] == _Val) 43 | ) void* __cdecl NT_memset( 44 | _Out_writes_bytes_all_(_Size) void* _Dst, 45 | _In_ int _Val, 46 | _In_ size_t _Size 47 | ); 48 | 49 | NTA_API _Success_(return == 0) 50 | _Check_return_opt_ 51 | errno_t __CRTDECL NT_memcpy_s( 52 | _Out_writes_bytes_to_opt_(_DestinationSize, _SourceSize) void* const _Destination, 53 | _In_ rsize_t const _DestinationSize, 54 | _In_reads_bytes_opt_(_SourceSize) void const* const _Source, 55 | _In_ rsize_t const _SourceSize 56 | ); 57 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTACon.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | #include "NTANT.h" 5 | 6 | /// 7 | #define Con_GetStdHandle(i) (\ 8 | i == STD_INPUT_HANDLE ? ((NT_GetPEB()->ProcessParameters->StandardInput) : (\ 9 | i == STD_OUTPUT_HANDLE ? (NT_GetPEB()->ProcessParameters->StandardOutput) : (\ 10 | i == STD_ERROR_HANDLE ? (NT_GetPEB()->ProcessParameters->StandardError) : NULL\ 11 | )\ 12 | )\ 13 | ) 14 | 15 | /// 16 | /// Writes data to console 17 | /// 18 | /// Handle to the console 19 | /// Pointer to the buffer contains data to write 20 | /// Length of data 21 | /// Number of bytes actually written, or 0 if failed, error code storaged in last STATUS 22 | NTA_API DWORD NTAPI Con_Write(HANDLE ConHandle, _In_reads_bytes_opt_(Length) PVOID Buffer, _In_ ULONG Length); 23 | 24 | /// 25 | /// Output string to console 26 | /// 27 | /// Handle to the console 28 | /// String to output 29 | /// Number of bytes actually written, or 0 if failed, error code storaged in last STATUS 30 | NTA_API DWORD NTAPI Con_WriteString(HANDLE ConHandle, _In_z_ PCSTR String); 31 | 32 | /// 33 | /// Output string to console and starts a new line 34 | /// 35 | /// 36 | NTA_API DWORD NTAPI Con_WriteLine(HANDLE ConHandle, _In_z_ PCSTR String); 37 | 38 | /// 39 | /// Prints formatted output to the console 40 | /// Con_Printf 41 | /// 42 | /// 43 | NTA_API DWORD NTAPI Con_VPrintf(HANDLE ConHandle, _In_z_ _Printf_format_string_ PCSTR Format, _In_ va_list ArgList); 44 | 45 | /// 46 | /// Prints formatted output to the console 47 | /// 48 | /// Handle to the console 49 | /// Format control 50 | /// Optional arguments 51 | /// Number of bytes actually printed 52 | /// If output bytes exceeds 1024, string will be truncated 53 | NTA_API DWORD WINAPIV Con_Printf(HANDLE ConHandle, _In_z_ _Printf_format_string_ PCSTR Format, ...); 54 | 55 | /// 56 | /// Prints formatted output to the console and starts a new line 57 | /// 58 | /// 59 | NTA_API DWORD WINAPIV Con_PrintfLine(HANDLE ConHandle, _In_z_ _Printf_format_string_ PCSTR Format, ...); 60 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAI18N.h: -------------------------------------------------------------------------------- 1 | // I18N support, there are some complex problems 2 | // So we WILL REWRITE this module 3 | 4 | #pragma once 5 | 6 | #include "NTADef.h" 7 | 8 | typedef struct _I18N_ITEM { 9 | DWORD KeyHash; 10 | LPCWSTR Value; 11 | } I18N_ITEM, * PI18N_ITEM; 12 | 13 | typedef struct _I18N_LANGUAGE I18N_LANGUAGE, * PI18N_LANGUAGE; 14 | 15 | struct _I18N_LANGUAGE { 16 | QWORD Name[3]; // Each parts of name 17 | LCID dwLangId; // LCID 18 | PI18N_LANGUAGE Parent; // Pointer to parent 19 | LPWSTR NativeName; // Native name 20 | LPWSTR FontName; // Font name prefered 21 | BOOL RTLReading; // Set to TRUE if the language has RTL reading order 22 | PI18N_ITEM StringTable; // Pointer to the string table 23 | }; 24 | 25 | typedef struct _I18N_CTLTEXT { 26 | INT CtlID; 27 | UINT_PTR StrIndex; 28 | } I18N_CTLTEXT, * PI18N_CTLTEXT; 29 | 30 | NTA_API PI18N_LANGUAGE NTAPI I18N_InitEx(PI18N_LANGUAGE *Langs, UINT LangCount, USHORT ItemCount, PCWSTR LangName); 31 | #define I18N_Init(LangName) I18N_InitEx(NAC_I18N_Lang_Table, ARRAYSIZE(NAC_I18N_Lang_Table), NAC_I18N_ITEM_COUNT, LangName) 32 | 33 | VOID NTAPI I18N_SetLocale(PI18N_LANGUAGE Lang); 34 | 35 | PI18N_LANGUAGE I18N_FindLangEx(PI18N_LANGUAGE *lpLangs, UINT uCount, PCWSTR lpszName); 36 | #define I18N_FindLang(lpszName) I18N_FindLangExW(NAC_I18N_Lang_Table, ARRAYSIZE(NAC_I18N_Lang_Table), lpszName) 37 | 38 | /** 39 | * @brief Gets string by specified index or hash in string table 40 | * @param[in] Index Index or hash value of the string in string table 41 | * @return Returns pointer to the string 42 | */ 43 | NTA_API PCWSTR NTAPI I18N_GetString(UINT_PTR StrIndex); 44 | 45 | /** 46 | * @brief Sets window text by specified I18N string index 47 | */ 48 | #define I18N_SetWndText(Window, StrIndex) SendMessageW(Window, WM_SETTEXT, 0, (LPARAM)I18N_GetString(StrIndex)) 49 | 50 | /** 51 | * @brief Sets a dialogue item text by specified I18N string index 52 | */ 53 | #define I18N_SetDlgItemText(Dialog, ItemId, StrIndex) I18N_SetWndText(GetDlgItem(Dialog, ItemId), StrIndex) 54 | 55 | /** 56 | * @brief Initializes window text by specified I18N string index 57 | */ 58 | NTA_API HWND NTAPI I18N_InitCtlText(HWND Dialog, INT CtlID, UINT_PTR StrIndex); 59 | 60 | /** 61 | * @brief Sets windows text by specified I18N string indexes 62 | */ 63 | NTA_API VOID NTAPI I18N_InitCtlTextsEx(HWND Dialog, PI18N_CTLTEXT CtlTexts, UINT CtlTextCount); 64 | #define I18N_InitCtlTexts(Dialog, CtlTexts) I18N_InitCtlTextsEx(Dialog, CtlTexts, ARRAYSIZE(CtlTexts)) 65 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAKNS.h: -------------------------------------------------------------------------------- 1 | // KNSoft internal application framework, NOT RECOMMANDED 2 | 3 | #pragma once 4 | 5 | #include "NTADef.h" 6 | 7 | #include "NTAI18N.h" 8 | #include "NTADlg.h" 9 | 10 | #define KNS_VERSION_ALPHA 1 11 | #define KNS_VERSION_BETA 2 12 | #define KNS_VERSION_RC 3 13 | #define KNS_VERSION_GA 4 14 | #define KNS_VERSION_RELEASE 5 15 | 16 | #define KNS_DIALOG_DEFAULT_FONTSIZE 18 17 | 18 | #define KNS_BANNER_MARGIN 8 19 | #define KNS_BANNER_FONTBIG_SCALE 1 / 2 20 | #define KNS_BANNER_FONTSMALL_SCALE 2 / 5 21 | #define KNS_BANNER_ICON_SCALE 3 / 5 22 | 23 | #define ICON_SIDE 48 24 | 25 | typedef struct _KNS_VERSION_INFO { 26 | USHORT Major; 27 | USHORT Minor; 28 | USHORT Revision; 29 | USHORT Build; 30 | USHORT Type; // KNS_VERSION_* 31 | } KNS_VERSION_INFO, * PKNS_VERSION_INFO; 32 | 33 | typedef struct _KNS_INFO { 34 | PWSTR Name; // Name of software 35 | BOOL KNSOfficial; // Is official software of KNSoft 36 | KNS_VERSION_INFO Version; 37 | struct { 38 | COLORREF MainColor; // Main color to draw splash, banner, etc. 39 | UINT IconResID; // Main icon resource to draw splash, banner, etc. 40 | UINT DlgResID; // Main dialog resource template 41 | UINT DlgAccResID; // Main dialog accelerator 42 | DLGPROC DlgProc; // Main dialog callback function 43 | UINT BannerCtlID; // ID of static control for banner on main dialog 44 | UINT SplashResID; // ID of splash image resource 45 | UINT SplashDuration; // Splash timeout, or no splash if it's null 46 | BOOL SplashAsync; // Display splash asynchronously or not 47 | } UI; 48 | struct { 49 | PI18N_LANGUAGE *Langs; 50 | UINT LangCount; 51 | USHORT ItemCount; 52 | } I18N; 53 | struct { 54 | PWSTR HomePage; // URL to Homepage 55 | PWSTR HelpDoc; // URL or path to help content 56 | PWSTR KNSUpdateSrv; // URL to KNSoft Update Service 57 | PWSTR KNSBugRptSrv; // URL to KNSoft Bug Report Service 58 | } OnlineService; 59 | } KNS_INFO, * PKNS_INFO; 60 | 61 | NTA_API UINT_PTR NTAPI KNS_Startup(PKNS_INFO KNSInfo); 62 | 63 | NTA_API INT NTAPI KNS_MsgBox(HWND Owner, PCWSTR Text, PCWSTR Title, UINT Type); 64 | 65 | NTA_API VOID NTAPI KNS_ErrorMsgBox(HWND Owner, DWORD Error); 66 | 67 | NTA_API VOID NTAPI KNS_StatusMsgBox(HWND Owner, NTSTATUS Status); 68 | 69 | NTA_API VOID NTAPI KNS_LastErrorMsgBox(HWND Owner); 70 | 71 | NTA_API VOID NTAPI KNS_LastStatusMsgBox(HWND Owner); 72 | 73 | NTA_API BOOL NTAPI KNS_GetVersionStringEx(PWSTR StrVersion, UINT ChCount); 74 | #define KNS_GetVersionString(StrVersion) KNS_GetVersionStringEx(StrVersion, ARRAYSIZE(StrVersion)) 75 | 76 | NTA_API HICON NTAPI KNS_GetIcon(); 77 | 78 | NTA_API VOID NTAPI KNS_SetDialogSubclass(HWND Dialog, DLG_RESIZEDPROC ResizedProc); 79 | 80 | NTA_API VOID NTAPI KNS_DlgAbout(HWND hwndOwner); 81 | 82 | NTA_API VOID NTAPI KNS_OpenHomePage(); 83 | -------------------------------------------------------------------------------- /Source/.editorconfig: -------------------------------------------------------------------------------- 1 | # Visual Studio generated .editorconfig file with C++ settings. 2 | root = true 3 | 4 | [*.{c,c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}] 5 | 6 | charset = utf-8-bom 7 | end_of_line = crlf 8 | insert_final_newline = true 9 | 10 | # Visual C++ Code Style settings 11 | 12 | cpp_generate_documentation_comments = xml 13 | 14 | # Visual C++ Formatting settings 15 | 16 | cpp_indent_braces = false 17 | cpp_indent_multi_line_relative_to = innermost_parenthesis 18 | cpp_indent_within_parentheses = align_to_parenthesis 19 | cpp_indent_preserve_within_parentheses = true 20 | cpp_indent_case_contents = true 21 | cpp_indent_case_labels = true 22 | cpp_indent_case_contents_when_block = false 23 | cpp_indent_lambda_braces_when_parameter = true 24 | cpp_indent_goto_labels = one_left 25 | cpp_indent_preprocessor = none 26 | cpp_indent_access_specifiers = false 27 | cpp_indent_namespace_contents = true 28 | cpp_indent_preserve_comments = true 29 | cpp_new_line_before_open_brace_namespace = same_line 30 | cpp_new_line_before_open_brace_type = same_line 31 | cpp_new_line_before_open_brace_function = new_line 32 | cpp_new_line_before_open_brace_block = same_line 33 | cpp_new_line_before_open_brace_lambda = same_line 34 | cpp_new_line_scope_braces_on_separate_lines = true 35 | cpp_new_line_close_brace_same_line_empty_type = true 36 | cpp_new_line_close_brace_same_line_empty_function = true 37 | cpp_new_line_before_catch = false 38 | cpp_new_line_before_else = false 39 | cpp_new_line_before_while_in_do_while = false 40 | cpp_space_before_function_open_parenthesis = remove 41 | cpp_space_within_parameter_list_parentheses = false 42 | cpp_space_between_empty_parameter_list_parentheses = false 43 | cpp_space_after_keywords_in_control_flow_statements = true 44 | cpp_space_within_control_flow_statement_parentheses = false 45 | cpp_space_before_lambda_open_parenthesis = false 46 | cpp_space_within_cast_parentheses = false 47 | cpp_space_after_cast_close_parenthesis = false 48 | cpp_space_within_expression_parentheses = false 49 | cpp_space_before_block_open_brace = true 50 | cpp_space_between_empty_braces = false 51 | cpp_space_before_initializer_list_open_brace = false 52 | cpp_space_within_initializer_list_braces = true 53 | cpp_space_preserve_in_initializer_list = true 54 | cpp_space_before_open_square_bracket = false 55 | cpp_space_within_square_brackets = false 56 | cpp_space_before_empty_square_brackets = false 57 | cpp_space_between_empty_square_brackets = false 58 | cpp_space_group_square_brackets = true 59 | cpp_space_within_lambda_brackets = false 60 | cpp_space_between_empty_lambda_brackets = false 61 | cpp_space_before_comma = false 62 | cpp_space_after_comma = true 63 | cpp_space_remove_around_member_operators = true 64 | cpp_space_before_inheritance_colon = true 65 | cpp_space_before_constructor_colon = true 66 | cpp_space_remove_before_semicolon = true 67 | cpp_space_after_semicolon = true 68 | cpp_space_remove_around_unary_operator = true 69 | cpp_space_around_binary_operator = insert 70 | cpp_space_around_assignment_operator = insert 71 | cpp_space_pointer_reference_alignment = ignore 72 | cpp_space_around_ternary_operator = insert 73 | cpp_wrap_preserve_blocks = never 74 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAFile.h: -------------------------------------------------------------------------------- 1 | // File management 2 | 3 | #pragma once 4 | 5 | #include "NTADef.h" 6 | 7 | typedef struct _FILE_MAP { 8 | HANDLE FileHandle; 9 | HANDLE SectionHandle; 10 | PVOID Map; 11 | SIZE_T MapSize; 12 | SIZE_T FileSize; 13 | } FILE_MAP, *PFILE_MAP; 14 | 15 | /// 16 | /// Creates or open a file 17 | /// 18 | /// 19 | /// Handle to the file, or NULL if failed, error code storaged in last STATUS 20 | NTA_API HANDLE NTAPI File_Create(_In_z_ PCWSTR FileName, HANDLE RootDirectory, ACCESS_MASK DesiredAccess, ULONG ShareAccess, ULONG CreateDisposition, ULONG CreateOptions); 21 | 22 | /// 23 | /// Gets size of a file 24 | /// 25 | /// 26 | NTA_API _Success_(return != FALSE) BOOL NTAPI File_GetSize(_In_ HANDLE FileHandle, _Out_ PSIZE_T Size); 27 | 28 | /// 29 | /// Reads a file 30 | /// 31 | /// 32 | /// Number of bytes read 33 | NTA_API _Success_(return > 0) ULONG NTAPI File_Read(_In_ HANDLE FileHandle, _Out_writes_bytes_(BytesToRead) PVOID Buffer, _In_ ULONG BytesToRead, PLARGE_INTEGER ByteOffset); 34 | 35 | /// 36 | /// Verifies that a path is a valid directory 37 | /// 38 | /// 39 | /// Path to be verified 40 | /// Pointer to a BOOL to receive the result 41 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last STATUS 42 | NTA_API _Success_(return != FALSE) BOOL NTAPI File_IsDirectory(_In_z_ PCWSTR FilePath, _Out_ PBOOL Result); 43 | 44 | /// 45 | /// Deletes a file 46 | /// 47 | /// Path to the file to delete 48 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last STATUS 49 | NTA_API BOOL NTAPI File_Delete(_In_z_ PCWSTR FilePath); 50 | 51 | /// 52 | /// Marks a file should be deleted when closed 53 | /// 54 | /// Handle to the file 55 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last STATUS 56 | NTA_API BOOL NTAPI File_Dispose(HANDLE FileHandle); 57 | 58 | /// 59 | /// Sets size of specified file 60 | /// 61 | /// Handle to the file 62 | /// New size of the file 63 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last STATUS 64 | NTA_API BOOL NTAPI File_SetSize(HANDLE FileHandle, ULONGLONG NewSize); 65 | 66 | NTA_API _Success_(return != FALSE) BOOL NTAPI File_ReadOnlyMap(_In_z_ PCWSTR FileName, HANDLE RootDirectory, _Out_ PFILE_MAP FileMap); 67 | NTA_API _Success_(return != FALSE) BOOL NTAPI File_WritableMap(_In_z_ PCWSTR FileName, HANDLE RootDirectory, _Out_ PFILE_MAP FileMap, BOOL UseCache, SIZE_T MaximumSize); 68 | 69 | /// 70 | /// Unmaps a file mapped by "File_XXXMap" 71 | /// 72 | /// Pointer to a FILE_MAP structure contains map information 73 | NTA_API VOID NTAPI File_Unmap(_In_ PFILE_MAP FileMap); 74 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAEH.h: -------------------------------------------------------------------------------- 1 | // Error handling 2 | 3 | #pragma once 4 | 5 | #include "NTADef.h" 6 | #include "NTANT.h" 7 | 8 | /// 9 | /// Gets or sets the last error 10 | /// 11 | #define EH_ClearLastError() NT_SetTEBMemberDWORD(LastErrorValue, ERROR_SUCCESS) 12 | #define EH_GetLastError() NT_GetTEBMemberDWORD(LastErrorValue) 13 | #define EH_SetLastError(Error) NT_SetTEBMemberDWORD(LastErrorValue, Error) 14 | #define EH_LastErrorSucceed() (NT_GetTEBMemberDWORD(LastErrorValue) == ERROR_SUCCESS) 15 | 16 | /// 17 | /// Gets or sets the last status 18 | /// 19 | #define EH_ClearLastStatus() NT_SetTEBMemberDWORD(LastStatusValue, STATUS_SUCCESS) 20 | #define EH_GetLastStatus() ((NTSTATUS)(NT_GetTEBMemberDWORD(LastStatusValue))) 21 | #define EH_SetLastStatus(Status) NT_SetTEBMemberDWORD(LastStatusValue, Status) 22 | #define EH_LastStatusSucceed() (NT_SUCCESS(NT_GetTEBMemberDWORD(LastStatusValue))) 23 | 24 | /// 25 | /// Sets last win32 error according to given NT Status 26 | /// 27 | /// NT Status 28 | /// Win32 Error code corresponding to the given NT Status 29 | NTA_API DWORD NTAPI EH_SetLastNTError(NTSTATUS Status); 30 | 31 | /// 32 | /// Gets Unicode message text of given Win32 error or HRESULT 33 | /// 34 | /// Error code 35 | /// Pointer to the message string, or NULL if failed 36 | NTA_API PCWSTR NTAPI EH_GetErrorInfo(DWORD Error); 37 | 38 | /// 39 | /// Gets Unicode message text of given NT Status 40 | /// 41 | /// NT Status 42 | /// Pointer to the message string, or NULL if failed 43 | NTA_API PCWSTR NTAPI EH_GetStatusInfo(NTSTATUS Status); 44 | 45 | /// 46 | /// Gets Unicode message text of Win32 error corresponding to given NT Status 47 | /// 48 | /// NT Status 49 | /// Pointer to the message. If no Win32 error matched, returns message text of NT Status itself instead 50 | NTA_API PCWSTR NTAPI EH_GetStatusErrorInfo(NTSTATUS Status); 51 | 52 | /// 53 | /// Displays message box shows message text of given Win32 error or HRESULT 54 | /// 55 | /// Handle to the owner window 56 | /// Title string of message box 57 | /// Error code 58 | NTA_API VOID NTAPI EH_ErrorMsgBox(HWND Owner, PCWSTR Title, DWORD Error); 59 | 60 | /// 61 | /// Displays message box shows message text of given NT Status 62 | /// 63 | /// Handle to the owner window 64 | /// Title string of message box 65 | /// NT Status 66 | NTA_API VOID NTAPI EH_StatusMsgBox(HWND Owner, PCWSTR Title, NTSTATUS Status); 67 | 68 | /// 69 | #define EH_GetLastErrorInfo() EH_GetErrorInfo(EH_GetLastError()) 70 | 71 | /// 72 | #define EH_GetLastStatusInfo() EH_GetStatusInfo(EH_GetLastStatus()) 73 | 74 | /// 75 | #define EH_LastErrorMsgBox(Owner, Title) EH_ErrorMsgBox(Owner, Title, EH_GetLastError()) 76 | 77 | /// 78 | #define EH_LastStatusMsgBox(Owner, Title) EH_StatusMsgBox(Owner, Title, EH_GetLastStatus()) 79 | 80 | // Error code converts 81 | NTA_API DWORD NTAPI EH_HrToWin32(HRESULT hr); 82 | #define EH_Win32ToHr HRESULT_FROM_WIN32 83 | #define EH_StatusToWin32 RtlNtStatusToDosErrorNoTeb 84 | #define EH_StatusToHr HRESULT_FROM_NT 85 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAGDIP.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | typedef PVOID PGDIP_IMAGE, PGDIP_GRAPHICS, PGDIP_BRUSH, PGDIP_PATH; 6 | 7 | typedef DWORD ARGB; 8 | 9 | // Makes ARGB value (AARRGGBB) 10 | #define MAKE_ARGB(a, r, g, b) ((ARGB) (b) << 0) | ((ARGB)(g) << 8) | ((ARGB)(r) << 16) | ((ARGB)(a) << 24) 11 | 12 | #pragma region C-style wrappers of Gdiplus.h 13 | 14 | typedef enum _GDIP_TIFFENCODER_PARAMVALUE { 15 | TIFF_ParamValue_CompressionUnused, 16 | TIFF_ParamValue_CompressionLZW = 2, 17 | TIFF_ParamValue_CompressionCCITT3 = 3, 18 | TIFF_ParamValue_CompressionCCITT4 = 4, 19 | TIFF_ParamValue_CompressionRle = 5, 20 | TIFF_ParamValue_CompressionNone = 6, 21 | TIFF_ParamValue_CompressionMax 22 | } GDIP_TIFFENCODER_PARAMVALUE, *PGDIP_TIFFENCODER_PARAMVALUE; 23 | 24 | typedef enum _GDIP_SMOOTHINGMODE { 25 | GDIP_SmoothingModeDefault = 0x00, 26 | GDIP_SmoothingModeHighSpeed = 0x01, 27 | GDIP_SmoothingModeHighQuality = 0x02, 28 | GDIP_SmoothingModeNone = 0x03, 29 | GDIP_SmoothingModeAntiAlias8x4 = 0x04, 30 | GDIP_SmoothingModeAntiAlias8x8 = 0x05 31 | } GDIP_SMOOTHINGMODE, *PGDIP_SMOOTHINGMODE; 32 | 33 | NTA_API BOOL NTAPI GDIP_Startup(PULONG_PTR Token); 34 | NTA_API VOID NTAPI GDIP_Shutdown(ULONG_PTR Token); 35 | 36 | NTA_API PGDIP_GRAPHICS NTAPI GDIP_CreateFromHDC(HDC DC); 37 | NTA_API BOOL NTAPI GDIP_DeleteGraphics(PGDIP_GRAPHICS Graphics); 38 | NTA_API BOOL NTAPI GDIP_SetGraphicsSmoothingMode(PGDIP_GRAPHICS Graphics, GDIP_SMOOTHINGMODE Mode); 39 | NTA_API BOOL NTAPI GDIP_DrawImage(PGDIP_GRAPHICS Graphics, PGDIP_IMAGE Image, INT X, INT Y); 40 | NTA_API BOOL NTAPI GDIP_DrawImageRect(PGDIP_GRAPHICS Graphics, PGDIP_IMAGE Image, INT X, INT Y, INT Width, INT Height); 41 | NTA_API BOOL NTAPI GDIP_GetImageDimension(PGDIP_IMAGE Image, PUINT Width, PUINT Height); 42 | 43 | NTA_API PGDIP_BRUSH NTAPI GDIP_CreateSolidBrush(ARGB Color); 44 | NTA_API BOOL NTAPI GDIP_FillRect(PGDIP_GRAPHICS Graphics, PGDIP_BRUSH Brush, INT X, INT Y, INT Width, INT Height); 45 | NTA_API BOOL NTAPI GDIP_DeleteBrush(PGDIP_BRUSH Brush); 46 | NTA_API PGDIP_PATH NTAPI GDIP_CreatePath(); 47 | 48 | NTA_API PGDIP_IMAGE NTAPI GDIP_LoadImageFromFile(PCWSTR FileName); 49 | NTA_API PGDIP_IMAGE NTAPI GDIP_LoadImageFromBitmap(HBITMAP Bitmap); 50 | NTA_API BOOL NTAPI GDIP_DisposeImage(PGDIP_IMAGE Image); 51 | 52 | #pragma endregion 53 | 54 | /// 55 | /// Loads an image file from buffer 56 | /// 57 | /// Buffer to the image file data 58 | /// Size of buffer 59 | /// Pointer to the image created, or NULL if failed 60 | NTA_API PGDIP_IMAGE NTAPI GDIP_LoadImageFromBuffer(_In_reads_bytes_(Size) PVOID Buffer, _In_ UINT Size); 61 | 62 | /// 63 | /// Saves image to file in different format 64 | /// 65 | /// Pointer to the image 66 | /// Path save to 67 | /// TRUE if succeeded, or FALSE if failed 68 | NTA_API BOOL NTAPI GDIP_SaveImageToFile(PGDIP_IMAGE Image, _In_z_ PCWSTR FileName); 69 | NTA_API BOOL NTAPI GDIP_SaveImageToBMPFile(PGDIP_IMAGE Image, _In_z_ PCWSTR FilePath); 70 | NTA_API BOOL NTAPI GDIP_SaveImageToGIFFile(PGDIP_IMAGE Image, _In_z_ PCWSTR FilePath); 71 | NTA_API BOOL NTAPI GDIP_SaveImageToPNGFile(PGDIP_IMAGE Image, _In_z_ PCWSTR FilePath); 72 | NTA_API BOOL NTAPI GDIP_SaveImageToJPEGFile(PGDIP_IMAGE Image, _In_z_ PCWSTR FilePath, INT Quality); 73 | NTA_API BOOL NTAPI GDIP_SaveImageToTIFFFile(PGDIP_IMAGE Image, _In_z_ PCWSTR FilePath, GDIP_TIFFENCODER_PARAMVALUE Compression, INT ColorDepth); 74 | 75 | EXTERN_C NTA_API PCWSTR GDIP_SaveImageFilter; 76 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAHijack.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | #define HIJACK_PROCESS_ACCESS (PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE | SYNCHRONIZE) 6 | 7 | #pragma pack(push) 8 | #pragma pack(4) 9 | typedef struct _HIJACK_CALLPROCHEADER { 10 | PVOID64 Procedure; 11 | CALLCONV CallConvention; 12 | QWORD RetValue; 13 | DWORD LastError; 14 | NTSTATUS LastStatus; 15 | DWORD ExceptionCode; 16 | UINT ParamCount; // PHIJACK_CALLPROCPARAM 17 | } HIJACK_CALLPROCHEADER, *PHIJACK_CALLPROCHEADER; 18 | 19 | typedef struct _HIJACK_CALLPROCPARAM { 20 | union { 21 | QWORD Value; 22 | PVOID64 Address; 23 | FLOAT FloatNum; 24 | }; 25 | QWORD Size; // 0 = Imm, -1 = Float for x64, >0 = Size of buffer 26 | BOOL Out; 27 | } HIJACK_CALLPROCPARAM, *PHIJACK_CALLPROCPARAM; 28 | #pragma pack(pop) 29 | 30 | /// 31 | /// Injects shellcode and starts new thread to execute in remote process 32 | /// 33 | /// Handle to the process 34 | /// Pointer to the shellcode 35 | /// Size of shellcode in bytes 36 | /// User defined parameter passed to the remote thread 37 | /// Size of Param in bytes 38 | /// Pointer to variable to receive remote thread exit code 39 | /// Timeout in milliseconds 40 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last STATUS 41 | /// 42 | /// HIJACK_PROCESS_ACCESS access is required 43 | /// if Timeout is 0, ExitCode always returns STILL_ACTIVE 44 | /// 45 | _Success_(return != FALSE) NTA_API BOOL NTAPI Hijack_ExecShellcode(_In_ HANDLE ProcessHandle, _In_reads_bytes_(ShellCodeSize) PVOID ShellCode, SIZE_T ShellCodeSize, _In_reads_bytes_opt_(ParamSize) PVOID Param, SIZE_T ParamSize, _Out_opt_ PDWORD ExitCode, DWORD Timeout); 46 | 47 | /// 48 | /// Gets procedure address in remote process space, if specified library not loaded in remote process, will be load 49 | /// 50 | /// Handle to the process 51 | /// Library name 52 | /// Procedure name, can be NULL if loads library only 53 | /// Pointer to a pointer variable to receive remote procedure address, can be NULL only if ProcName also is NULL 54 | /// Timeout in milliseconds 55 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last STATUS 56 | /// HIJACK_PROCESS_ACCESS access is required 57 | _Success_(return != FALSE) NTA_API BOOL NTAPI Hijack_LoadProcAddr(_In_ HANDLE ProcessHandle, _In_z_ PCWSTR LibName, _In_opt_z_ PCSTR ProcName, _Out_opt_ _When_(ProcName != NULL, _Notnull_) PVOID64 * ProcAddr, DWORD Timeout); 58 | 59 | /// 60 | /// Starts a thread and calls a procedure in remote process 61 | /// 62 | /// Handle to the process 63 | /// Pointer to a HIJACK_CALLPROCHEADER structure contains procedure information and receives return values 64 | /// Pointer to a HIJACK_CALLPROCPARAM array, corresponding to each parameters of procedure to call 65 | /// Timeout in milliseconds 66 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last STATUS 67 | /// HIJACK_PROCESS_ACCESS access is required 68 | NTA_API BOOL NTAPI Hijack_CallProc(_In_ HANDLE ProcessHandle, _Inout_ PHIJACK_CALLPROCHEADER CallProcHeader, _In_opt_ PHIJACK_CALLPROCPARAM Params, DWORD Timeout); 69 | -------------------------------------------------------------------------------- /Source/AlleyWind/AWDatabase.I18N.json: -------------------------------------------------------------------------------- 1 | { 2 | "CombinedValueEditor": { 3 | "en": "Combined Value Editor", 4 | "zh-Hans": "组合值编辑器" 5 | }, 6 | "Reset": { 7 | "en": "Reset", 8 | "zh-Hans": "重置" 9 | }, 10 | "Member": { 11 | "en": "Member", 12 | "zh-Hans": "成员" 13 | }, 14 | "Value": { 15 | "en": "Value", 16 | "zh-Hans": "值" 17 | }, 18 | "Description": { 19 | "en": "Description", 20 | "zh-Hans": "描述" 21 | }, 22 | "DVEUnknow": { 23 | "en": "(Unknow)", 24 | "zh-Hans": "(未知)" 25 | }, 26 | "RectEditor": { 27 | "en": "Rectangle Editor", 28 | "zh-Hans": "矩形编辑器" 29 | }, 30 | "Left": { 31 | "en": "Left", 32 | "zh-Hans": "左" 33 | }, 34 | "Top": { 35 | "en": "Top", 36 | "zh-Hans": "上" 37 | }, 38 | "Right": { 39 | "en": "Right", 40 | "zh-Hans": "右" 41 | }, 42 | "Bottom": { 43 | "en": "Bottom", 44 | "zh-Hans": "下" 45 | }, 46 | "Width": { 47 | "en": "Width", 48 | "zh-Hans": "宽" 49 | }, 50 | "Height": { 51 | "en": "Height", 52 | "zh-Hans": "高" 53 | }, 54 | "Desktop": { 55 | "en": "Desktop", 56 | "zh-Hans": "桌面" 57 | }, 58 | "Dialog": { 59 | "en": "Dialog", 60 | "zh-Hans": "对话框" 61 | }, 62 | "Animation": { 63 | "en": "Animation", 64 | "zh-Hans": "动画" 65 | }, 66 | "DateAndTimePicker": { 67 | "en": "Date and Time Picker", 68 | "zh-Hans": "时间日期选取器" 69 | }, 70 | "Calendar": { 71 | "en": "Calendar", 72 | "zh-Hans": "日历" 73 | }, 74 | "ProgressBar": { 75 | "en": "Progress Bar", 76 | "zh-Hans": "进度条" 77 | }, 78 | "StatusBar": { 79 | "en": "Status Bar", 80 | "zh-Hans": "状态栏" 81 | }, 82 | "ToolBar": { 83 | "en": "Tool Bar", 84 | "zh-Hans": "工具栏" 85 | }, 86 | "ToolTips": { 87 | "en": "Tool Tips", 88 | "zh-Hans": "工具提示" 89 | }, 90 | "SliderBar": { 91 | "en": "Slider Bar", 92 | "zh-Hans": "滑动条" 93 | }, 94 | "UpDownControl": { 95 | "en": "Up-down Control", 96 | "zh-Hans": "数值调节钮控件" 97 | }, 98 | "Button": { 99 | "en": "Button", 100 | "zh-Hans": "按钮" 101 | }, 102 | "ComboBox": { 103 | "en": "Combo Box", 104 | "zh-Hans": "组合框" 105 | }, 106 | "ExtendedComboBox": { 107 | "en": "Extended Combo Box", 108 | "zh-Hans": "扩展组合框" 109 | }, 110 | "EditControl": { 111 | "en": "Edit Control", 112 | "zh-Hans": "编辑控件" 113 | }, 114 | "HeaderControl": { 115 | "en": "Header Control", 116 | "zh-Hans": "列头控件" 117 | }, 118 | "ListBox": { 119 | "en": "List Box", 120 | "zh-Hans": "列表框" 121 | }, 122 | "IPAddressControl": { 123 | "en": "IP Address Control", 124 | "zh-Hans": "IP地址控件" 125 | }, 126 | "Hyperlink": { 127 | "en": "Hyperlink", 128 | "zh-Hans": "超链接" 129 | }, 130 | "ListView": { 131 | "en": "List View", 132 | "zh-Hans": "列表视图" 133 | }, 134 | "NativeFont": { 135 | "en": "Native Font", 136 | "zh-Hans": "原生字体" 137 | }, 138 | "PageScroller": { 139 | "en": "Page Scroller", 140 | "zh-Hans": "页面滚动条" 141 | }, 142 | "ScrollBar": { 143 | "en": "Scroll Bar", 144 | "zh-Hans": "滚动条" 145 | }, 146 | "StaticControl": { 147 | "en": "Static Control", 148 | "zh-Hans": "静态控件" 149 | }, 150 | "TabControl": { 151 | "en": "Tab Control", 152 | "zh-Hans": "选项卡控件" 153 | }, 154 | "TreeView": { 155 | "en": "Tree View", 156 | "zh-Hans": "树形视图" 157 | }, 158 | "MDIClient": { 159 | "en": "MDI Client", 160 | "zh-Hans": "MDI客户端" 161 | } 162 | } -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAData_List.h: -------------------------------------------------------------------------------- 1 | // Implement of two-way linked-list data structure. 2 | 3 | #pragma once 4 | 5 | #include "NTADef.h" 6 | 7 | typedef struct _DATA_LIST_NODE DATA_LIST_NODE, *PDATA_LIST_NODE; 8 | 9 | struct _DATA_LIST_NODE { 10 | PDATA_LIST_NODE Flink; // Forward link, point to the next node 11 | PDATA_LIST_NODE Blink; // Backward link, point to the previous node 12 | PVOID Value; // Node value 13 | }; 14 | 15 | typedef struct _DATA_LIST { 16 | PDATA_LIST_NODE First; // Pointer to the first node 17 | PDATA_LIST_NODE Last; // Pointer to the last node 18 | UINT Length; // Number of nodes the list has 19 | RTL_SRWLOCK Lock; // SRW lock to implement thread-safe, do not use it 20 | } DATA_LIST, *PDATA_LIST; 21 | 22 | /// 23 | /// Initializes DATA_LIST structure 24 | /// 25 | NTA_API VOID NTAPI Data_ListInit(_Out_ PDATA_LIST List); 26 | 27 | /// 28 | /// Inserts node to the end of list 29 | /// 30 | /// Pointer to the DATA_LIST structure 31 | /// Node value to the new node to be inserted 32 | /// TRUE if succeeded, or FALSE if failed 33 | NTA_API BOOL NTAPI Data_ListPushBack(_In_ PDATA_LIST List, PVOID NodeValue); 34 | 35 | /// 36 | /// Inserts node to the beginning of list 37 | /// 38 | /// Pointer to the DATA_LIST structure 39 | /// Node value to the new node to be inserted 40 | /// TRUE if succeeded, or FALSE if failed 41 | NTA_API BOOL NTAPI Data_ListPushFront(_In_ PDATA_LIST List, PVOID NodeValue); 42 | 43 | /// 44 | /// Removes node in the end of list 45 | /// 46 | /// Pointer to the DATA_LIST structure 47 | /// Pointer to a buffer to receive node value to be removed 48 | /// TRUE if succeeded, or FALSE if failed 49 | _Success_(return != FALSE) NTA_API BOOL NTAPI Data_ListPopBack(_In_ PDATA_LIST List, _Out_opt_ PVOID * NodeValue); 50 | 51 | /// 52 | /// Removes node in the beginning of list 53 | /// 54 | /// Pointer to the DATA_LIST structure 55 | /// Pointer to a buffer to receive node value to be removed 56 | /// TRUE if succeeded, or FALSE if failed 57 | _Success_(return != FALSE) NTA_API BOOL NTAPI Data_ListPopFront(_In_ PDATA_LIST List, _Out_opt_ PVOID * NodeValue); 58 | 59 | /// 60 | /// Inserts node before specified node 61 | /// 62 | /// Pointer to the DATA_LIST structure 63 | /// Pointer to DATA_LIST_NODE structure of the node relative to 64 | /// Node value to the new node to be inserted 65 | /// TRUE if succeeded, or FALSE if failed 66 | NTA_API BOOL NTAPI Data_ListInsertBefore(_In_ PDATA_LIST List, _In_ PDATA_LIST_NODE RelNode, PVOID NodeValue); 67 | 68 | /// 69 | /// Inserts node after specified node 70 | /// 71 | /// Pointer to the DATA_LIST structure 72 | /// Pointer to DATA_LIST_NODE structure of the node relative to 73 | /// Node value to the new node to be inserted 74 | /// TRUE if succeeded, or FALSE if failed 75 | NTA_API BOOL NTAPI Data_ListInsertAfter(_In_ PDATA_LIST List, _In_ PDATA_LIST_NODE RelNode, PVOID NodeValue); 76 | 77 | /// 78 | /// Removes specified node 79 | /// 80 | /// Pointer to the DATA_LIST structure 81 | /// Pointer to DATA_LIST_NODE structure of the node to be removed 82 | /// TRUE if succeeded, or FALSE if failed 83 | NTA_API BOOL NTAPI Data_ListRemove(_In_ PDATA_LIST List, _In_ PDATA_LIST_NODE Node); 84 | 85 | /// 86 | /// Resets list structure 87 | /// 88 | /// Pointer to the DATA_LIST structure 89 | /// Set to TRUE to frees each memory address in node value by calling Mem_Free 90 | NTA_API VOID NTAPI Data_ListReset(_In_ PDATA_LIST List, BOOL FreeValuePtr); 91 | -------------------------------------------------------------------------------- /Source/AlleyWind/AlleyWind.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {67e5c167-ea56-4f2f-827d-7d2d6eac6d54} 18 | 19 | 20 | {3c9aecc8-9af6-4b7a-a32b-5aa8c76ec3d6} 21 | 22 | 23 | 24 | 25 | Resource Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files\WndProp 49 | 50 | 51 | Source Files\WndProp 52 | 53 | 54 | Source Files\WndProp 55 | 56 | 57 | Source Files\WndProp 58 | 59 | 60 | Source Files\WndProp 61 | 62 | 63 | Source Files\WndProp 64 | 65 | 66 | Source Files\WndProp 67 | 68 | 69 | Source Files\Database 70 | 71 | 72 | Source Files\Database 73 | 74 | 75 | Source Files 76 | 77 | 78 | 79 | 80 | Header Files 81 | 82 | 83 | Header Files 84 | 85 | 86 | Header Files 87 | 88 | 89 | Header Files 90 | 91 | 92 | Header Files 93 | 94 | 95 | Header Files 96 | 97 | 98 | Header Files 99 | 100 | 101 | 102 | 103 | Resource Files 104 | 105 | 106 | 107 | 108 | Resource Files 109 | 110 | 111 | Resource Files 112 | 113 | 114 | -------------------------------------------------------------------------------- /Source/AlleyWind/Precomp4C.Output.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Precomp4C 4 | // KNSoft(knsoft.org) - Precomp4C V1.0.0.0 5 | // https://github.com/KNSoft/Precomp4C 6 | // Do not change this file manually 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | #pragma once 11 | 12 | #include "3rdParty\include\NTAssassin\NTAssassin.h" 13 | 14 | #define Precomp4C_I18N_ITEM_COUNT 154 15 | 16 | typedef enum _I18N_ITEM_INDEX { 17 | I18NIndex_None, 18 | I18NIndex_OK, 19 | I18NIndex_Apply, 20 | I18NIndex_NotApplicable, 21 | I18NIndex_Refresh, 22 | I18NIndex_Cancel, 23 | I18NIndex_CombinedValueEditor, 24 | I18NIndex_Reset, 25 | I18NIndex_Member, 26 | I18NIndex_Value, 27 | I18NIndex_Description, 28 | I18NIndex_DVEUnknow, 29 | I18NIndex_RectEditor, 30 | I18NIndex_Left, 31 | I18NIndex_Top, 32 | I18NIndex_Right, 33 | I18NIndex_Bottom, 34 | I18NIndex_Width, 35 | I18NIndex_Height, 36 | I18NIndex_Desktop, 37 | I18NIndex_Dialog, 38 | I18NIndex_Animation, 39 | I18NIndex_DateAndTimePicker, 40 | I18NIndex_Calendar, 41 | I18NIndex_ProgressBar, 42 | I18NIndex_StatusBar, 43 | I18NIndex_ToolBar, 44 | I18NIndex_ToolTips, 45 | I18NIndex_SliderBar, 46 | I18NIndex_UpDownControl, 47 | I18NIndex_Button, 48 | I18NIndex_ComboBox, 49 | I18NIndex_ExtendedComboBox, 50 | I18NIndex_EditControl, 51 | I18NIndex_HeaderControl, 52 | I18NIndex_ListBox, 53 | I18NIndex_IPAddressControl, 54 | I18NIndex_Hyperlink, 55 | I18NIndex_ListView, 56 | I18NIndex_NativeFont, 57 | I18NIndex_PageScroller, 58 | I18NIndex_ScrollBar, 59 | I18NIndex_StaticControl, 60 | I18NIndex_TabControl, 61 | I18NIndex_TreeView, 62 | I18NIndex_MDIClient, 63 | I18NIndex_Name, 64 | I18NIndex_MenuResource, 65 | I18NIndex_Icon, 66 | I18NIndex_SmallIcon, 67 | I18NIndex_BackgroundBrush, 68 | I18NIndex_WindowBytesSize, 69 | I18NIndex_FindWindow, 70 | I18NIndex_Capture, 71 | I18NIndex_Ignore, 72 | I18NIndex_ChildLevel, 73 | I18NIndex_Transparent, 74 | I18NIndex_Find, 75 | I18NIndex_Caption, 76 | I18NIndex_Handle, 77 | I18NIndex_WindowProcedure, 78 | I18NIndex_ControlID, 79 | I18NIndex_SystemClass, 80 | I18NIndex_Style, 81 | I18NIndex_ExtendedStyle, 82 | I18NIndex_UserData, 83 | I18NIndex_Rectangle, 84 | I18NIndex_RelativePosition, 85 | I18NIndex_ExtraBytes, 86 | I18NIndex_Offset, 87 | I18NIndex_Data, 88 | I18NIndex_File, 89 | I18NIndex_Tool, 90 | I18NIndex_Help, 91 | I18NIndex_MenuReload, 92 | I18NIndex_MenuSaveTree, 93 | I18NIndex_Options, 94 | I18NIndex_MenuExit, 95 | I18NIndex_MenuFindWindow, 96 | I18NIndex_About, 97 | I18NIndex_Homepage, 98 | I18NIndex_ExportTreeFilter, 99 | I18NIndex_ExportTreeFailed, 100 | I18NIndex_SearchResult, 101 | I18NIndex_SendMethod, 102 | I18NIndex_MsgComboxCue, 103 | I18NIndex_Timeout, 104 | I18NIndex_AsyncTimeout, 105 | I18NIndex_SendMethod_LMS, 106 | I18NIndex_SendMethod_RMS, 107 | I18NIndex_SendMethod_RWPC, 108 | I18NIndex_SendMethod_RWPE, 109 | I18NIndex_AttachThreadInput, 110 | I18NIndex_ParamTypeNotUsed, 111 | I18NIndex_ParamValueNotUsed, 112 | I18NIndex_ParamTypeNum, 113 | I18NIndex_ParamTypeBoolean, 114 | I18NIndex_ParamTypeString, 115 | I18NIndex_ParamTypeRaw, 116 | I18NIndex_Send, 117 | I18NIndex_Result, 118 | I18NIndex_Msg_uMsgErr, 119 | I18NIndex_Msg_ParamTypeErr, 120 | I18NIndex_Msg_ParamValueErr, 121 | I18NIndex_Msg_TimeoutErr, 122 | I18NIndex_QuickStyle, 123 | I18NIndex_Visible, 124 | I18NIndex_Enable, 125 | I18NIndex_Topmost, 126 | I18NIndex_Layered, 127 | I18NIndex_Opacity, 128 | I18NIndex_ColorKey, 129 | I18NIndex_VisualStyle, 130 | I18NIndex_Display, 131 | I18NIndex_AntiCapture, 132 | I18NIndex_SwitchTo, 133 | I18NIndex_Redraw, 134 | I18NIndex_Highlight, 135 | I18NIndex_Fill, 136 | I18NIndex_Close, 137 | I18NIndex_EndTask, 138 | I18NIndex_Process, 139 | I18NIndex_Thread, 140 | I18NIndex_Explore, 141 | I18NIndex_Terminate, 142 | I18NIndex_Properties, 143 | I18NIndex_LocateInList, 144 | I18NIndex_RelatedWindow, 145 | I18NIndex_ParentWindow, 146 | I18NIndex_OwnerWindow, 147 | I18NIndex_PreviousWindow, 148 | I18NIndex_NextWindow, 149 | I18NIndex_FirstChildWindow, 150 | I18NIndex_FirstEqualWindow, 151 | I18NIndex_LastEqualWindow, 152 | I18NIndex_ClientAreaImage, 153 | I18NIndex_Copy, 154 | I18NIndex_Save, 155 | I18NIndex_SaveImageFailed, 156 | I18NIndex_InstanceHandle, 157 | I18NIndex_FontHandle, 158 | I18NIndex_MenuHandle, 159 | I18NIndex_Icons, 160 | I18NIndex_HotKey, 161 | I18NIndex_Cursor, 162 | I18NIndex_PropertyList, 163 | I18NIndex_Entry, 164 | I18NIndex_General, 165 | I18NIndex_Resource, 166 | I18NIndex_Relationship, 167 | I18NIndex_Class, 168 | I18NIndex_Operation, 169 | I18NIndex_Message, 170 | I18NIndex_Window 171 | } I18N_ITEM_INDEX, *PI18N_ITEM_INDEX; 172 | 173 | extern I18N_ITEM Precomp4C_I18N_Lang_en_Items[154]; 174 | extern I18N_ITEM Precomp4C_I18N_Lang_zh_Hans_Items[154]; 175 | extern PI18N_LANGUAGE Precomp4C_I18N_Lang_Table[2]; 176 | 177 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAGDI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | typedef struct _GDI_SNAPSHOT { 6 | HDC DC; 7 | HBITMAP Bitmap; 8 | HBITMAP OriginalBitmap; 9 | POINT Position; 10 | SIZE Size; 11 | } GDI_SNAPSHOT, *PGDI_SNAPSHOT; 12 | 13 | /// 14 | /// Fills a rectangle area with single color 15 | /// 16 | /// 17 | /// TRUE if succeeded, or FALSE if failed 18 | NTA_API BOOL NTAPI GDI_FillSolidRect(HDC DC, _In_ PRECT Rect, COLORREF Color); 19 | 20 | /// 21 | /// Draws a rectangle frame with current brush and specified ROP 22 | /// 23 | /// Handle to the DC 24 | /// Pointer to a RECT specifies rectangle area 25 | /// Width of frame, positive number indicates outer frame, negative indicates inner frame 26 | /// ROP, see also PatBlt 27 | /// TRUE if succeeded, or FALSE if failed 28 | NTA_API BOOL NTAPI GDI_FrameRect(HDC DC, PRECT Rect, INT Width, DWORD ROP); 29 | 30 | /// 31 | /// Writes bitmap (DDB) data to buffer 32 | /// Storing an Image - MSDN 33 | /// Bitmap Storage - MSDN 34 | /// 35 | /// Handle to the DC 36 | /// Handle to the bitmap 37 | /// Pointer to the buffer receives bitmap data, NULL if gets required size only 38 | /// Size of buffer, ignored if Buffer is NULL when acquire required size 39 | /// Size of data write in bytes, or size required if Buffer is NULL 40 | /// To writes a DIB, use "GDIP_LoadImageFromBitmap" and "GDIP_SaveImageToBMPFile" instead 41 | NTA_API UINT NTAPI GDI_WriteBitmap(HDC DC, HBITMAP Bitmap, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer, UINT BufferSize); 42 | 43 | /// 44 | /// Initializes ENUMLOGFONTEXDVW structure 45 | /// 46 | /// 47 | NTA_API VOID NTAPI GDI_InitFontInfoEx( 48 | _Out_ PENUMLOGFONTEXDVW FontInfo, 49 | LONG Height, 50 | LONG Width, 51 | LONG Escapement, 52 | LONG Orientation, 53 | LONG Weight, 54 | BOOL Italic, 55 | BOOL Underline, 56 | BOOL StrikeOut, 57 | BYTE CharSet, 58 | BYTE OutPrecision, 59 | BYTE ClipPrecision, 60 | BYTE Quality, 61 | BYTE PitchAndFamily, 62 | _In_opt_z_ PCWSTR Name); 63 | #define GDI_InitFontInfo(FontInfo, Size, Weight, Name) GDI_InitFontInfoEx(FontInfo, Size, 0, 0, 0, Weight, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, DEFAULT_PITCH | FF_DONTCARE, Name) 64 | 65 | /// 66 | /// Gets system default display font information 67 | /// 68 | /// Pointer to the ENUMLOGFONTEXDVW structure receives information 69 | /// New height value overwrites outputs 70 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last ERROR 71 | NTA_API _Success_(return != FALSE) BOOL NTAPI GDI_GetDefaultFont(_Out_ PENUMLOGFONTEXDVW FontInfo, _In_opt_ LONG Height); 72 | 73 | /// 74 | /// Creates default UI font 75 | /// 76 | /// Handle to the font 77 | NTA_API HFONT NTAPI GDI_CreateDefaultFont(); 78 | 79 | /// 80 | /// Retrieves information for the font 81 | /// 82 | /// 83 | /// Handle to the font 84 | /// Pointer to the ENUMLOGFONTEXDVW structure receives information 85 | /// Number of bytes stored or 0 if failed 86 | NTA_API _Success_(return > 0) INT NTAPI GDI_GetFont(_In_ HFONT Font, _Out_ PENUMLOGFONTEXDVW FontInfo); 87 | 88 | /// 89 | /// Draws an icon 90 | /// 91 | /// 92 | NTA_API BOOL NTAPI GDI_DrawIcon(HDC DC, _In_ HICON Icon, INT X, INT Y, INT CX, INT CY); 93 | 94 | /// 95 | /// Creates snapshot for specified window 96 | /// 97 | /// Handle to the window, or NULL to creates snapshot for screen 98 | /// Pointer to a GDI_SNAPSHOT structure receives the snapshot resources and information 99 | /// TRUE if succeeded, or FALSE if failed 100 | /// Snapshot should be deleted by GDI_DeleteSnapshot when no longer to be used 101 | NTA_API BOOL NTAPI GDI_CreateSnapshot(HWND Window, _Out_ PGDI_SNAPSHOT Snapshot); 102 | 103 | /// 104 | /// Deletes snapshot created by GDI_CreateSnapshot 105 | /// 106 | /// Pointer to a GDI_SNAPSHOT structure to delete 107 | /// TRUE if succeeded, or FALSE if failed 108 | NTA_API BOOL NTAPI GDI_DeleteSnapshot(_In_ PGDI_SNAPSHOT Snapshot); 109 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAPE.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | typedef struct _PE_STRUCT { 6 | PBYTE Image; 7 | ULONG ImageSize; 8 | PIMAGE_FILE_HEADER FileHeader; 9 | union { 10 | PIMAGE_OPTIONAL_HEADER OptionalHeader; 11 | PIMAGE_OPTIONAL_HEADER64 OptionalHeader64; 12 | PIMAGE_OPTIONAL_HEADER32 OptionalHeader32; 13 | PIMAGE_ROM_OPTIONAL_HEADER OptionalHeaderRom; 14 | }; 15 | PIMAGE_SECTION_HEADER SectionHeader; 16 | BOOL OfflineMap; 17 | PVOID OverlayData; 18 | ULONG OverlayDataSize; 19 | } PE_STRUCT, *PPE_STRUCT; 20 | 21 | #define PE_ProbeForRead(pe, ptr, size) ((PBYTE)(ptr) >= (pe)->Image && (PBYTE)(ptr) + (size) <= (pe)->Image + (pe)->ImageSize) 22 | #define PE_GetOptionalHeaderValue(pe, m) (PE_GetBits(pe) == 64 ? PE_GetOptionalHeaderValueEx(pe, UFIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, m), RTL_FIELD_SIZE(IMAGE_OPTIONAL_HEADER64, m)) : PE_GetOptionalHeaderValueEx(pe, UFIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, m), RTL_FIELD_SIZE(IMAGE_OPTIONAL_HEADER32, m))) 23 | 24 | /// 25 | /// Resolves a PE image to PE_STRUCT structure 26 | /// 27 | /// Pointer to a PE_STRUCT structure 28 | /// Pointer to the PE image 29 | /// TRUE if PE image is offline (like file map), or FALSE if PE image is loaded in memory as a module 30 | /// TRUE if succeeded, or FALSE if failed 31 | NTA_API VOID NTAPI PE_ResolveOnline(_Out_ PPE_STRUCT PEStruct, _In_ HMODULE Image); 32 | _Success_(return != FALSE) NTA_API BOOL NTAPI PE_ResolveOffline(_Out_ PPE_STRUCT PEStruct, _In_reads_bytes_(BufferSize) PVOID Buffer, _In_ ULONG BufferSize); 33 | 34 | /// 35 | /// Gets bits of PE image 36 | /// 37 | /// 38 | /// Bits of PE image, 32 or 64 39 | NTA_API UINT NTAPI PE_GetBits(_In_ PPE_STRUCT PEStruct); 40 | 41 | NTA_API ULONGLONG NTAPI PE_GetOptionalHeaderValueEx(_In_ PPE_STRUCT PEStruct, ULONG FieldOffset, ULONG FieldSize); 42 | 43 | /// 44 | /// Gets data directory entry of PE image 45 | /// 46 | /// Pointer to the PE_STRUCT structure 47 | /// IMAGE_DIRECTORY_ENTRY_XXX 48 | /// Pointer to the IMAGE_DATA_DIRECTORY structure, or NULL if failed 49 | NTA_API PIMAGE_DATA_DIRECTORY NTAPI PE_GetDataDirectory(_In_ PPE_STRUCT PEStruct, UINT Index); 50 | 51 | /// 52 | /// Gets section by RVA 53 | /// 54 | /// Pointer to the PE_STRUCT structure 55 | /// RVA 56 | /// Pointer to the IMAGE_SECTION_HEADER structure, or NULL if failed 57 | NTA_API PIMAGE_SECTION_HEADER NTAPI PE_GetSectionByRVA(_In_ PPE_STRUCT PEStruct, DWORD RVA); 58 | 59 | /// 60 | /// Gets section by offset 61 | /// 62 | /// Pointer to the PE_STRUCT structure 63 | /// Offset 64 | /// Pointer to the IMAGE_SECTION_HEADER structure, or NULL if failed 65 | NTA_API PIMAGE_SECTION_HEADER NTAPI PE_GetSectionByOffset(_In_ PPE_STRUCT PEStruct, DWORD Offset); 66 | 67 | /// 68 | /// Converts RVA to pointer 69 | /// 70 | /// Pointer to the PE_STRUCT structure 71 | /// RVA 72 | /// The pointer converted 73 | NTA_API PVOID NTAPI PE_RVA2Ptr(_In_ PPE_STRUCT PEStruct, DWORD RVA); 74 | 75 | /// 76 | /// Converts pointer to RVA 77 | /// 78 | /// Pointer to the PE_STRUCT structure 79 | /// Pointer 80 | /// Pointer to a DWORD variable to receive the RVA converted 81 | /// TRUE if succeeded, or FALSE if failed 82 | _Success_(return != FALSE) NTA_API BOOL NTAPI PE_Ptr2RVA(_In_ PPE_STRUCT PEStruct, _In_ PVOID Ptr, _Out_ PDWORD RVA); 83 | 84 | /// 85 | /// Converts pointer to offset 86 | /// 87 | /// Pointer to the PE_STRUCT structure 88 | /// Pointer 89 | /// Pointer to a DWORD variable to receive the offset converted 90 | /// TRUE if succeeded, or FALSE if failed 91 | _Success_(return != FALSE) NTA_API BOOL NTAPI PE_Ptr2Offset(_In_ PPE_STRUCT PEStruct, _In_ PVOID Ptr, _Out_ PDWORD Offset); 92 | 93 | /// 94 | /// Get exported name of specified function 95 | /// 96 | /// Pointer to the PE_STRUCT structure 97 | /// Address of function 98 | /// Pointer to a PCSTR variable to receive the exported name of the function 99 | /// TRUE if succeeded, or FALSE if failed 100 | _Success_(return != FALSE) NTA_API BOOL NTAPI PE_GetExportedName(_In_ PPE_STRUCT PEStruct, _In_ PVOID Function, _Out_ PZPCSTR Name); 101 | 102 | NTA_API PCWSTR PE_GetMachineName(_In_ PPE_STRUCT PEStruct); 103 | NTA_API PCWSTR PE_GetSubsystemName(_In_ PPE_STRUCT PEStruct); 104 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAProc.h: -------------------------------------------------------------------------------- 1 | // provides process functions for current process 2 | 3 | #pragma once 4 | 5 | #include "NTADef.h" 6 | #include "NTANT.h" 7 | #include "NTARProc.h" 8 | 9 | /// 10 | /// Gets the Handle to the default heap 11 | /// 12 | #define Proc_GetHeap() ((HANDLE)NT_GetPEB()->ProcessHeap) 13 | 14 | /// 15 | /// Callback procedure to enumerate DLL modules 16 | /// 17 | /// Pointer to a LDR_DATA_TABLE_ENTRY structure represents each DLL 18 | /// User defined value passed to this callback 19 | /// TRUE if continue enumeration, or FALSE to stop 20 | typedef BOOL(CALLBACK* PROC_DLLENUMPROC)(_In_ PLDR_DATA_TABLE_ENTRY DllLdrEntry, LPARAM Param); 21 | 22 | /// 23 | /// Enumerates DLL modules of current process 24 | /// 25 | /// Callback procedure to receive information of each DLL 26 | /// User defined value passed to the callback 27 | /// NULL if enumeration finished successfully, or a pointer to LDR_DATA_TABLE_ENTRY structure represents the last enumerated DLL and the callback stops enumeration 28 | NTA_API PLDR_DATA_TABLE_ENTRY NTAPI Proc_EnumDlls(_In_ PROC_DLLENUMPROC DllEnumProc, LPARAM Param); 29 | 30 | /// 31 | /// Gets DLL information according to name 32 | /// 33 | /// Module name of DLL 34 | /// Pointer to a LDR_DATA_TABLE_ENTRY structure represents DLL matched, or NULL if no DLL matched 35 | NTA_API PLDR_DATA_TABLE_ENTRY NTAPI Proc_GetDllByName(_In_z_ PCWSTR DllName); 36 | 37 | /// 38 | /// Gets DLL information according to handle 39 | /// 40 | /// Handle to the DLL 41 | /// Pointer to a LDR_DATA_TABLE_ENTRY structure represents DLL matched, or NULL if no DLL matched 42 | NTA_API PLDR_DATA_TABLE_ENTRY NTAPI Proc_GetDllByHandle(_In_ HMODULE DllHandle); 43 | 44 | /// 45 | /// Gets handle to the DLL according to address 46 | /// 47 | /// Any address within the DLL 48 | /// Pointer to a LDR_DATA_TABLE_ENTRY structure represents DLL matched, or NULL if no DLL matched 49 | NTA_API PLDR_DATA_TABLE_ENTRY NTAPI Proc_GetDllByAddr(_In_ PVOID Address); 50 | 51 | /// 52 | /// Gets handle to the DLL according to name 53 | /// 54 | /// Module name of DLL 55 | /// Handle to the DLL that matched, or NULL if no DLL matched 56 | NTA_API HMODULE NTAPI Proc_GetDllHandleByName(_In_z_ PCWSTR DllName); 57 | 58 | /// 59 | /// Gets current process command line 60 | /// 61 | /// 62 | #define Proc_GetCommandLine() (NT_GetPEB()->ProcessParameters->CommandLine.Buffer) 63 | 64 | /// 65 | /// Creates a new thread 66 | /// 67 | /// 68 | #define Proc_CreateThread(StartAddress, Parameter, CreateSuspended, ThreadHandle) RProc_CreateThread(CURRENT_PROCESS_HANDLE, StartAddress, Parameter, CreateSuspended, ThreadHandle) 69 | 70 | /// 71 | /// Loads specified DLL 72 | /// 73 | /// 74 | /// Name of DLL 75 | /// Set to TRUE to don't resolve references 76 | /// Handle to the DLL or NULL if failed 77 | NTA_API HMODULE NTAPI Proc_LoadDll(_In_z_ PCWSTR LibName, BOOL DontResolveRef); 78 | 79 | /// 80 | NTA_API PVOID NTAPI Proc_GetProcAddr(_In_ HMODULE Module, _In_z_ PCSTR ProcName); 81 | 82 | /// 83 | /// Loads procedure address of specified module, module will be loaded if not loaded yet 84 | /// 85 | /// 86 | /// 87 | /// Name of DLL 88 | /// Name of procedure 89 | NTA_API PVOID NTAPI Proc_LoadProcAddr(_In_z_ PCWSTR LibName, _In_z_ PCSTR ProcName); 90 | 91 | /// 92 | /// Adjusts current process privilege 93 | /// 94 | /// 95 | /// 96 | #define Proc_AdjustPrivilege(Privilege, EnableState) RProc_AdjustPrivilege(CURRENT_PROCESS_HANDLE, Privilege, EnableState) 97 | #define Proc_EnablePrivilege(Privilege) Proc_AdjustPrivilege(Privilege, TRUE) 98 | #define Proc_DisablePrivilege(Privilege) Proc_AdjustPrivilege(Privilege, FALSE) 99 | 100 | /// 101 | NTA_API NTSTATUS NTAPI Proc_WaitForObject(HANDLE Object, DWORD Milliseconds); 102 | 103 | /// 104 | NTA_API VOID NTAPI Proc_DelayExec(DWORD Milliseconds); 105 | 106 | /// 107 | _Success_(return != FALSE) NTA_API BOOL NTAPI Proc_GetThreadExitCode(HANDLE ThreadHandle, _Out_ PDWORD ExitCode); 108 | 109 | /// 110 | #define Proc_IsWow64(Wow64Process) RProc_IsWow64(CURRENT_PROCESS_HANDLE, Wow64Process) 111 | 112 | #ifndef _WIN64 113 | #define Proc_DisableWow64FsRedirection(OldValue) RtlWow64EnableFsRedirectionEx(FALSE, OldValue) 114 | #define Proc_RevertWow64FsRedirection(OldValue) RtlWow64EnableFsRedirectionEx(OldValue, &(OldValue)) 115 | #else 116 | #define Proc_DisableWow64FsRedirection(OldValue) 117 | #define Proc_RevertWow64FsRedirection(OldValue) 118 | #endif 119 | -------------------------------------------------------------------------------- /Source/AlleyWind/Class.c: -------------------------------------------------------------------------------- 1 | #include "AlleyWind.h" 2 | 3 | I18N_CTLTEXT astWndPropClassTextCtl[] = { 4 | { IDC_WNDPROP_CLASS_NAME_TEXT, I18NIndex_Name }, 5 | { IDC_WNDPROP_CLASS_HINST_TEXT, I18NIndex_InstanceHandle }, 6 | { IDC_WNDPROP_CLASS_WNDPROC_TEXT, I18NIndex_WindowProcedure }, 7 | { IDC_WNDPROP_CLASS_STYLE_TEXT, I18NIndex_Style }, 8 | { IDC_WNDPROP_CLASS_MENURES_TEXT, I18NIndex_MenuResource }, 9 | { IDC_WNDPROP_CLASS_HICON_TEXT, I18NIndex_Icon }, 10 | { IDC_WNDPROP_CLASS_HICONSM_TEXT, I18NIndex_SmallIcon }, 11 | { IDC_WNDPROP_CLASS_HCURSOR_TEXT, I18NIndex_Cursor }, 12 | { IDC_WNDPROP_CLASS_HBRBKGD_TEXT, I18NIndex_BackgroundBrush }, 13 | { IDC_WNDPROP_CLASS_CLSBYTE_TEXT, I18NIndex_ExtraBytes } 14 | }; 15 | 16 | INT_PTR WINAPI WndPropClassDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) 17 | { 18 | if (uMsg == WM_INITDIALOG) { 19 | HWND hWnd, hCtl; 20 | TCHAR szBuffer[1024]; 21 | CHAR szANSIBuffer[1024]; 22 | INT iTemp; 23 | HANDLE hProc; 24 | DWORD_PTR dwpTemp; 25 | BOOL bSucc; 26 | hWnd = (HWND)lParam; 27 | AW_SetWndPropHWnd(hDlg, hWnd); 28 | // Initialize 29 | KNS_SetDialogSubclass(hDlg, NULL); 30 | I18N_InitCtlTexts(hDlg, astWndPropClassTextCtl); 31 | // Name 32 | iTemp = GetClassName(hWnd, szBuffer, ARRAYSIZE(szBuffer)); 33 | AW_SetPropCtlString(hDlg, IDC_WNDPROP_CLASS_NAME_EDIT, szBuffer, iTemp != 0); 34 | // Atom 35 | bSucc = UI_GetWindowLong(hWnd, TRUE, GCW_ATOM, &dwpTemp); 36 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_CLASS_ATOM_EDIT, bSucc, TEXT("%04X"), LOWORD(dwpTemp)); 37 | // hInst 38 | bSucc = UI_GetWindowLong(hWnd, TRUE, GCLP_HMODULE, &dwpTemp); 39 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_CLASS_HINST_EDIT, bSucc, TEXT("%p"), (HINSTANCE)dwpTemp); 40 | // WndProc 41 | bSucc = UI_GetWindowLong(hWnd, TRUE, GCLP_WNDPROC, &dwpTemp); 42 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_CLASS_WNDPROC_EDIT, bSucc, TEXT("%p"), (WNDPROC)dwpTemp); 43 | // Style 44 | bSucc = UI_GetWindowLong(hWnd, TRUE, GCL_STYLE, &dwpTemp); 45 | UI_EnableDlgItem(hDlg, IDC_WNDPROP_CLASS_STYLE_BTN, bSucc); 46 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_CLASS_STYLE_EDIT, bSucc, TEXT("%08X"), (DWORD)dwpTemp); 47 | // hMenu 48 | bSucc = UI_GetWindowLong(hWnd, TRUE, GCLP_MENUNAME, &dwpTemp); 49 | if (IS_INTRESOURCE(dwpTemp)) 50 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_CLASS_MENURES_EDIT, bSucc, TEXT("%d"), LOWORD(dwpTemp)); 51 | else { 52 | hProc = UI_OpenProc(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, hWnd); 53 | if (hProc) { 54 | szBuffer[0] = '\0'; 55 | UINT uCch; 56 | if (IsWindowUnicode(hWnd)) { 57 | uCch = RProc_ReadMemStringW(hProc, (PVOID)dwpTemp, szBuffer); 58 | } else { 59 | uCch = RProc_ReadMemStringA(hProc, (PVOID)dwpTemp, szANSIBuffer); 60 | if (uCch) 61 | Str_A2U(szBuffer, szANSIBuffer); 62 | } 63 | AW_SetPropCtlString(hDlg, IDC_WNDPROP_CLASS_MENURES_EDIT, szBuffer, uCch); 64 | NtClose(hProc); 65 | } else 66 | UI_EnableDlgItem(hDlg, IDC_WNDPROP_CLASS_MENURES_EDIT, FALSE); 67 | } 68 | // Icon 69 | bSucc = UI_GetWindowLong(hWnd, TRUE, GCLP_HICON, &dwpTemp); 70 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_CLASS_HICON_EDIT, bSucc, TEXT("%p"), (HICON)dwpTemp); 71 | // Small Icon 72 | bSucc = UI_GetWindowLong(hWnd, TRUE, GCLP_HICONSM, &dwpTemp); 73 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_CLASS_HICONSM_EDIT, bSucc, TEXT("%p"), (HICON)dwpTemp); 74 | // Cursor 75 | bSucc = UI_GetWindowLong(hWnd, TRUE, GCLP_HCURSOR, &dwpTemp); 76 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_CLASS_HCURSOR_EDIT, bSucc, TEXT("%p"), (HCURSOR)dwpTemp); 77 | // Background Brush 78 | bSucc = UI_GetWindowLong(hWnd, TRUE, GCLP_HBRBACKGROUND, &dwpTemp); 79 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_CLASS_HBRBKGD_EDIT, bSucc, TEXT("%p"), (HBRUSH)dwpTemp); 80 | // Extra bytes 81 | hCtl = GetDlgItem(hDlg, IDC_WNDPROP_CLASS_CLSBYTE_LIST); 82 | Ctl_InitListCtl(hCtl, aExtraBytesListCol, LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER); 83 | AW_EnumExtraBytes(hWnd, TRUE, (LPARAM)hCtl); 84 | } else if (uMsg == WM_COMMAND) { 85 | if (wParam == MAKEWPARAM(IDC_WNDPROP_CLASS_STYLE_BTN, BN_CLICKED)) { 86 | HWND hWnd = AW_GetWndPropHWnd(hDlg); 87 | BOOL bSucc; 88 | DWORD_PTR dwpStyle; 89 | if (!UI_GetWindowLong(hWnd, TRUE, GCL_STYLE, &dwpStyle)) 90 | return FALSE; 91 | if (AW_DBEditValue(hDlg, hWnd, AWValueClass, (PDWORD)&dwpStyle)) { 92 | EH_ClearLastError(); 93 | SetClassLongPtr(hWnd, GCL_STYLE, dwpStyle); 94 | if (EH_LastErrorSucceed()) { 95 | SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); 96 | UI_Redraw(hWnd); 97 | } 98 | bSucc = UI_GetWindowLong(hWnd, TRUE, GCL_STYLE, &dwpStyle); 99 | UI_EnableDlgItem(hDlg, IDC_WNDPROP_CLASS_STYLE_BTN, bSucc); 100 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_CLASS_STYLE_EDIT, bSucc, TEXT("%08X"), (DWORD)dwpStyle); 101 | } 102 | } 103 | } else 104 | return FALSE; 105 | return TRUE; 106 | } -------------------------------------------------------------------------------- /Source/AlleyWind/AWWndProp.c: -------------------------------------------------------------------------------- 1 | #include "AlleyWind.h" 2 | 3 | VOID AW_OpenWndPropDlg(HWND hWnd) { 4 | Proc_CreateThread(OpenWndPropDlgThread, (PVOID)hWnd, FALSE, NULL); 5 | } 6 | 7 | HWND AW_GetWndPropHWnd(HWND hDlg) { 8 | return GetProp(hDlg, AW_WNDPROP_HWND); 9 | } 10 | 11 | BOOL AW_SetWndPropHWnd(HWND hDlg, HWND hWnd) { 12 | return SetProp(hDlg, AW_WNDPROP_HWND, hWnd); 13 | } 14 | 15 | HWND AW_RemoveWndPropHWnd(HWND hDlg) { 16 | return RemoveProp(hDlg, AW_WNDPROP_HWND); 17 | } 18 | 19 | VOID AW_SetPropCtlFormat(HWND hDlg, UINT uCtlID, BOOL bSuccess, _Printf_format_string_ LPTSTR lpszFormat, ...) { 20 | HWND hCtl; 21 | TCHAR szBuffer[1024]; 22 | INT iCch = 0; 23 | va_list args; 24 | hCtl = GetDlgItem(hDlg, uCtlID); 25 | if (bSuccess) { 26 | va_start(args, lpszFormat); 27 | iCch = Str_VPrintf(szBuffer, lpszFormat, args); 28 | va_end(args); 29 | } 30 | UI_SetWndTextNoNotify(hCtl, iCch > 0 ? szBuffer : NULL); 31 | EnableWindow(hCtl, bSuccess); 32 | } 33 | 34 | VOID AW_SetPropCtlString(HWND hDlg, UINT uCtlID, LPCWSTR lpszString, BOOL bSuccess) { 35 | HWND hCtl = GetDlgItem(hDlg, uCtlID); 36 | UI_SetWndTextNoNotify(hCtl, bSuccess ? lpszString : NULL); 37 | EnableWindow(hCtl, bSuccess); 38 | } 39 | 40 | VOID AW_SetPropCtlRect(HWND hDlg, UINT uCtlID, PRECT lpRect, BOOL bSuccess) { 41 | HWND hCtl; 42 | TCHAR szBuffer[1024]; 43 | INT iCch; 44 | hCtl = GetDlgItem(hDlg, uCtlID); 45 | if (bSuccess) { 46 | iCch = Str_Printf(szBuffer, TEXT("LT(%ld, %ld)-RB(%ld, %ld) [%ldx%ld]"), lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, lpRect->right - lpRect->left, lpRect->bottom - lpRect->top); 47 | UI_SetWndTextNoNotify(hCtl, iCch > 0 ? szBuffer : NULL); 48 | } else 49 | EnableWindow(hCtl, FALSE); 50 | } 51 | 52 | VOID AW_SetPropCtlCheck(HWND hDlg, UINT uCtlID, UINT_PTR uCheck, BOOL bSuccess) { 53 | HWND hCtl = GetDlgItem(hDlg, uCtlID); 54 | SendMessage(hCtl, BM_SETCHECK, bSuccess ? uCheck : BST_UNCHECKED, 0); 55 | EnableWindow(hCtl, bSuccess); 56 | } 57 | 58 | CTL_LISTCTL_COLUME aExtraBytesListCol[] = { 59 | { I18NIndex_Offset, 80 }, 60 | { I18NIndex_Data, 180 } 61 | }; 62 | 63 | BOOL CALLBACK AW_WndPropExtraBytesEnumProc(DWORD dwOffset, LONG_PTR lBytes, UINT uSize, DWORD dwError, LPARAM lParam) { 64 | TCHAR szBuffer[1024]; 65 | LVITEM stLVItem; 66 | INT iCch; 67 | stLVItem.mask = LVIF_TEXT; 68 | iCch = Str_Printf(szBuffer, TEXT("+%u"), dwOffset); 69 | stLVItem.pszText = iCch > 0 ? szBuffer : I18N_GetString(I18NIndex_NotApplicable); 70 | stLVItem.iItem = MAXINT; 71 | stLVItem.iSubItem = 0; 72 | stLVItem.iItem = (INT)SendMessage((HWND)lParam, LVM_INSERTITEM, 0, (LPARAM)&stLVItem); 73 | if (stLVItem.iItem != -1) { 74 | stLVItem.iSubItem++; 75 | iCch = 0; 76 | if (dwError == ERROR_SUCCESS) { 77 | iCch = Str_Printf(szBuffer, TEXT("%p"), (LPVOID)lBytes); 78 | if (iCch > 0) 79 | szBuffer[uSize * 2] = '\0'; 80 | } 81 | stLVItem.pszText = iCch > 0 ? szBuffer : I18N_GetString(I18NIndex_NotApplicable); 82 | SendMessage((HWND)lParam, LVM_SETITEM, 0, (LPARAM)&stLVItem); 83 | } 84 | return TRUE; 85 | } 86 | 87 | BOOL AW_EnumExtraBytes(HWND hWnd, BOOL bClassExtraBytes, LPARAM lParam) { 88 | HANDLE hProc = NULL; 89 | DWORD_PTR dwpExtraSize, dwpNextOffset, dwpOffset; 90 | LONG_PTR lBytes; 91 | UINT_PTR uWordSize; 92 | HIJACK_CALLPROCHEADER stCallProc; 93 | HIJACK_CALLPROCPARAM stGLParams[] = { 94 | { (DWORD_PTR)hWnd, 0, FALSE }, 95 | { 0, 0, FALSE } 96 | }; 97 | BOOL bUseHijack = FALSE, b32Proc; 98 | PCSTR pszGLFunc; 99 | UI_GetWindowLong(hWnd, TRUE, bClassExtraBytes ? GCL_CBCLSEXTRA : GCL_CBWNDEXTRA, &dwpExtraSize); 100 | if (dwpExtraSize) { 101 | DWORD dwPID; 102 | GetWindowThreadProcessId(hWnd, &dwPID); 103 | hProc = RProc_Open(HIJACK_PROCESS_ACCESS, dwPID); 104 | if (hProc) { 105 | if (RProc_IsWow64(hProc, &b32Proc)) { 106 | pszGLFunc = AW_GetWindowLongFunc(bClassExtraBytes, b32Proc, IsWindowUnicode(hWnd)); 107 | if (Hijack_LoadProcAddr(hProc, L"user32.dll", pszGLFunc, (PVOID*)&stCallProc.Procedure, AWSettings_GetItemValueEx(AWSetting_ResponseTimeout))) { 108 | stCallProc.RetValue = 0; 109 | stCallProc.CallConvention = CC_STDCALL; 110 | stCallProc.ParamCount = ARRAYSIZE(stGLParams); 111 | bUseHijack = TRUE; 112 | } 113 | } 114 | if (!bUseHijack) { 115 | NtClose(hProc); 116 | hProc = NULL; 117 | } 118 | } 119 | uWordSize = bUseHijack ? 120 | (b32Proc ? sizeof(DWORD) : sizeof(QWORD)) : 121 | sizeof(LONG_PTR); 122 | dwpOffset = 0; 123 | do { 124 | if (bUseHijack) { 125 | stGLParams[1].Value = (INT)dwpOffset; 126 | if (Hijack_CallProc(hProc, &stCallProc, stGLParams, AWSettings_GetItemValueEx(AWSetting_ResponseTimeout)) && 127 | stCallProc.LastError == ERROR_SUCCESS) { 128 | lBytes = (LONG_PTR)stCallProc.RetValue; 129 | EH_SetLastError(ERROR_SUCCESS); 130 | } else { 131 | lBytes = 0; 132 | EH_SetLastError(ERROR_READ_FAULT); 133 | } 134 | if (b32Proc) 135 | lBytes = (DWORD)lBytes; 136 | } else 137 | UI_GetWindowLong(hWnd, bClassExtraBytes, (INT)dwpOffset, &lBytes); 138 | dwpNextOffset = dwpOffset + uWordSize; 139 | if (!AW_WndPropExtraBytesEnumProc((DWORD)dwpOffset, lBytes, (UINT)(dwpNextOffset > dwpExtraSize ? dwpExtraSize - dwpOffset : uWordSize), lBytes ? ERROR_SUCCESS : EH_GetLastError(), lParam)) 140 | return FALSE; 141 | dwpOffset = dwpNextOffset; 142 | } while (dwpOffset < dwpExtraSize); 143 | if (bUseHijack) { 144 | NtClose(hProc); 145 | hProc = NULL; 146 | } 147 | return TRUE; 148 | } else 149 | return EH_LastErrorSucceed(); 150 | } -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTACtl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | #include "NTACtl_ColorPicker.h" 6 | 7 | typedef struct _CTL_MENU CTL_MENU, *PCTL_MENU; 8 | struct _CTL_MENU { 9 | UINT Flags; 10 | UINT_PTR ID; 11 | union { 12 | UINT_PTR I18NIndex; 13 | LPARAM Param; // MF_OWNERDRAW 14 | HBITMAP Bitmap; // MF_BITMAP 15 | PCWSTR Text; // MF_STRING 16 | }; 17 | PCTL_MENU SubMenu; 18 | UINT SubMenuCount; 19 | HMENU Handle; // Initializes with NULL 20 | }; 21 | 22 | typedef struct _CTL_PROPSHEETPAGE { 23 | union { 24 | UINT_PTR I18NIndex; 25 | PCWSTR Title; 26 | }; 27 | HINSTANCE Instance; 28 | UINT DlgResID; 29 | DLGPROC DlgProc; 30 | HWND Handle; 31 | } CTL_PROPSHEETPAGE, *PCTL_PROPSHEETPAGE; 32 | 33 | typedef struct _CTL_LISTCTL_COLUME { 34 | union { 35 | UINT_PTR I18NIndex; 36 | PCWSTR Title; 37 | }; 38 | INT Width; 39 | } CTL_LISTCTL_COLUME, *PCTL_LISTCTL_COLUME; 40 | 41 | typedef struct _CTL_COMBOBOXCTL_ITEM { 42 | union { 43 | UINT_PTR I18NIndex; 44 | PCWSTR String; 45 | }; 46 | LPARAM Param; 47 | } CTL_COMBOBOXCTL_ITEM, *PCTL_COMBOBOXCTL_ITEM; 48 | 49 | typedef BOOL(CALLBACK* CTL_TREEVIEWITEMENUMPROC)(HWND TreeView, HTREEITEM TreeItem, UINT Level, LPARAM Param); 50 | 51 | /// 52 | /// Creates menu 53 | /// 54 | /// Pointer to an UI_MENU structures array, contains information and receive handle about submenus to be created 55 | /// Number of UI_MENU structures in Menus parameter 56 | /// Handle to parent menu, or NULL if create a top-level menu 57 | /// Handle to the new menu, or NULL if failed, error code storaged in last ERROR 58 | NTA_API HMENU NTAPI Ctl_CreateMenuEx(_Inout_ PCTL_MENU Menus, _In_ UINT Count, _In_opt_ HMENU Parent); 59 | #define Ctl_CreateMenu(Menus, Parent) Ctl_CreateMenuEx(Menus, ARRAYSIZE(Menus), Parent) 60 | 61 | /// 62 | /// Creates a menu and append to specified window 63 | /// 64 | /// 65 | /// 66 | #define Ctl_SetMenuEx(Window, Menus, Count) SetMenu(Window, Ctl_CreateMenuEx(Menus, Count, NULL)) 67 | #define Ctl_SetMenu(Window, Menus) SetMenu(Window, Ctl_CreateMenuEx(Menus, ARRAYSIZE(Menus), NULL)) 68 | 69 | /// 70 | /// Popups the menu 71 | /// 72 | /// 73 | #define Ctl_PopupMenu(hMenu, x, y, hOwner) TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RIGHTBUTTON, x, y, 0, hOwner, NULL) 74 | 75 | /// 76 | /// Destroies the menu created by "Ctl_CreateMenuEx" 77 | /// 78 | /// 79 | NTA_API VOID NTAPI Ctl_DestroyMenuEx(_In_ PCTL_MENU Menus, _In_ UINT Count, HMENU Menu); 80 | #define Ctl_DestroyMenu(Menus, Menu) Ctl_DestroyMenuEx(Menus, ARRAYSIZE(Menus), Menu) 81 | 82 | /// 83 | /// Initializes tab control with property sheet feature powered 84 | /// 85 | /// Handle to the dialog contains the tab control 86 | /// Control ID of tab control 87 | /// Pointer to a CTL_PROPSHEETPAGE structures array, contains information and receive handle about property sheet of tabs 88 | /// Number of CTL_PROPSHEETPAGE structures in Sheets parameter 89 | /// User defined parameter, will be passed to each DlgProc in UI_PROPSHEETPAGE structure via WM_INITDIALOG message 90 | /// TRUE if succeeded, or FALSE if failed, no error code reports due to SetWindowSubclass does 91 | NTA_API BOOL NTAPI Ctl_SetPropertySheetEx(HWND Dialog, INT TabCtlID, _In_ PCTL_PROPSHEETPAGE Sheets, _In_ UINT SheetCount, LPARAM Param); 92 | #define Ctl_SetPropertySheet(Dialog, TabCtlID, Sheets, Param) Ctl_SetPropertySheetEx(Dialog, TabCtlID, Sheets, ARRAYSIZE(Sheets), Param) 93 | 94 | 95 | /// 96 | /// Initializes List-View control with specified columes 97 | /// 98 | /// Handle to the List-View control 99 | /// Cols Pointer to a CTL_LISTCTL_COLUME structures array, contains information about columes 100 | /// Number of CTL_LISTCTL_COLUME structures specified in Cols parameter 101 | /// Extended styles set to the List-View control 102 | /// TRUE if succeeded, or FALSE if failed, no error code reports 103 | NTA_API BOOL NTAPI Ctl_InitListCtlEx(HWND List, _In_ PCTL_LISTCTL_COLUME Cols, _In_ UINT ColCount, LONG_PTR ExStyle); 104 | #define Ctl_InitListCtl(List, Cols, ExStyle) Ctl_InitListCtlEx(List, Cols, ARRAYSIZE(Cols), ExStyle) 105 | 106 | /// 107 | /// Initializes ComboBox control with specified items 108 | /// 109 | /// Handle to the ComboBox control 110 | /// Pointer to a CTL_COMBOBOXCTL_ITEM structures array, contains information about items 111 | /// Number of CTL_COMBOBOXCTL_ITEM structures specified in Items parameter 112 | /// Set to TRUE to makes Param member in CTL_COMBOBOXCTL_ITEM will be applied to the item 113 | /// TRUE if succeeded, or FALSE if failed, no error code reports 114 | NTA_API BOOL NTAPI Ctl_InitComboBoxEx(HWND ComboBox, _In_ PCTL_COMBOBOXCTL_ITEM Items, _In_ UINT ItemCount, BOOL SetParam); 115 | #define Ctl_InitComboBox(ComboBox, Items, SetParam) Ctl_InitComboBoxEx(ComboBox, Items, ARRAYSIZE(Items), SetParam) 116 | 117 | /// 118 | /// Enumerates item in given Tree-View control 119 | /// 120 | /// Handle to the tree-view control 121 | /// Use BFS (Breadth-First-Search) algorithm instead of DFS (Depth-First-Search), BFS is not supported yet, so this parameter must be FALSE 122 | /// Callback procedure to receive information of each item 123 | /// User defined value passed to the callback 124 | /// Returns handle to the last enumerated item if the callback stops the enumeration, or NULL if enumeration finished successfully 125 | NTA_API HTREEITEM NTAPI Ctl_EnumTreeViewItems(HWND TreeView, BOOL BFS, _In_ CTL_TREEVIEWITEMENUMPROC TreeItemEnumProc, LPARAM Param); 126 | 127 | /// 128 | /// Sends CB_SETCURSEL message but will notify parent window by sending "WM_COMMAND" with CBN_SELCHANGE 129 | /// 130 | /// 131 | NTA_API LRESULT NTAPI Ctl_ComboBoxSetSelect(HWND ComboBox, INT ItemIndex); 132 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTADlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | #include "NTAGDI.h" 6 | 7 | #define DLG_PADDING_X 14 8 | #define DLG_PADDING_Y 20 9 | #define DLG_CONTROL_H 28 10 | #define DLG_BUTTON_W 124 11 | 12 | typedef struct _DLG_TEMPLATE { 13 | DLGTEMPLATE Template; 14 | WORD wMenu; 15 | WORD wClass; 16 | WORD wTitle; 17 | } DLG_TEMPLATE, *PDLG_TEMPLATE; 18 | 19 | typedef struct _DLG_SCREENSNAPSHOT { 20 | // Input 21 | WNDPROC pfnWndProc; 22 | HCURSOR hCursor; 23 | HINSTANCE hInstance; 24 | UINT dwClassStyle; 25 | DWORD dwStyle; 26 | DWORD dwExStyle; 27 | PVOID lParam; 28 | // Output 29 | GDI_SNAPSHOT Snapshot; 30 | } DLG_SCREENSNAPSHOT, *PDLG_SCREENSNAPSHOT; 31 | 32 | typedef struct _DLG_TREEVIEWPROPSHEETPAGE DLG_TREEVIEWPROPSHEETPAGE, *PDLG_TREEVIEWPROPSHEETPAGE; 33 | struct _DLG_TREEVIEWPROPSHEETPAGE { 34 | PWSTR DisplayName; 35 | HINSTANCE Instance; 36 | INT DlgResID; 37 | DLGPROC DlgProc; 38 | LPARAM Param; 39 | PDLG_TREEVIEWPROPSHEETPAGE SubItems; 40 | UINT Count; 41 | HANDLE Handle; // Reserved 42 | HTREEITEM TreeItem; // Reserved 43 | }; 44 | 45 | /// 46 | /// Initializes DLGTEMPLATE structure 47 | /// 48 | /// Pointer to a DLG_TEMPLATE structure to be initialized 49 | /// Window styles 50 | /// Window extended styles 51 | /// Window X position 52 | /// Window Y position 53 | /// Window width 54 | /// Window height 55 | /// Pointer to a DLGTEMPLATEW structure in DLG_TEMPLATE 56 | NTA_API LPDLGTEMPLATEW NTAPI Dlg_InitTemplate(_Out_ PDLG_TEMPLATE Template, DWORD Style, DWORD ExtendedStyle, INT X, INT Y, INT Width, INT Height); 57 | 58 | /// 59 | /// Displays a modal dialog box 60 | /// 61 | /// 62 | #define Dlg_MsgBox(Owner, Text, Title, Type) MessageBoxTimeoutW(Owner, Text, Title, Type, 0, -1) 63 | 64 | /// 65 | /// Creates an Open dialog box that lets the user specify the drive, directory, and the name of a file or set of files to be opened 66 | /// 67 | /// 68 | NTA_API BOOL NTAPI Dlg_GetOpenFileNameEx(HWND Owner, PCWSTR Filter, PWSTR File, DWORD CchFile, PCWSTR DefExt); 69 | 70 | /// 71 | /// Creates a Save dialog box that lets the user specify the drive, directory, and name of a file to save 72 | /// 73 | /// 74 | NTA_API BOOL NTAPI Dlg_GetSaveFileNameEx(HWND Owner, PCWSTR Filter, PWSTR File, DWORD MaxFile, PCWSTR DefExt); 75 | 76 | #define Dlg_GetOpenFileName(Owner, Filter, File, DefExt) Dlg_GetOpenFileNameEx(Owner, Filter, File, ARRAYSIZE(File), DefExt) 77 | #define Dlg_GetSaveFileName(Owner, Filter, File, DefExt) Dlg_GetSaveFileNameEx(Owner, Filter, File, ARRAYSIZE(File), DefExt) 78 | 79 | /// 80 | /// Creates a Color dialog box that enables the user to select a color 81 | /// 82 | /// Handle to the owner window 83 | /// Pointer to a COLORREF to set initial color and receive the color value user picked 84 | /// TRUE if a color was picked, or FALSE if user canceled or an error occured 85 | NTA_API BOOL NTAPI Dlg_ChooseColor(HWND Owner, _Inout_ LPCOLORREF Color); 86 | 87 | /// 88 | /// Creates a Font dialog box that enables the user to choose attributes for a logical font 89 | /// 90 | /// Handle to the owner window 91 | /// Pointer to a LOGFONT specifies initial font and receives the result 92 | /// Pointer to a COLORREF specifies initial font color and receives the result, or NULL if ignore effects of font 93 | /// TRUE if a font was chosen, or FALSE if user canceled or an error occured 94 | NTA_API BOOL NTAPI Dlg_ChooseFont(HWND Owner, _Inout_ PLOGFONTW Font, _Inout_opt_ LPCOLORREF Color); 95 | 96 | /// 97 | /// Takes snapshot for current screen and provides a new created window 98 | /// 99 | /// Pointer to a DLG_SCREENSNAPSHOT structure, input window parameters and receive screen size and snapshot DC 100 | /// Useful to implement screen capturer or picker, and supports multiple-monitor 101 | /// TRUE if the window created and ended successfully, or FALSE if failed 102 | NTA_API BOOL NTAPI Dlg_ScreenSnapshot(_In_ PDLG_SCREENSNAPSHOT ScreenSnapshot); 103 | 104 | /// 105 | /// Callback registered by Dlg_SetResizingSubclass 106 | /// 107 | /// Handle to the dialog box 108 | /// New width of client area 109 | /// New height of client area 110 | /// Not NULL when window changed by window-management functions 111 | typedef VOID(CALLBACK* DLG_RESIZEDPROC)(HWND Dialog, LONG NewWidth, LONG NewHeight, PWINDOWPOS WindowPos); 112 | 113 | /// 114 | /// Subclasses a dialog box to help support of resizing 115 | /// 116 | /// Handle to the dialog box 117 | /// Use current size as minimum size of window, set to FALSE will no limitation 118 | /// Callback procedure will be invoked when the size of dialog box changed 119 | /// TRUE if succeeded, or FALSE if failed, no error code reports due to SetWindowSubclass does 120 | NTA_API BOOL NTAPI Dlg_SetResizingSubclass(HWND Dialog, BOOL MinLimit, DLG_RESIZEDPROC ResizedProc); 121 | 122 | NTA_API BOOL NTAPI Dlg_SetTreeViewPropertySheetSubclass(HWND Dialog, HWND TreeView, PRECT SheetRect, _In_ PDLG_TREEVIEWPROPSHEETPAGE Sheets, UINT Count); 123 | 124 | /// 125 | /// Support dialogue messages and accelerators 126 | NTA_API _Success_(return != FALSE) BOOL NTAPI Dlg_MessageLoop(_In_opt_ HWND Window, _In_ HWND Dialog, _In_opt_ HACCEL Accelerator, _Out_opt_ PUINT_PTR ExitCode); 127 | 128 | /// 129 | /// Creates a dialog box that enables the user to edit a RECT structure 130 | /// 131 | /// Handle to the owner window 132 | /// String table to display text on the dialog, default strings is ["Title", "Reset", "OK", "Left", "Top", "Right", "Bottom", "Width", "Height"] 133 | /// Pointer to the RECT structure to set initial values and receive the result values 134 | /// TRUE if a RECT was confirmed, or FALSE if user canceled or an error occured 135 | NTA_API BOOL NTAPI Dlg_RectEditor(HWND Owner, _In_opt_ PCWSTR * Strings, _Inout_ PRECT Rect); 136 | 137 | #define DVE_TYPE_COMBINATION 0x1 138 | #define DVE_TYPE_ENUMERATION 0x2 139 | 140 | #define DVE_VALUE_HEXDWORD 0x100 141 | #define DVE_VALUE_HEXQWORD 0x200 142 | 143 | typedef struct _DLG_VALUEEDITOR_CONST { 144 | QWORD Value; 145 | PCWSTR Name; 146 | PCWSTR Info; 147 | } DLG_VALUEEDITOR_CONST, *PDLG_VALUEEDITOR_CONST; 148 | 149 | /// 150 | /// Creates a dialog box that enables the user to edit a value as combination or enumeration 151 | /// 152 | /// Handle to the owner window 153 | /// Can be combined with one of DVE_TYPE_XXX and one of DVE_VALUE_XXX 154 | /// String table to display text on the dialog, default strings is ["Title", "Reset", "OK", "Member", "Value", "Info", "Unknow"] 155 | /// Pointer to the value to set initial value and receive the result value 156 | /// Pointer to a DLG_VALUEEDITOR_CONST structures array, contains constant members of value 157 | /// Number of constants in Consts parameter 158 | /// TRUE if a value was confirmed, or FALSE if user canceled or an error occured 159 | NTA_API BOOL NTAPI Dlg_ValueEditorEx(HWND Owner, _In_ DWORD Flags, _In_opt_ PCWSTR * Strings, _Inout_ PQWORD Value, _In_ PDLG_VALUEEDITOR_CONST Consts, _In_ UINT ConstCount); 160 | 161 | #define Dlg_ValueEditor(Owner, Flags, Strings, Value, Consts) Dlg_ValueEditorEx(Owner, Flags, Strings, Value, Consts, ARRAYSIZE(Consts)) 162 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTARProc.h: -------------------------------------------------------------------------------- 1 | // Remote Process accessibility 2 | 3 | #pragma once 4 | 5 | #include "NTADef.h" 6 | 7 | typedef struct _RPROC_MAP { 8 | PVOID Local; 9 | SIZE_T LocalSize; 10 | PVOID Remote; 11 | SIZE_T RemoteSize; 12 | ULONG RemotePageProtect; 13 | } RPROC_MAP, *PRPROC_MAP; 14 | 15 | /// 16 | /// Callback procedure to enumerate DLL modules in remote process 17 | /// 18 | /// Handle to the remote process 19 | /// Pointer to a LDR_DATA_TABLE_ENTRY structure represents each DLL 20 | /// User defined value passed to this callback 21 | /// TRUE if continue enumeration, or FALSE to stop 22 | typedef BOOL(CALLBACK* RPROC_DLLENUMPROC64)(_In_ HANDLE ProcessHandle, _In_ PLDR_DATA_TABLE_ENTRY64 DllLdrEntry, LPARAM Param); 23 | typedef BOOL(CALLBACK* RPROC_DLLENUMPROC32)(_In_ HANDLE ProcessHandle, _In_ PLDR_DATA_TABLE_ENTRY32 DllLdrEntry, LPARAM Param); 24 | 25 | /// 26 | /// Enumerates DLL modules of remote process 27 | /// 28 | /// Handle to the remote process 29 | /// Callback procedure to receive information of each DLL 30 | /// User defined value passed to the callback 31 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last STATUS 32 | NTA_API BOOL NTAPI RProc_EnumDlls64(_In_ HANDLE ProcessHandle, _In_ RPROC_DLLENUMPROC64 DllEnumProc, LPARAM Param); 33 | NTA_API BOOL NTAPI RProc_EnumDlls32(_In_ HANDLE ProcessHandle, _In_ RPROC_DLLENUMPROC32 DllEnumProc, LPARAM Param); 34 | 35 | /// 36 | _Success_(return != FALSE) NTA_API BOOL NTAPI RProc_CreateThread(_In_ HANDLE ProcessHandle, _In_ LPTHREAD_START_ROUTINE StartAddress, _In_opt_ __drv_aliasesMem PVOID Param, BOOL CreateSuspended, _Out_opt_ PHANDLE ThreadHandle); 37 | 38 | 39 | /// 40 | _Success_(return > 0) NTA_API SIZE_T NTAPI RProc_ReadMemory(_In_ HANDLE ProcessHandle, _In_ PVOID BaseAddress, _Out_writes_bytes_(Size) PVOID Buffer, _In_ SIZE_T Size); 41 | 42 | /// 43 | _Success_(return > 0) NTA_API SIZE_T NTAPI RProc_WriteMemory(_In_ HANDLE ProcessHandle, _In_ PVOID BaseAddress, _In_reads_bytes_(Size) LPCVOID Buffer, _In_ SIZE_T Size); 44 | 45 | /// 46 | NTA_API HANDLE NTAPI RProc_Open(DWORD DesiredAccess, DWORD ProcessId); 47 | 48 | /// 49 | NTA_API HANDLE NTAPI RProc_OpenThread(DWORD DesiredAccess, DWORD ThreadId); 50 | 51 | /// 52 | /// Adjusts specified process privilege 53 | /// 54 | /// 55 | /// Handle to the process 56 | /// Privilege value to adjust, SE_XXX_PRIVILEGE 57 | /// Attribute of privilege, SE_PRIVILEGE_XXX, or 0 to disable the privilege 58 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last STATUS 59 | NTA_API BOOL NTAPI RProc_AdjustPrivilege(_In_ HANDLE ProcessHandle, _In_ SE_PRIVILEGE Privilege, _In_ DWORD Attributes); 60 | 61 | /// 62 | /// Gets Win32 format full path of specified process 63 | /// 64 | /// Handle to the process 65 | /// Pointer to the buffer to receive path 66 | /// The size of the FilePath buffer in WCHARs 67 | /// Number of characters written, NOT including null-terminates, or 0 if failed, error code storaged in last STATUS 68 | /// PROCESS_QUERY_LIMITED_INFORMATION or PROCESS_QUERY_INFORMATION access is required 69 | _Success_(return > 0) NTA_API UINT NTAPI RProc_GetFullImageNameEx(HANDLE ProcessHandle, _Out_writes_z_(FilePathCch) PWSTR FilePath, _In_ UINT FilePathCch); 70 | #define RProc_GetFullImageName(ProcessHandle, FilePath) RProc_GetFullImageNameEx(ProcessHandle, FilePath, ARRAYSIZE(FilePath)) 71 | 72 | /// 73 | /// Translates address in remote procecss to "ModuleName!Address" format 74 | /// 75 | /// Handle to the process 76 | /// Address to translate 77 | /// Pointer to the buffer to receive translated string 78 | /// The size of the FilePath buffer in WCHARs 79 | /// Number of characters written, NOT including null-terminates, or 0 if failed, error code storaged in last STATUS 80 | _Success_(return > 0) NTA_API UINT NTAPI RProc_TranslateAddressEx(HANDLE ProcessHandle, _In_ ULONGLONG Address, _Out_writes_z_(OutputStringCch) PWSTR OutputString, _In_ UINT OutputStringCch); 81 | #define RProc_TranslateAddress(ProcessHandle, Address, OutputString) RProc_TranslateAddressEx(ProcessHandle, Address, OutputString, ARRAYSIZE(OutputString)) 82 | 83 | /// 84 | /// Reads ANSI or Unicode string from remote memory 85 | /// 86 | /// Handle to the process 87 | /// Address to the string 88 | /// Pointer to the buffer to receive string 89 | /// The size of the FilePath buffer in TCHARs 90 | /// Number of characters written, NOT including null-terminates, or 0 if failed, error code storaged in last STATUS 91 | _Success_(return > 0) NTA_API UINT NTAPI RProc_ReadMemStringExW(HANDLE ProcessHandle, _In_ PVOID Address, _Out_writes_z_(OutputStringCch) PWSTR OutputString, _In_ UINT OutputStringCch); 92 | _Success_(return > 0) NTA_API UINT NTAPI RProc_ReadMemStringExA(HANDLE ProcessHandle, _In_ PVOID Address, _Out_writes_z_(OutputStringCch) PSTR OutputString, _In_ UINT OutputStringCch); 93 | #define RProc_ReadMemStringW(ProcessHandle, Address, OutputString) RProc_ReadMemStringExW(ProcessHandle, Address, OutputString, ARRAYSIZE(OutputString)) 94 | #define RProc_ReadMemStringA(ProcessHandle, Address, OutputString) RProc_ReadMemStringExA(ProcessHandle, Address, OutputString, ARRAYSIZE(OutputString)) 95 | 96 | /// 97 | /// Initializes LocalAddress, LocalSize, RemotePageProtect RPROC_MAP structure 98 | /// 99 | /// Pointer to the RPROC_MAP structure 100 | /// Address to the local memory 101 | /// Size of local memory 102 | /// Address to the remote memory, or NULL lets the system determines where to allocate 103 | /// Page protection flags of mapped remote memory pages 104 | NTA_API VOID NTAPI RProc_InitMap(_Out_ PRPROC_MAP RemoteMemMap, _In_ PVOID LocalAddress, _In_ SIZE_T LocalSize, _In_opt_ PVOID RemoteAddress, _In_ ULONG RemotePageProtect); 105 | 106 | /// 107 | /// Maps local memory to remote process 108 | /// 109 | /// Handle to the remote process 110 | /// Pointer to the RPROC_MAP structure contains necessary information to setup map 111 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last STATUS 112 | /// LocalAddress, LocalSize and RemotePageProtect should be specified in RemoteMemMap, or initialize by RProc_InitMap 113 | _Success_(return != FALSE) NTA_API BOOL NTAPI RProc_MemMap(HANDLE ProcessHandle, _Inout_ PRPROC_MAP RemoteMemMap); 114 | 115 | /// 116 | /// Frees memory on remote process mapped by RProc_MemMap 117 | /// 118 | /// Handle to the remote process 119 | /// Pointer to the RPROC_MAP structure 120 | /// TRUE if succeeded, or FALSE if failed, error code storaged in last STATUS 121 | NTA_API BOOL NTAPI RProc_MemUnmap(HANDLE ProcessHandle, _In_ PRPROC_MAP RemoteMemMap); 122 | 123 | _Success_(return != FALSE) NTA_API BOOL NTAPI RProc_GetWow64PEB(_In_ HANDLE hProcess, _Out_ PPEB32 * Wow64PEB); 124 | 125 | /// 126 | _Success_(return != FALSE) NTA_API BOOL NTAPI RProc_IsWow64(_In_ HANDLE hProcess, _Out_ PBOOL Wow64Process); 127 | 128 | /// 129 | /// Creates a new process 130 | /// 131 | /// 132 | _Check_return_ NTA_API HANDLE NTAPI RProc_Create(_In_opt_ HANDLE TokenHandle, _In_opt_ PCWSTR ApplicationName, _Inout_opt_ LPWSTR CommandLine, _In_ BOOL InheritHandles, _In_opt_ PCWSTR CurrentDirectory, _In_opt_ LPSTARTUPINFOW StartupInfo); 133 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTStruct.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | typedef struct _LEAP_SECOND_DATA { 6 | UCHAR Enabled; 7 | UCHAR Padding[3]; 8 | ULONG Count; 9 | LARGE_INTEGER Data[ANYSIZE_ARRAY]; 10 | } LEAP_SECOND_DATA, *PLEAP_SECOND_DATA; 11 | 12 | typedef struct _LDR_SERVICE_TAG_RECORD LDR_SERVICE_TAG_RECORD, *PLDR_SERVICE_TAG_RECORD; 13 | 14 | struct _LDR_SERVICE_TAG_RECORD { 15 | PLDR_SERVICE_TAG_RECORD Next; 16 | UINT ServiceTag; 17 | }; 18 | 19 | typedef enum _LDR_DDAG_STATE { 20 | LdrModulesMerged = -5, 21 | LdrModulesInitError = -4, 22 | LdrModulesSnapError = -3, 23 | LdrModulesUnloaded = -2, 24 | LdrModulesUnloading = -1, 25 | LdrModulesPlaceHolder = 0, 26 | LdrModulesMapping = 1, 27 | LdrModulesMapped = 2, 28 | LdrModulesWaitingForDependencies = 3, 29 | LdrModulesSnapping = 4, 30 | LdrModulesSnapped = 5, 31 | LdrModulesCondensed = 6, 32 | LdrModulesReadyToInit = 7, 33 | LdrModulesInitializing = 8, 34 | LdrModulesReadyToRun = 9, 35 | } LDR_DDAG_STATE, *PLDR_DDAG_STATE; 36 | 37 | typedef struct _LDRP_CSLIST { 38 | SINGLE_LIST_ENTRY Tail; 39 | } LDRP_CSLIST, *PLDRP_CSLIST; 40 | 41 | typedef struct _LDR_DDAG_NODE { 42 | LIST_ENTRY Modules; 43 | PLDR_SERVICE_TAG_RECORD ServiceTagList; 44 | UINT LoadCount; 45 | UINT LoadWhileUnloadingCount; 46 | PVOID LowestLink; 47 | LDRP_CSLIST Dependencies; 48 | LDRP_CSLIST IncomingDependencies; 49 | LDR_DDAG_STATE State; 50 | SINGLE_LIST_ENTRY CondenseLink; 51 | UINT PreorderNumber; 52 | } LDR_DDAG_NODE, *PLDR_DDAG_NODE; 53 | 54 | typedef enum _LDR_HOT_PATCH_STATE { 55 | LdrHotPatchBaseImage = 0, 56 | LdrHotPatchNotApplied = 1, 57 | LdrHotPatchAppliedReverse = 2, 58 | LdrHotPatchAppliedForward = 3, 59 | LdrHotPatchFailedToPatch = 4, 60 | LdrHotPatchStateMax = 5 61 | }LDR_HOT_PATCH_STATE, *PLDR_HOT_PATCH_STATE; 62 | 63 | typedef enum _LDR_DLL_LOAD_REASON { 64 | LoadReasonStaticDependency = 0, 65 | LoadReasonStaticForwarderDependency = 1, 66 | LoadReasonDynamicForwarderDependency = 2, 67 | LoadReasonDelayloadDependency = 3, 68 | LoadReasonDynamicLoad = 4, 69 | LoadReasonAsImageLoad = 5, 70 | LoadReasonAsDataLoad = 6, 71 | LoadReasonEnclavePrimary = 7, 72 | LoadReasonEnclaveDependency = 8, 73 | LoadReasonPatchImage = 9, 74 | LoadReasonUnknown = -1 75 | } LDR_DLL_LOAD_REASON, *PLDR_DLL_LOAD_REASON; 76 | 77 | typedef struct _KSYSTEM_TIME { 78 | ULONG LowPart; 79 | LONG High1Time; 80 | LONG High2Time; 81 | } KSYSTEM_TIME, *PKSYSTEM_TIME; 82 | 83 | typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE { 84 | StandardDesign, // None == 0 == standard design 85 | NEC98x86, // NEC PC98xx series on X86 86 | EndAlternatives // past end of known alternatives 87 | } ALTERNATIVE_ARCHITECTURE_TYPE, *PALTERNATIVE_ARCHITECTURE_TYPE; 88 | 89 | typedef struct _ACTIVATION_CONTEXT_DATA { 90 | ULONG Magic; 91 | ULONG HeaderSize; 92 | ULONG FormatVersion; 93 | ULONG TotalSize; 94 | ULONG DefaultTocOffset; 95 | ULONG ExtendedTocOffset; 96 | ULONG AssemblyRosterOffset; 97 | ULONG Flags; 98 | } ACTIVATION_CONTEXT_DATA, *PACTIVATION_CONTEXT_DATA; 99 | 100 | typedef struct _ASSEMBLY_STORAGE_MAP_ENTRY { 101 | ULONG Flags; 102 | UNICODE_STRING DosPath; 103 | HANDLE Handle; 104 | } ASSEMBLY_STORAGE_MAP_ENTRY, *PASSEMBLY_STORAGE_MAP_ENTRY; 105 | 106 | typedef struct _ASSEMBLY_STORAGE_MAP_ENTRY64 { 107 | ULONG Flags; 108 | UNICODE_STRING64 DosPath; 109 | VOID* PTR64 Handle; 110 | } ASSEMBLY_STORAGE_MAP_ENTRY64, *PASSEMBLY_STORAGE_MAP_ENTRY64; 111 | 112 | typedef struct _ASSEMBLY_STORAGE_MAP_ENTRY32 { 113 | ULONG Flags; 114 | UNICODE_STRING32 DosPath; 115 | VOID* PTR32 Handle; 116 | } ASSEMBLY_STORAGE_MAP_ENTRY32, *PASSEMBLY_STORAGE_MAP_ENTRY32; 117 | 118 | typedef struct _ASSEMBLY_STORAGE_MAP { 119 | ULONG Flags; 120 | ULONG AssemblyCount; 121 | PASSEMBLY_STORAGE_MAP_ENTRY *AssemblyArray; 122 | } ASSEMBLY_STORAGE_MAP, *PASSEMBLY_STORAGE_MAP; 123 | 124 | typedef struct _ASSEMBLY_STORAGE_MAP64 { 125 | ULONG Flags; 126 | ULONG AssemblyCount; 127 | ASSEMBLY_STORAGE_MAP_ENTRY64* PTR64* AssemblyArray; 128 | } ASSEMBLY_STORAGE_MAP64, *PASSEMBLY_STORAGE_MAP64; 129 | 130 | typedef struct _ASSEMBLY_STORAGE_MAP32 { 131 | ULONG Flags; 132 | ULONG AssemblyCount; 133 | ASSEMBLY_STORAGE_MAP_ENTRY32* PTR32* AssemblyArray; 134 | } ASSEMBLY_STORAGE_MAP32, *PASSEMBLY_STORAGE_MAP32; 135 | 136 | typedef struct _RTL_BITMAP { 137 | ULONG SizeOfBitMap; 138 | PULONG Buffer; 139 | } RTL_BITMAP, *PRTL_BITMAP; 140 | 141 | typedef struct _RTL_BITMAP64 { 142 | ULONG SizeOfBitMap; 143 | ULONG* PTR64 Buffer; 144 | } RTL_BITMAP64, *PRTL_BITMAP64; 145 | 146 | typedef struct _RTL_BITMAP32 { 147 | ULONG SizeOfBitMap; 148 | ULONG* PTR32 Buffer; 149 | } RTL_BITMAP32, *PRTL_BITMAP32; 150 | 151 | typedef struct _RTLP_CURDIR_REF { 152 | LONG RefCount; 153 | HANDLE Handle; 154 | } RTLP_CURDIR_REF, *PRTLP_CURDIR_REF; 155 | 156 | typedef struct { 157 | UNICODE_STRING RelativeName; 158 | HANDLE ContainingDirectory; 159 | PRTLP_CURDIR_REF CurDirRef; 160 | } RTL_RELATIVE_NAME_U, *PRTL_RELATIVE_NAME_U; 161 | 162 | typedef NTSTATUS 163 | (NTAPI* PRTL_HEAP_COMMIT_ROUTINE)( 164 | IN PVOID Base, 165 | IN OUT PVOID* CommitAddress, 166 | IN OUT PSIZE_T CommitSize 167 | ); 168 | 169 | typedef struct _RTL_HEAP_PARAMETERS { 170 | ULONG Length; 171 | SIZE_T SegmentReserve; 172 | SIZE_T SegmentCommit; 173 | SIZE_T DeCommitFreeBlockThreshold; 174 | SIZE_T DeCommitTotalFreeThreshold; 175 | SIZE_T MaximumAllocationSize; 176 | SIZE_T VirtualMemoryThreshold; 177 | SIZE_T InitialCommit; 178 | SIZE_T InitialReserve; 179 | PRTL_HEAP_COMMIT_ROUTINE CommitRoutine; 180 | SIZE_T Reserved[2]; 181 | } RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS; 182 | 183 | typedef enum _SECTION_INHERIT { 184 | ViewShare = 1, 185 | ViewUnmap = 2 186 | } SECTION_INHERIT, *PSECTION_INHERIT; 187 | 188 | typedef USHORT RTL_ATOM, *PRTL_ATOM; 189 | 190 | typedef enum _ATOM_INFORMATION_CLASS { 191 | AtomBasicInformation, 192 | AtomTableInformation, 193 | } ATOM_INFORMATION_CLASS, *PATOM_INFORMATION_CLASS; 194 | 195 | typedef struct _ATOM_BASIC_INFORMATION { 196 | USHORT UsageCount; 197 | USHORT Flags; 198 | USHORT NameLength; 199 | WCHAR Name[1]; 200 | } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION; 201 | 202 | typedef enum _OBJECT_INFORMATION_CLASS { 203 | ObjectBasicInformation, 204 | ObjectNameInformation, 205 | ObjectTypeInformation, 206 | ObjectAllTypesInformation, 207 | ObjectHandleInformation 208 | } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS; 209 | 210 | typedef enum _MEMORY_INFORMATION_CLASS { 211 | MemoryBasicInformation, 212 | MemoryWorkingSetList, 213 | MemorySectionName, 214 | MemoryBasicVlmInformation, 215 | MemoryWorkingSetExList 216 | } MEMORY_INFORMATION_CLASS, *PMEMORY_INFORMATION_CLASS; 217 | 218 | // Well-known privileges 219 | typedef enum _SE_PRIVILEGE { 220 | SE_MIN_WELL_KNOWN_PRIVILEGE = 2, 221 | SE_CREATE_TOKEN_PRIVILEGE = 2, 222 | SE_ASSIGNPRIMARYTOKEN_PRIVILEGE = 3, 223 | SE_LOCK_MEMORY_PRIVILEGE = 4, 224 | SE_INCREASE_QUOTA_PRIVILEGE = 5, 225 | SE_MACHINE_ACCOUNT_PRIVILEGE = 6, 226 | SE_TCB_PRIVILEGE = 7, 227 | SE_SECURITY_PRIVILEGE = 8, 228 | SE_TAKE_OWNERSHIP_PRIVILEGE = 9, 229 | SE_LOAD_DRIVER_PRIVILEGE = 10, 230 | SE_SYSTEM_PROFILE_PRIVILEGE = 11, 231 | SE_SYSTEMTIME_PRIVILEGE = 12, 232 | SE_PROF_SINGLE_PROCESS_PRIVILEGE = 13, 233 | SE_INC_BASE_PRIORITY_PRIVILEGE = 14, 234 | SE_CREATE_PAGEFILE_PRIVILEGE = 15, 235 | SE_CREATE_PERMANENT_PRIVILEGE = 16, 236 | SE_BACKUP_PRIVILEGE = 17, 237 | SE_RESTORE_PRIVILEGE = 18, 238 | SE_SHUTDOWN_PRIVILEGE = 19, 239 | SE_DEBUG_PRIVILEGE = 20, 240 | SE_AUDIT_PRIVILEGE = 21, 241 | SE_SYSTEM_ENVIRONMENT_PRIVILEGE = 22, 242 | SE_CHANGE_NOTIFY_PRIVILEGE = 23, 243 | SE_REMOTE_SHUTDOWN_PRIVILEGE = 24, 244 | SE_UNDOCK_PRIVILEGE = 25, 245 | SE_SYNC_AGENT_PRIVILEGE = 26, 246 | SE_ENABLE_DELEGATION_PRIVILEGE = 27, 247 | SE_MANAGE_VOLUME_PRIVILEGE = 28, 248 | SE_IMPERSONATE_PRIVILEGE = 29, 249 | SE_CREATE_GLOBAL_PRIVILEGE = 30, 250 | SE_TRUSTED_CREDMAN_ACCESS_PRIVILEGE = 31, 251 | SE_RELABEL_PRIVILEGE = 32, 252 | SE_INC_WORKING_SET_PRIVILEGE = 33, 253 | SE_TIME_ZONE_PRIVILEGE = 34, 254 | SE_CREATE_SYMBOLIC_LINK_PRIVILEGE = 35, 255 | SE_DELEGATE_SESSION_USER_IMPERSONATE_PRIVILEGE = 36, 256 | SE_MAX_WELL_KNOWN_PRIVILEGE = SE_DELEGATE_SESSION_USER_IMPERSONATE_PRIVILEGE 257 | } SE_PRIVILEGE, *PSE_PRIVILEGE; 258 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTAUI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTADef.h" 4 | 5 | #define UI_NONOTIFYPROP TEXT("NTAssassin.UI.NoNotify") 6 | 7 | typedef struct _UI_WINDBPAINT { 8 | PAINTSTRUCT Paint; // Native PAINTSTRUCT structure from "BeginPaint" 9 | HDC DC; // Compatible memory DC 10 | HBITMAP Bitmap; // Compatible memory bitmap 11 | RECT Rect; // RECT of window client area 12 | } UI_WINDBPAINT, * PUI_WINDBPAINT; 13 | 14 | /// 15 | /// Double-buffered painting intergrated 16 | NTA_API HDC NTAPI UI_BeginPaint(HWND Window, _Out_ PUI_WINDBPAINT Paint); 17 | 18 | /// 19 | /// Ends painting began by UI_BeginPaint 20 | /// 21 | /// 22 | NTA_API VOID NTAPI UI_EndPaint(HWND Window, _In_ PUI_WINDBPAINT Paint); 23 | 24 | /// 25 | /// With DWM frame bounds correction 26 | NTA_API BOOL NTAPI UI_GetWindowRect(HWND Window, _Out_ PRECT Rect); 27 | 28 | /// 29 | /// With DWM frame bounds correction 30 | NTA_API BOOL NTAPI UI_SetWindowRect(HWND Window, _In_ PRECT Rect); 31 | 32 | /// 33 | /// Gets position of window relative to specified window 34 | /// 35 | /// Handle to the window to obtain position 36 | /// Handle to the window relative to, parent window used if inputs NULL 37 | /// Pointer to a RECT structure to receive position 38 | /// TRUE if successed, or FALSE if failed 39 | _Success_(return != FALSE) NTA_API BOOL NTAPI UI_GetRelativeRect(HWND Window, HWND RefWindow, _Out_ PRECT Rect); 40 | 41 | /// 42 | /// Implemented by GetWindow 43 | NTA_API VOID NTAPI UI_EnumChildWindows(HWND ParentWindow, _In_ WNDENUMPROC WindowEnumProc, LPARAM Param); 44 | 45 | /// 46 | NTA_API BOOL NTAPI UI_IsDWMComposited(); 47 | 48 | /// 49 | /// 50 | NTA_API DWORD NTAPI UI_GetWindowCloackedState(HWND Window); 51 | 52 | /// 53 | /// Sets window theme to "Explorer" style 54 | /// 55 | /// 56 | /// TRUE if succeed, or FALSE if failed 57 | NTA_API BOOL NTAPI UI_SetTheme(HWND Window); 58 | 59 | /// 60 | #define UI_EnableDlgItem(Dialog, ItemID, EnableState) EnableWindow(GetDlgItem(Dialog, ItemID), EnableState) 61 | 62 | /// 63 | #define UI_SendMsg(Window, Msg, wParam, lParam) SendMessage(Window, Msg, (WPARAM)(wParam), (LPARAM)(lParam)) 64 | 65 | /// 66 | #define UI_SendDlgItemMsg(Dialog, ItemID, Msg, wParam, lParam) SendMessage(GetDlgItem(Dialog, ItemID), Msg, (WPARAM)(wParam), (LPARAM)(lParam)) 67 | 68 | /// 69 | #define UI_GetDlgButtonCheck(Dialog, ButtonID) SendMessage(GetDlgItem(Dialog, ButtonID), BM_GETCHECK, 0, 0) 70 | 71 | /// 72 | #define UI_SetDlgButtonCheck(Dialog, ButtonID, CheckState) SendMessageW(GetDlgItem(Dialog, ButtonID), BM_SETCHECK, (WPARAM)(CheckState), 0) 73 | 74 | /// 75 | #define UI_SetWindowTextW(Window, Text) SendMessageW(Window, WM_SETTEXT, 0, (LPARAM)(Text)) 76 | #define UI_SetWindowTextA(Window, Text) SendMessageA(Window, WM_SETTEXT, 0, (LPARAM)(Text)) 77 | #ifdef UNICODE 78 | #define UI_SetWindowText UI_SetWindowTextW 79 | #else 80 | #define UI_SetWindowText UI_SetWindowTextA 81 | #endif 82 | 83 | /// 84 | #define UI_SetDlgItemTextW(Dialog, ItemID, Text) UI_SetWindowTextW(GetDlgItem(Dialog, ItemID), Text) 85 | #define UI_SetDlgItemTextA(Dialog, ItemID, Text) UI_SetWindowTextA(GetDlgItem(Dialog, ItemID), Text) 86 | #ifdef UNICODE 87 | #define UI_SetDlgItemText UI_SetDlgItemTextW 88 | #else 89 | #define UI_SetDlgItemText UI_SetDlgItemTextA 90 | #endif 91 | 92 | /// 93 | #define UI_GetDlgItemProp(Dialog, ItemID, Prop) GetPropW(GetDlgItem(Dialog, ItemID), Prop) 94 | 95 | /// 96 | #define UI_PtInRect(Rect, Point) (((Point).x >= (Rect)->left) && ((Point).x < (Rect)->right) && ((Point).y >= (Rect)->top) && ((Point).y < (Rect)->bottom)) 97 | 98 | /// 99 | /// Inverses a RGB color 100 | /// 101 | /// RGB color to be inversed 102 | /// RGB color being inversed 103 | #define UI_InverseRGB(Color) ((COLORREF)(~(Color) & 0xFFFFFF)) 104 | 105 | /// 106 | /// Invalidates and updates the whole window immediately 107 | /// 108 | /// 109 | #define UI_Redraw(Window) RedrawWindow(Window, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW) 110 | 111 | /// 112 | /// Enables or disables specified style or extended style for a widnow 113 | /// 114 | /// 115 | /// Handle to the window 116 | /// GWL_STYLE or GWL_EXSTYLE 117 | /// The style flags to enable or disable 118 | /// Set to TRUE to enable or FALSE to disable 119 | /// TRUE if succeeded, or FALSE if failed 120 | NTA_API BOOL NTAPI UI_EnableWindowStyle(HWND Window, INT StyleIndex, LONG_PTR StyleFlag, BOOL EnableState); 121 | 122 | /// 123 | /// Opens process who owns specified window 124 | /// 125 | /// The access to the process object 126 | /// Handle to the window 127 | /// The process handle or NULL if failed 128 | NTA_API HANDLE NTAPI UI_OpenProc(DWORD DesiredAccess, HWND Window); 129 | 130 | // Set window text without notify, useful to avoid endless loop caused by notification triggled when handling itself 131 | NTA_API BOOL NTAPI UI_SetNoNotifyFlag(HWND Window, BOOL EnableState); 132 | NTA_API BOOL NTAPI UI_GetNoNotifyFlag(HWND Window); 133 | NTA_API LRESULT NTAPI UI_SetWndTextNoNotify(HWND Window, _In_opt_ PCWSTR Text); 134 | 135 | /** 136 | * @see "GetWindowTextW" 137 | * @note Sometimes "WM_GETTEXT" works incorrectly, this function may safer 138 | */ 139 | 140 | /// 141 | /// WM_GETTEXT may not writting null-terminates in some cases, this wrapper fixes it 142 | NTA_API _Success_(return > 0) UINT NTAPI UI_GetWindowTextExW(HWND Window, _Out_writes_z_(TextCch) PWSTR Text, UINT TextCch); 143 | NTA_API _Success_(return > 0) UINT NTAPI UI_GetWindowTextExA(HWND Window, _Out_writes_z_(TextCch) PSTR Text, UINT TextCch); 144 | #define UI_GetWindowTextW(Window, Text) UI_GetWindowTextExW(Window, Text, ARRAYSIZE(Text)) 145 | #define UI_GetDlgItemTextExW(Dialog, ItemID, Text, TextCch) UI_GetWindowTextExW(GetDlgItem(Dialog, ItemID), Text, TextCch) 146 | #define UI_GetDlgItemTextW(Dialog, ItemID, Text) UI_GetDlgItemTextExW(Dialog, ItemID, Text, ARRAYSIZE(Text)) 147 | #define UI_GetWindowTextA(Window, Text) UI_GetWindowTextExA(Window, Text, ARRAYSIZE(Text)) 148 | #define UI_GetDlgItemTextExA(Dialog, ItemID, Text, TextCch) UI_GetWindowTextExA(GetDlgItem(Dialog, ItemID), Text, TextCch) 149 | #define UI_GetDlgItemTextA(Dialog, ItemID, Text) UI_GetDlgItemTextExA(Dialog, ItemID, Text, ARRAYSIZE(Text)) 150 | #ifdef UNICODE 151 | #define UI_GetWindowText UI_GetWindowTextW 152 | #define UI_GetDlgItemTextEx UI_GetDlgItemTextExW 153 | #define UI_GetDlgItemText UI_GetDlgItemTextW 154 | #else 155 | #define UI_GetWindowText UI_GetWindowTextA 156 | #define UI_GetDlgItemTextEx UI_GetDlgItemTextExA 157 | #define UI_GetDlgItemText UI_GetDlgItemTextA 158 | #endif 159 | 160 | /// 161 | /// 162 | /// GetWindowLongPtr may crash in some cases, this wrapper fixes it 163 | NTA_API _Success_(return != FALSE) BOOL NTAPI UI_GetWindowLong(HWND Window, BOOL ClassLong, INT Index, _Out_ PLONG_PTR Result); 164 | 165 | /// 166 | /// Enters message loop for specified window 167 | /// GetMessage - MSDN 168 | /// 169 | /// Handle to the window, NULL to loop all windows belong to current thread 170 | /// Pointer to a variable receives exit code 171 | /// TRUE if the loop ended when receives WM_QUIT, or FALSE when an error occurred 172 | NTA_API _Success_(return != FALSE) BOOL NTAPI UI_MessageLoop(HWND Window, _Out_opt_ PUINT_PTR ExitCode); 173 | 174 | /// 175 | /// Gets position and size of virtual screen (multiple monitors support) 176 | /// 177 | /// Pointer to a POINT structure receives position of virtual screen 178 | /// Pointer to a SIZE structure receives size of virtual screen 179 | NTA_API VOID NTAPI UI_GetScreenPos(_Out_opt_ PPOINT Point, _Out_opt_ PSIZE Size); 180 | 181 | /// 182 | /// Allows WM_DROPFILES message, especially in an elevated application 183 | /// 184 | /// Handle to the window 185 | /// TRUE if successed, or FALSE if failed 186 | NTA_API BOOL NTAPI UI_AllowDrop(HWND Window); 187 | -------------------------------------------------------------------------------- /Source/AlleyWind/General.c: -------------------------------------------------------------------------------- 1 | #include "AlleyWind.h" 2 | 3 | I18N_CTLTEXT astWndPropGeneralTextCtl[] = { 4 | { IDC_WNDPROP_GENERAL_CAPTION_TEXT, I18NIndex_Caption }, 5 | { IDC_WNDPROP_GENERAL_HANDLE_TEXT, I18NIndex_Handle }, 6 | { IDC_WNDPROP_GENERAL_WNDPROC_TEXT, I18NIndex_WindowProcedure }, 7 | { IDC_WNDPROP_GENERAL_CTRLID_TEXT, I18NIndex_ControlID }, 8 | { IDC_WNDPROP_GENERAL_SYSCLS_TEXT, I18NIndex_SystemClass }, 9 | { IDC_WNDPROP_GENERAL_STYLE_TEXT, I18NIndex_Style }, 10 | { IDC_WNDPROP_GENERAL_EXSTYLE_TEXT, I18NIndex_ExtendedStyle }, 11 | { IDC_WNDPROP_GENERAL_USERDATA_TEXT, I18NIndex_UserData }, 12 | { IDC_WNDPROP_GENERAL_RECT_TEXT, I18NIndex_Rectangle }, 13 | { IDC_WNDPROP_GENERAL_RECTRELATIVEPOS_CHECK, I18NIndex_RelativePosition }, 14 | { IDC_WNDPROP_GENERAL_WNDBYTE_TEXT, I18NIndex_ExtraBytes } 15 | }; 16 | 17 | VOID WndPropGeneralUpdateRectCtl(HWND hDlg) { 18 | HWND hWnd; 19 | RECT rc; 20 | BOOL bSucc, bRelative; 21 | hWnd = AW_GetWndPropHWnd(hDlg); 22 | if (hWnd == GetDesktopWindow()) { 23 | rc.left = GetSystemMetrics(SM_XVIRTUALSCREEN); 24 | rc.top = GetSystemMetrics(SM_YVIRTUALSCREEN); 25 | rc.right = rc.left + GetSystemMetrics(SM_CXVIRTUALSCREEN); 26 | rc.bottom = rc.top + GetSystemMetrics(SM_CYVIRTUALSCREEN); 27 | bRelative = FALSE; 28 | bSucc = TRUE; 29 | UI_SetDlgButtonCheck(hDlg, IDC_WNDPROP_GENERAL_RECTRELATIVEPOS_CHECK, BST_UNCHECKED); 30 | UI_EnableDlgItem(hDlg, IDC_WNDPROP_GENERAL_RECTRELATIVEPOS_CHECK, FALSE); 31 | } else { 32 | bRelative = UI_GetDlgButtonCheck(hDlg, IDC_WNDPROP_GENERAL_RECTRELATIVEPOS_CHECK) == BST_CHECKED; 33 | bSucc = bRelative ? UI_GetRelativeRect(hWnd, NULL, &rc) : UI_GetWindowRect(hWnd, &rc); 34 | } 35 | AW_SetPropCtlRect(hDlg, IDC_WNDPROP_GENERAL_RECT_EDIT, &rc, bSucc); 36 | UI_EnableDlgItem(hDlg, IDC_WNDPROP_GENERAL_RECT_BTN, bSucc && bRelative); 37 | } 38 | 39 | INT_PTR WINAPI WndPropGeneralDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { 40 | if (uMsg == WM_INITDIALOG) { 41 | HWND hWnd, hCtl; 42 | TCHAR szBuffer[1024], szTempPath[MAX_PATH]; 43 | LPCTSTR lpszTemp; 44 | DWORD_PTR dwpStyle, dwpTemp; 45 | BOOL bSucc, bStyleSucc; 46 | PAW_SYSCLASSINFO lpSysClsInfo; 47 | INT iTemp; 48 | UINT uTemp; 49 | hWnd = (HWND)lParam; 50 | AW_SetWndPropHWnd(hDlg, hWnd); 51 | // Initialize 52 | KNS_SetDialogSubclass(hDlg, NULL); 53 | I18N_InitCtlTexts(hDlg, astWndPropGeneralTextCtl); 54 | UI_SetDlgButtonCheck(hDlg, IDC_WNDPROP_GENERAL_RECTRELATIVEPOS_CHECK, TRUE); 55 | bSucc = UI_GetWindowLong(hWnd, FALSE, GWL_STYLE, &dwpStyle); 56 | bStyleSucc = bSucc; 57 | // Handle 58 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_GENERAL_HANDLE_EDIT, TRUE, TEXT("%08X"), (DWORD)(DWORD_PTR)hWnd); 59 | // Style and extra style 60 | UI_EnableDlgItem(hDlg, IDC_WNDPROP_GENERAL_STYLE_BTN, bSucc); 61 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_GENERAL_STYLE_EDIT, bSucc, TEXT("%08X"), (DWORD)dwpStyle);; 62 | bSucc = UI_GetWindowLong(hWnd, FALSE, GWL_EXSTYLE, &dwpTemp); 63 | UI_EnableDlgItem(hDlg, IDC_WNDPROP_GENERAL_EXSTYLE_BTN, bSucc); 64 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_GENERAL_EXSTYLE_EDIT, bSucc, TEXT("%08X"), (DWORD)dwpTemp); 65 | // Caption 66 | AW_GetWindowText(hWnd, szBuffer); 67 | AW_SetPropCtlString(hDlg, IDC_WNDPROP_GENERAL_CAPTION_EDIT, szBuffer, TRUE); 68 | // WndProc 69 | HANDLE hProc; 70 | DWORD dwPID; 71 | GetWindowThreadProcessId(hWnd, &dwPID); 72 | hProc = RProc_Open(HIJACK_PROCESS_ACCESS, dwPID); 73 | dwpTemp = 0; 74 | BOOL b32Proc; 75 | PCSTR pszGWLFunc; 76 | BOOL bUnicode = IsWindowUnicode(hWnd); 77 | HIJACK_CALLPROCHEADER stCallProc; 78 | HIJACK_CALLPROCPARAM stGWLParams[] = { 79 | { (DWORD_PTR)hWnd, 0, FALSE }, 80 | { GWLP_WNDPROC, 0, FALSE } 81 | }; 82 | if (hProc && RProc_IsWow64(hProc, &b32Proc)) { 83 | pszGWLFunc = AW_GetWindowLongFunc(FALSE, b32Proc, bUnicode); 84 | if (Hijack_LoadProcAddr(hProc, L"user32.dll", pszGWLFunc, (PVOID*)&stCallProc.Procedure, AWSettings_GetItemValueEx(AWSetting_ResponseTimeout))) { 85 | stCallProc.RetValue = 0; 86 | stCallProc.CallConvention = CC_STDCALL; 87 | stCallProc.ParamCount = ARRAYSIZE(stGWLParams); 88 | dwpTemp = Hijack_CallProc(hProc, &stCallProc, stGWLParams, AWSettings_GetItemValueEx(AWSetting_ResponseTimeout)) ? (DWORD_PTR)stCallProc.RetValue : 0; 89 | if (b32Proc) 90 | dwpTemp = (DWORD)dwpTemp; 91 | } 92 | } 93 | if (!dwpTemp) 94 | UI_GetWindowLong(hWnd, FALSE, GWLP_WNDPROC, &dwpTemp); 95 | uTemp = hProc && dwpTemp ? RProc_TranslateAddress(hProc, (ULONGLONG)dwpTemp, szTempPath) : 0; 96 | iTemp = Str_Printf(szBuffer, TEXT("%s (%ws)"), uTemp ? szTempPath : I18N_GetString(I18NIndex_NotApplicable), bUnicode ? TEXT("Unicode") : TEXT("ANSI")); 97 | AW_SetPropCtlString(hDlg, IDC_WNDPROP_GENERAL_WNDPROC_EDIT, szBuffer, iTemp > 0); 98 | if (hProc) 99 | NtClose(hProc); 100 | // Control ID 101 | if (bStyleSucc && dwpStyle & WS_CHILD) { 102 | bSucc = UI_GetWindowLong(hWnd, FALSE, GWLP_ID, &dwpTemp); 103 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_GENERAL_CTRLID_EDIT, bSucc, TEXT("%d"), (INT)dwpTemp); 104 | } else { 105 | UI_EnableDlgItem(hDlg, IDC_WNDPROP_GENERAL_CTRLID_EDIT, FALSE); 106 | } 107 | // System class type 108 | lpszTemp = NULL; 109 | lpSysClsInfo = AW_DBFindSysClassInfo(hWnd); 110 | if (lpSysClsInfo) 111 | lpszTemp = IS_INTRESOURCE(lpSysClsInfo->DisplayName) ? I18N_GetString((UINT_PTR)lpSysClsInfo->DisplayName) : lpSysClsInfo->DisplayName; 112 | AW_SetPropCtlString(hDlg, IDC_WNDPROP_GENERAL_SYSCLS_EDIT, lpszTemp, lpszTemp != NULL); 113 | // User Data 114 | bSucc = UI_GetWindowLong(hWnd, FALSE, GWLP_USERDATA, &dwpTemp); 115 | AW_SetPropCtlFormat(hDlg, IDC_WNDPROP_GENERAL_USERDATA_EDIT, bSucc, TEXT("%p"), (LPVOID)dwpTemp); 116 | // Rectangles 117 | WndPropGeneralUpdateRectCtl(hDlg); 118 | // Extra Bytes 119 | hCtl = GetDlgItem(hDlg, IDC_WNDPROP_GENERAL_WNDBYTE_LIST); 120 | Ctl_InitListCtl(hCtl, aExtraBytesListCol, LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER); 121 | AW_EnumExtraBytes(hWnd, FALSE, (LPARAM)hCtl); 122 | } else if (uMsg == WM_COMMAND) { 123 | if (wParam == MAKEWPARAM(IDC_WNDPROP_GENERAL_CAPTION_EDIT, EN_CHANGE) && !UI_GetNoNotifyFlag((HWND)lParam)) { 124 | HWND hWnd; 125 | TCHAR szBuffer[1024]; 126 | LRESULT lResult; 127 | DWORD_PTR dwResult; 128 | hWnd = AW_GetWndPropHWnd(hDlg); 129 | lResult = UI_GetWindowText((HWND)lParam, szBuffer); 130 | lResult = AW_SendMsgTO(hWnd, WM_SETTEXT, 0, lResult ? (LPARAM)szBuffer : 0, &dwResult); 131 | if (!lResult || dwResult != TRUE) { 132 | AW_GetWindowText(hWnd, szBuffer); 133 | AW_SetPropCtlString(hDlg, LOWORD(wParam), szBuffer, TRUE); 134 | } 135 | } else if ( 136 | wParam == MAKEWPARAM(IDC_WNDPROP_GENERAL_STYLE_BTN, BN_CLICKED) || 137 | wParam == MAKEWPARAM(IDC_WNDPROP_GENERAL_EXSTYLE_BTN, BN_CLICKED) 138 | ) { 139 | HWND hWnd = AW_GetWndPropHWnd(hDlg); 140 | BOOL bSucc, bStyle = wParam == MAKEWPARAM(IDC_WNDPROP_GENERAL_STYLE_BTN, BN_CLICKED); 141 | DWORD_PTR dwpStyle; 142 | if (!UI_GetWindowLong(hWnd, FALSE, bStyle ? GWL_STYLE : GWL_EXSTYLE, &dwpStyle)) 143 | return FALSE; 144 | if (AW_DBEditValue(hDlg, hWnd, bStyle ? AWValueStyle : AWValueExStyle, (PDWORD)&dwpStyle)) { 145 | EH_ClearLastError(); 146 | SetWindowLongPtr(hWnd, bStyle ? GWL_STYLE : GWL_EXSTYLE, dwpStyle); 147 | if (EH_LastErrorSucceed()) { 148 | SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); 149 | UI_Redraw(hWnd); 150 | } 151 | bSucc = UI_GetWindowLong(hWnd, FALSE, bStyle ? GWL_STYLE : GWL_EXSTYLE, &dwpStyle); 152 | UI_EnableDlgItem(hDlg, bStyle ? IDC_WNDPROP_GENERAL_STYLE_BTN : IDC_WNDPROP_GENERAL_EXSTYLE_BTN, bSucc); 153 | AW_SetPropCtlFormat(hDlg, bStyle ? IDC_WNDPROP_GENERAL_STYLE_EDIT : IDC_WNDPROP_GENERAL_EXSTYLE_EDIT, bSucc, TEXT("%08X"), (DWORD)dwpStyle); 154 | } 155 | } else if (wParam == MAKEWPARAM(IDC_WNDPROP_GENERAL_RECTRELATIVEPOS_CHECK, BN_CLICKED)) { 156 | WndPropGeneralUpdateRectCtl(hDlg); 157 | } else if (wParam == MAKEWPARAM(IDC_WNDPROP_GENERAL_RECT_BTN, BN_CLICKED)) { 158 | HWND hWnd = AW_GetWndPropHWnd(hDlg); 159 | RECT rc; 160 | if (UI_GetRelativeRect(hWnd, NULL, &rc) && Dlg_RectEditor(hDlg, DB_lpszDRE, &rc)) { 161 | UI_SetWindowRect(hWnd, &rc); 162 | WndPropGeneralUpdateRectCtl(hDlg); 163 | } 164 | } 165 | } else 166 | return FALSE; 167 | return TRUE; 168 | } -------------------------------------------------------------------------------- /Source/AlleyWind/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by AlleyWind.rc 4 | // 5 | #define IDD_MAIN 101 6 | #define IDI_APP 102 7 | #define IDD_WNDPROP 102 8 | #define IDD_WNDPROP_GENERAL 105 9 | #define IDD_WNDPROP_CLASS 106 10 | #define IDD_WNDPROP_OPERATION 107 11 | #define IDC_CAPTURE 107 12 | #define IDD_WNDPROP_MESSAGE 108 13 | #define IDC_PICK 108 14 | #define IDD_WNDPROP_RESOURCE 109 15 | #define IDD_FINDWND 110 16 | #define IDR_MENU 110 17 | #define IDD_WNDPROP_RELATIONSHIP 111 18 | #define IDR_MAIN 111 19 | #define IDC_MAINBANNER 1001 20 | #define IDC_MAINTREE 1002 21 | #define IDC_WNDPROPTAB 1003 22 | #define IDC_WNDPROP_GENERAL_CAPTION_EDIT 1008 23 | #define IDC_WNDPROP_GENERAL_CAPTION_TEXT 1009 24 | #define IDC_WNDPROP_GENERAL_HANDLE_TEXT 1010 25 | #define IDC_WNDPROP_GENERAL_HANDLE_EDIT 1011 26 | #define IDC_WNDPROP_GENERAL_CHARSET_TEXT 1012 27 | #define IDC_WNDPROP_GENERAL_PROCESS_TEXT 1012 28 | #define IDC_WNDPROP_GENERAL_CHARSET_EDIT 1013 29 | #define IDC_WNDPROP_GENERAL_PROCESS_EDIT 1013 30 | #define IDC_WNDPROP_RELATIONSHIP_PROCESS_EDIT 1013 31 | #define IDC_WNDPROP_GENERAL_CTRLID_TEXT 1014 32 | #define IDC_WNDPROP_RELATIONSHIP_THREAD_EDIT 1014 33 | #define IDC_WNDPROP_GENERAL_CTRLID_EDIT 1015 34 | #define IDC_WNDPROP_GENERAL_CTRLTYPE_TEXT 1016 35 | #define IDC_WNDPROP_GENERAL_SYSCLS_TEXT 1016 36 | #define IDC_WNDPROP_GENERAL_GENERAL_CTRLTYPE_EDIT 1017 37 | #define IDC_WNDPROP_GENERAL_CTRLTYPE_EDIT 1017 38 | #define IDC_WNDPROP_GENERAL_SYSCLSTYPE_TEXT 1017 39 | #define IDC_WNDPROP_GENERAL_SYSCLS_EDIT 1017 40 | #define IDC_WNDPROP_GENERAL_STYLE_TEXT 1018 41 | #define IDC_WNDPROP_GENERAL_STYLE_EDIT 1019 42 | #define IDC_WNDPROP_GENERAL_EXSTYLE_TEXT 1020 43 | #define IDC_WNDPROP_GENERAL_EXSTYLE_EDIT 1021 44 | #define IDC_WNDPROP_GENERAL_HINSTANCE_TEXT 1022 45 | #define IDC_WNDPROP_RESOURCE_HINSTANCE_TEXT 1022 46 | #define IDC_WNDPROP_GENERAL_HINSTANCE_EDIT 1023 47 | #define IDC_WNDPROP_RESOURCE_HINSTANCE_EDIT 1023 48 | #define IDC_WNDPROP_GENERAL_WNDPROC_TEXT 1024 49 | #define IDC_WNDPROP_RESOURCE_WNDPROC_TEXT 1024 50 | #define IDC_WNDPROP_GENERAL_WNDPROC_EDIT 1025 51 | #define IDC_WNDPROP_RESOURCE_WNDPROC_EDIT 1025 52 | #define IDC_WNDPROP_GENERAL_HFONT_TEXT 1026 53 | #define IDC_WNDPROP_RESOURCE_HFONT_TEXT 1026 54 | #define IDC_WNDPROP_GENERAL_HFONT_EDIT 1027 55 | #define IDC_WNDPROP_RESOURCE_HFONT_EDIT 1027 56 | #define IDC_WNDPROP_GENERAL_HMENU_TEXT 1028 57 | #define IDC_WNDPROP_RESOURCE_HMENU_TEXT 1028 58 | #define IDC_WNDPROP_GENERAL_HMENU_EDIT 1029 59 | #define IDC_WNDPROP_RESOURCE_HMENU_EDIT 1029 60 | #define IDC_WNDPROP_GENERAL_ICON_TEXT 1030 61 | #define IDC_WNDPROP_RESOURCE_ICON_TEXT 1030 62 | #define IDC_WNDPROP_GENERAL_ICON_EDIT 1031 63 | #define IDC_WNDPROP_RESOURCE_ICON_EDIT 1031 64 | #define IDC_WNDPROP_HOTKEY_TEXT 1032 65 | #define IDC_WNDPROP_GENERAL_HOTKEY_TEXT 1032 66 | #define IDC_WNDPROP_RESOURCE_HOTKEY_TEXT 1032 67 | #define IDC_WNDPROP_GENERAL_HOTKEY_EDIT 1033 68 | #define IDC_WNDPROP_RESOURCE_HOTKEY_EDIT 1033 69 | #define IDC_WNDPROP_GENERAL_RECT_TEXT 1034 70 | #define IDC_WNDPROP_RESOURCE_IMAGE_TEXT 1034 71 | #define IDC_WNDPROP_GENERAL_RECT_EDIT 1035 72 | #define IDC_WNDPROP_RESOURCE_IMAGE_EDIT 1035 73 | #define IDC_WNDPROP_GENERAL_RESTOREDRECT_TEXT 1036 74 | #define IDC_WNDPROP_GENERAL_RESTOREDRECT_EDIT 1037 75 | #define IDC_WNDPROP_GENERAL_USERDATA_TEXT 1038 76 | #define IDC_WNDPROP_GENERAL_USERDATA_EDIT 1039 77 | #define IDC_WNDPROP_GENERAL_WNDBYTE_LIST 1040 78 | #define IDC_WNDPROP_GENERAL_WNDBYTE_TEXT 1041 79 | #define IDC_WNDPROP_GENERAL_TRANSPARENCY_TEXT 1042 80 | #define IDC_WNDPROP_GENERAL_TRANSPARENCY_EDIT 1044 81 | #define IDC_WNDPROP_OPERATION_TRANSPARENCY_EDIT 1044 82 | #define IDC_WNDPROP_OPERATION_OPACITY_SLIDER 1044 83 | #define IDC_WNDPROP_OPERATION_LAYERED_CHECK 1045 84 | #define IDC_WNDPROP_OPERATION_TRANSPARENCY_TEXT 1046 85 | #define IDC_WNDPROP_OPERATION_ANTICAPTURE_CHECK 1046 86 | #define IDC_WNDPROP_OPERATION_TRANSPARENCY_EDIT2 1047 87 | #define IDC_WNDPROP_OPERATION_COLORKEY_TEXT 1047 88 | #define IDC_WNDPROP_OPERATION_TRANSPARENCY_TEXT2 1048 89 | #define IDC_WNDPROP_OPERATION_TRANSPARETCOLOR_PIC 1049 90 | #define IDC_WNDPROP_OPERATION_COLORKEY_CHECK 1050 91 | #define IDC_WNDPROP_OPERATION_OPACITY_CHECK 1051 92 | #define IDC_WNDPROP_RESOURCE_PROP_LIST 1052 93 | #define IDC_WNDPROP_RESOURCE_PROP_TEXT 1053 94 | #define IDC_WNDPROP_RESOURCE_HFONT_BTN 1054 95 | #define IDC_WNDPROP_CLASS_NAME_TEXT 1055 96 | #define IDC_WNDPROP_RESOURCE_HFONT_BTN2 1055 97 | #define IDC_WNDPROP_RESOURCE_IMAGE_BTN 1055 98 | #define IDC_WNDPROP_GENERAL_EXSTYLE_BTN 1055 99 | #define IDC_WNDPROP_CLASS_NAME_EDIT 1056 100 | #define IDC_WNDPROP_RESOURCE_HFONT_BTN3 1056 101 | #define IDC_WNDPROP_RESOURCE_HMENU_BTN 1056 102 | #define IDC_WNDPROP_GENERAL_RECT_BTN 1056 103 | #define IDC_WNDPROP_CLASS_ATOM_EDIT 1057 104 | #define IDC_WNDPROP_CLASS_HINST_TEXT 1058 105 | #define IDC_WNDPROP_CLASS_HINST_EDIT 1059 106 | #define IDC_WNDPROP_CLASS_WNDPROC_EDIT 1060 107 | #define IDC_WNDPROP_CLASS_WNDPROC_TEXT 1061 108 | #define IDC_WNDPROP_CLASS_STYLE_TEXT 1062 109 | #define IDC_WNDPROP_CLASS_STYLE_EDIT 1063 110 | #define IDC_WNDPROP_CLASS_MENURES_TEXT 1064 111 | #define IDC_WNDPROP_CLASS_MENURES_EDIT 1065 112 | #define IDC_WNDPROP_CLASS_HICON_TEXT 1066 113 | #define IDC_WNDPROP_CLASS_HICON_EDIT 1067 114 | #define IDC_WNDPROP_CLASS_HICONSM_TEXT 1068 115 | #define IDC_WNDPROP_CLASS_HICONSM_EDIT 1069 116 | #define IDC_WNDPROP_CLASS_HCURSOR_TEXT 1070 117 | #define IDC_WNDPROP_CLASS_HCURSOR_EDIT 1071 118 | #define IDC_WNDPROP_CLASS_HBRBKGD_TEXT 1072 119 | #define IDC_WNDPROP_CLASS_HBRBKGD_EDIT 1073 120 | #define IDC_WNDPROP_CLASS_CLSBYTE_TEXT 1074 121 | #define IDC_WNDPROP_CLASS_CLSBYTE_LIST 1075 122 | #define IDC_FINDWND_CAPTION_TEXT 1076 123 | #define IDC_FINDWND_CAPTION_CHECK 1076 124 | #define IDC_FINDWND_CAPTION_EDIT 1077 125 | #define IDC_FINDWND_CLASS_TEXT 1078 126 | #define IDC_FINDWND_CLASS_CHECK 1078 127 | #define IDC_FINDWND_CLASS_EDIT 1079 128 | #define IDC_FINDWND_HANDLE_TEXT 1080 129 | #define IDC_FINDWND_HANDLE_CHECK 1080 130 | #define IDC_FINDWND_HANDLE_EDIT 1081 131 | #define IDC_FINDWND_THOROUGHSEARCH_CHECK 1082 132 | #define IDC_FINDWND_IGNORECHILD_CHECK 1082 133 | #define IDC_FINDWND_RECT_TEXT 1083 134 | #define IDC_WNDPROP_GENERAL_RECTRELATIVEPOS_CHECK 1083 135 | #define IDC_FINDWND_CLASS_EDIT2 1084 136 | #define IDC_FINDWND_RECT_EDIT 1084 137 | #define IDC_WNDPROP_OPERATION_ENABLED_CHECK 1084 138 | #define IDC_FINDWND_CAPTURE_TEXT 1085 139 | #define IDC_WNDPROP_OPERATION_VISIBLE_CHECK 1085 140 | #define IDC_WNDPROP_OPERATION_TOPMOST_CHECK 1086 141 | #define IDC_FINDWND_IGNORETRANSPARENT_CHECK 1086 142 | #define IDC_WNDPROP_OPERATION_SWITCHTO_BTN 1087 143 | #define IDC_FINDWND_IGNORE_TEXT 1087 144 | #define IDC_FINDWND_OK_BTN 1088 145 | #define IDC_WNDPROP_OPERATION_REDRAW_BTN 1088 146 | #define IDC_WNDPROP_GENERAL_PROCESS_BTN 1089 147 | #define IDC_WNDPROP_OPERATION_CLOSE_BTN 1089 148 | #define IDC_FINDWND_CAPTURE_PIC 1089 149 | #define IDC_WNDPROP_RELATIONSHIP_PROCESS_BTN 1089 150 | #define IDC_WNDPROP_OPERATION_CAPTURE_PIC 1090 151 | #define IDC_WNDPROP_OPERATION_PICK_PIC 1090 152 | #define IDC_WNDPROP_OPERATION_DESTORY_BTN 1091 153 | #define IDC_WNDPROP_OPERATION_ENDTASK_BTN 1091 154 | #define IDC_WNDPROP_OPERATION_SWITCHTO_BTN2 1092 155 | #define IDC_WNDPROP_OPERATION_VISUALSTYLE_BTN 1092 156 | #define IDC_WNDPROP_RELATIONSHIP_PROCESS_TEXT 1093 157 | #define IDC_WNDPROP_OPERATION_HIGHLIGHT_BTN 1093 158 | #define IDC_WNDPROP_RELATIONSHIP_WINDOW_TEXT 1094 159 | #define IDC_WNDPROP_RELATIONSHIP_WINDOW_LIST 1095 160 | #define IDC_WNDPROP_OPERATION_QUICKSTYLE_GROUP 1096 161 | #define IDC_WNDPROP_RELATIONSHIP_THREAD_TEXT 1096 162 | #define IDC_WNDPROP_OPERATION_LAYERED_GROUP 1097 163 | #define IDC_WNDPROP_GENERAL_STYLE_BTN 1097 164 | #define IDC_WNDPROP_OPERATION_OTHERS_GROUP 1098 165 | #define IDC_WNDPROP_CLASS_STYLE_BTN 1098 166 | #define IDC_WNDPROP_OPERATION_DISPLAY_GROUP 1098 167 | #define IDC_WNDPROP_OPERATION_VISUALSTYLE_GROUP 1099 168 | #define IDC_WNDPROP_OPERATION_VISUALSTYLE_COMBOX 1100 169 | #define IDC_WNDPROP_OPERATION_VISUALSTYLE_TEXT 1101 170 | #define IDC_WNDPROP_OPERATION_FILL_TEXT 1102 171 | #define IDC_WNDPROP_OPERATION_COLORKEY_BTN 1103 172 | #define IDC_WNDPROP_OPERATION_FILL_BTN 1104 173 | #define IDC_WNDPROP_MSG_MSG_TEXT 1104 174 | #define IDC_WNDPROP_MSG_MSG_COMBOX 1105 175 | #define IDC_WNDPROP_MSG_METHOD_TEXT 1106 176 | #define IDC_WNDPROP_MSG_METHOD_COMBOX 1107 177 | #define IDC_WNDPROP_MSG_SEND_BTN 1108 178 | #define IDC_WNDPROP_MSG_TIMEOUT_TEXT 1109 179 | #define IDC_WNDPROP_MSG_WPARAM_TYPE_COMBOX 1110 180 | #define IDC_WNDPROP_MSG_RESULT_TEXT 1111 181 | #define IDC_WNDPROP_MSG_WPARAM_VALUE_COMBOX 1112 182 | #define IDC_WNDPROP_MSG_LPARAM_TYPE_COMBOX 1113 183 | #define IDC_EDIT1 1114 184 | #define IDC_WNDPROP_MSG_LPARAM_VALUE_COMBOX 1115 185 | #define IDC_WNDPROP_MSG_TIMEOUT_COMBOX 1117 186 | #define IDC_WNDPROP_MSG_MSDN_LINK 1118 187 | #define IDC_WNDPROP_MSG_ATTACH_CHECK 1119 188 | #define IDM_FINDWND 40001 189 | #define IDM_RELOAD 40004 190 | #define IDM_EXPWNDTREE 40006 191 | #define IDM_SAVETREE 40006 192 | 193 | // Next default values for new objects 194 | // 195 | #ifdef APSTUDIO_INVOKED 196 | #ifndef APSTUDIO_READONLY_SYMBOLS 197 | #define _APS_NEXT_RESOURCE_VALUE 112 198 | #define _APS_NEXT_COMMAND_VALUE 40008 199 | #define _APS_NEXT_CONTROL_VALUE 1120 200 | #define _APS_NEXT_SYMED_VALUE 101 201 | #endif 202 | #endif 203 | -------------------------------------------------------------------------------- /Source/AlleyWind/AlleyWind.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {975a445d-9333-401b-868e-6283c7b464d0} 25 | AlleyWind 26 | $(LatestTargetPlatformVersion) 27 | 28 | 29 | 30 | true 31 | Unicode 32 | 33 | 34 | false 35 | true 36 | Unicode 37 | 38 | 39 | true 40 | Unicode 41 | 42 | 43 | false 44 | true 45 | Unicode 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | $(ProjectDir)3rdParty\include;$(IncludePath) 67 | $(PlatformTarget)\$(Configuration)\ 68 | $(SolutionDir)$(PlatformTarget)\$(Configuration)\ 69 | $(ProjectDir)3rdParty\lib;$(LibraryPath) 70 | 71 | 72 | $(ProjectDir)3rdParty\include;$(IncludePath) 73 | $(PlatformTarget)\$(Configuration)\ 74 | $(SolutionDir)$(PlatformTarget)\$(Configuration)\ 75 | $(ProjectDir)3rdParty\lib;$(LibraryPath) 76 | 77 | 78 | $(ProjectDir)3rdParty\include;$(IncludePath) 79 | $(ProjectDir)3rdParty\lib;$(LibraryPath) 80 | $(SolutionDir)$(PlatformTarget)\$(Configuration)\ 81 | $(PlatformTarget)\$(Configuration)\ 82 | 83 | 84 | $(ProjectDir)3rdParty\include;$(IncludePath) 85 | $(ProjectDir)3rdParty\lib;$(LibraryPath) 86 | $(SolutionDir)$(PlatformTarget)\$(Configuration)\ 87 | $(PlatformTarget)\$(Configuration)\ 88 | 89 | 90 | 91 | Level3 92 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 93 | true 94 | MultiThreadedDebug 95 | 96 | 97 | Console 98 | 99 | 100 | PerMonitorHighDPIAware 101 | 102 | 103 | 104 | 105 | 106 | 107 | 3rdParty\bin\Precomp4C\Precomp4C.exe $(ProjectDir) 108 | 109 | 110 | 111 | 112 | Level3 113 | true 114 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 115 | MultiThreaded 116 | true 117 | Guard 118 | 119 | 120 | Windows 121 | true 122 | true 123 | 124 | 125 | PerMonitorHighDPIAware 126 | 127 | 128 | 129 | 130 | 131 | 132 | 3rdParty\bin\Precomp4C\Precomp4C.exe $(ProjectDir) 133 | 134 | 135 | 136 | 137 | Level3 138 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 139 | true 140 | MultiThreadedDebug 141 | 142 | 143 | Console 144 | 145 | 146 | PerMonitorHighDPIAware 147 | 148 | 149 | 150 | 151 | 152 | 153 | 3rdParty\bin\Precomp4C\Precomp4C.exe $(ProjectDir) 154 | 155 | 156 | 157 | 158 | Level3 159 | true 160 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 161 | MultiThreaded 162 | true 163 | Guard 164 | 165 | 166 | Windows 167 | true 168 | true 169 | 170 | 171 | PerMonitorHighDPIAware 172 | 173 | 174 | 175 | 176 | 177 | 178 | 3rdParty\bin\Precomp4C\Precomp4C.exe $(ProjectDir) 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | -------------------------------------------------------------------------------- /Source/AlleyWind/3rdParty/include/NTAssassin/NTADef.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #pragma comment(lib, "ntdll.lib") 4 | 5 | // NTAssassin 6 | #include "NTAMacro.h" 7 | #include "NTAConst.h" 8 | #include "NTATypes.h" 9 | 10 | // Conflicts with NTAssassin 11 | #define _LDR_DATA_TABLE_ENTRY _MS_LDR_DATA_TABLE_ENTRY 12 | #define LDR_DATA_TABLE_ENTRY MS_LDR_DATA_TABLE_ENTRY 13 | #define PLDR_DATA_TABLE_ENTRY PMS_LDR_DATA_TABLE_ENTRY 14 | #define _PEB_LDR_DATA _MS_PEB_LDR_DATA 15 | #define PEB_LDR_DATA MS_PEB_LDR_DATA 16 | #define PPEB_LDR_DATA PMS_PEB_LDR_DATA 17 | #define _PEB _MS_PEB 18 | #define PEB MS_PEB 19 | #define PPEB PMS_PEB 20 | #define _TEB _MS_TEB 21 | #define TEB MS_TEB 22 | #define PTEB PMS_TEB 23 | #define _RTL_USER_PROCESS_PARAMETERS _MS_RTL_USER_PROCESS_PARAMETERS 24 | #define RTL_USER_PROCESS_PARAMETERS MS_RTL_USER_PROCESS_PARAMETERS 25 | #define PRTL_USER_PROCESS_PARAMETERS PMS_RTL_USER_PROCESS_PARAMETERS 26 | #define _CLIENT_ID _MS_CLIENT_ID 27 | #define CLIENT_ID MS_CLIENT_ID 28 | #define _FILE_INFORMATION_CLASS _MS_FILE_INFORMATION_CLASS 29 | #define FILE_INFORMATION_CLASS MS_FILE_INFORMATION_CLASS 30 | #define PFILE_INFORMATION_CLASS PMS_FILE_INFORMATION_CLASS 31 | #define FileDirectoryInformation MS_FileDirectoryInformation 32 | #define _PROCESSINFOCLASS _MS_PROCESSINFOCLASS 33 | #define PROCESSINFOCLASS MS_PROCESSINFOCLASS 34 | #define ProcessBasicInformation MS_ProcessBasicInformation 35 | #define ProcessDebugPort MS_ProcessDebugPort 36 | #define ProcessWow64Information MS_ProcessWow64Information 37 | #define ProcessImageFileName MS_ProcessImageFileName 38 | #define ProcessBreakOnTermination MS_ProcessBreakOnTermination 39 | #define _PROCESS_BASIC_INFORMATION _MS_PROCESS_BASIC_INFORMATION 40 | #define PROCESS_BASIC_INFORMATION MS_PROCESS_BASIC_INFORMATION 41 | #define PPROCESS_BASIC_INFORMATION PMS_PROCESS_BASIC_INFORMATION 42 | #define _THREADINFOCLASS _MS_THREADINFOCLASS 43 | #define THREADINFOCLASS MS_THREADINFOCLASS 44 | #define ThreadIsIoPending MS_ThreadIsIoPending 45 | #define _SYSTEM_INFORMATION_CLASS _MS_SYSTEM_INFORMATION_CLASS 46 | #define SYSTEM_INFORMATION_CLASS MS_SYSTEM_INFORMATION_CLASS 47 | #define _SYSTEM_PROCESS_INFORMATION _MS_SYSTEM_PROCESS_INFORMATION 48 | #define SYSTEM_PROCESS_INFORMATION MS_SYSTEM_PROCESS_INFORMATION 49 | #define PSYSTEM_PROCESS_INFORMATION PMS_SYSTEM_PROCESS_INFORMATION 50 | #define _SYSTEM_THREAD_INFORMATION _MS_SYSTEM_THREAD_INFORMATION 51 | #define SYSTEM_THREAD_INFORMATION MS_SYSTEM_THREAD_INFORMATION 52 | #define PSYSTEM_THREAD_INFORMATION PMS_SYSTEM_THREAD_INFORMATION 53 | #define SystemBasicInformation MS_SystemBasicInformation 54 | #define SystemPerformanceInformation MS_SystemPerformanceInformation 55 | #define SystemTimeOfDayInformation MS_SystemTimeOfDayInformation 56 | #define SystemProcessInformation MS_SystemProcessInformation 57 | #define SystemProcessorPerformanceInformation MS_SystemProcessorPerformanceInformation 58 | #define SystemInterruptInformation MS_SystemInterruptInformation 59 | #define SystemExceptionInformation MS_SystemExceptionInformation 60 | #define SystemRegistryQuotaInformation MS_SystemRegistryQuotaInformation 61 | #define SystemLookasideInformation MS_SystemLookasideInformation 62 | #define SystemCodeIntegrityInformation MS_SystemCodeIntegrityInformation 63 | #define SystemPolicyInformation MS_SystemPolicyInformation 64 | #define _OBJECT_INFORMATION_CLASS _MS_OBJECT_INFORMATION_CLASS 65 | #define OBJECT_INFORMATION_CLASS MS_OBJECT_INFORMATION_CLASS 66 | #define ObjectBasicInformation MS_ObjectBasicInformation 67 | #define ObjectTypeInformation MS_ObjectTypeInformation 68 | #define PSID MS_PSID 69 | #define _WINSTATIONINFOCLASS _MS_WINSTATIONINFOCLASS 70 | #define WINSTATIONINFOCLASS MS_WINSTATIONINFOCLASS 71 | #define WinStationInformation MS_WinStationInformation 72 | 73 | #define OEMRESOURCE 74 | #define STRICT_TYPED_ITEMIDS 75 | #define WIN32_NO_STATUS 76 | #define _WINSOCKAPI_ 77 | #include 78 | #include 79 | #include 80 | #include 81 | 82 | // NTSTATUS 83 | #undef WIN32_NO_STATUS 84 | #include 85 | 86 | // Conflicts in ntdef.h 87 | 88 | #undef PROBE_ALIGNMENT 89 | #undef PROBE_ALIGNMENT32 90 | #undef UNICODE_STRING_MAX_BYTES 91 | #undef MAKELANGID 92 | #undef PRIMARYLANGID 93 | #undef SUBLANGID 94 | #undef MAKELCID 95 | #undef MAKESORTLCID 96 | #undef LANGIDFROMLCID 97 | #undef SORTIDFROMLCID 98 | #undef SORTVERSIONFROMLCID 99 | #undef MAX_NATURAL_ALIGNMENT 100 | #undef DEFINE_ENUM_FLAG_OPERATORS 101 | 102 | #define _PROCESSOR_NUMBER _MS_PROCESSOR_NUMBER 103 | #define PROCESSOR_NUMBER MS_PROCESSOR_NUMBER 104 | #define PPROCESSOR_NUMBER PMS_PROCESSOR_NUMBER 105 | #define _GROUP_AFFINITY _MS_GROUP_AFFINITY 106 | #define GROUP_AFFINITY MS_GROUP_AFFINITY 107 | #define PGROUP_AFFINITY PMS_GROUP_AFFINITY 108 | #define _FLOAT128 _MS_FLOAT128 109 | #define FLOAT128 MS_FLOAT128 110 | #define PFLOAT128 PMS_FLOAT128 111 | #define _ULARGE_INTEGER _MS_ULARGE_INTEGER 112 | #define ULARGE_INTEGER MS_ULARGE_INTEGER 113 | #define PULARGE_INTEGER PMS_ULARGE_INTEGER 114 | #define _LUID _MS_LUID 115 | #define LUID MS_LUID 116 | #define PLUID PMS_LUID 117 | #define _STRING _MS_STRING 118 | #define STRING MS_STRING 119 | #define PSTRING PMS_STRING 120 | #define ANSI_STRING MS_ANSI_STRING 121 | #define PANSI_STRING PMS_ANSI_STRING 122 | #define PCANSI_STRING PCMS_ANSI_STRING 123 | #define OEM_STRING MS_OEM_STRING 124 | #define POEM_STRING PMS_OEM_STRING 125 | #define PCOEM_STRING PCMS_OEM_STRING 126 | #define _LIST_ENTRY _MS_LIST_ENTRY 127 | #define LIST_ENTRY MS_LIST_ENTRY 128 | #define PLIST_ENTRY PMS_LIST_ENTRY 129 | #define PRLIST_ENTRY PRMS_LIST_ENTRY 130 | #define _SINGLE_LIST_ENTRY _MS_SINGLE_LIST_ENTRY 131 | #define SINGLE_LIST_ENTRY MS_SINGLE_LIST_ENTRY 132 | #define PSINGLE_LIST_ENTRY PMS_SINGLE_LIST_ENTRY 133 | #define _LIST_ENTRY32 _MS_LIST_ENTRY32 134 | #define LIST_ENTRY32 MS_LIST_ENTRY32 135 | #define PLIST_ENTRY32 PMS_LIST_ENTRY32 136 | #define _LIST_ENTRY64 _MS_LIST_ENTRY64 137 | #define LIST_ENTRY64 MS_LIST_ENTRY64 138 | #define PLIST_ENTRY64 PMS_LIST_ENTRY64 139 | #if defined(_M_IX86) 140 | #define Int64ShllMod32 MS_Int64ShllMod32 141 | #define Int64ShraMod32 MS_Int64ShraMod32 142 | #define Int64ShrlMod32 MS_Int64ShrlMod32 143 | #endif 144 | #define _ENUM_FLAG_INTEGER_FOR_SIZE _MS_ENUM_FLAG_INTEGER_FOR_SIZE 145 | #define _ENUM_FLAG_SIZED_INTEGER _MS_ENUM_FLAG_SIZED_INTEGER 146 | #define _LARGE_INTEGER _MS_LARGE_INTEGER 147 | #define LARGE_INTEGER MS_LARGE_INTEGER 148 | #define PLARGE_INTEGER PMS_LARGE_INTEGER 149 | #define _UNICODE_STRING _MS_UNICODE_STRING 150 | #define UNICODE_STRING MS_UNICODE_STRING 151 | #define PUNICODE_STRING PMS_UNICODE_STRING 152 | #define PCUNICODE_STRING PCMS_UNICODE_STRING 153 | #define _OBJECT_ATTRIBUTES _MS_OBJECT_ATTRIBUTES 154 | #define OBJECT_ATTRIBUTES MS_OBJECT_ATTRIBUTES 155 | #define POBJECT_ATTRIBUTES PMS_OBJECT_ATTRIBUTES 156 | 157 | #include 158 | 159 | #undef _PROCESSOR_NUMBER 160 | #undef PROCESSOR_NUMBER 161 | #undef PPROCESSOR_NUMBER 162 | #undef _GROUP_AFFINITY 163 | #undef GROUP_AFFINITY 164 | #undef PGROUP_AFFINITY 165 | #undef _FLOAT128 166 | #undef FLOAT128 167 | #undef PFLOAT128 168 | #undef _ULARGE_INTEGER 169 | #undef ULARGE_INTEGER 170 | #undef PULARGE_INTEGER 171 | #undef _LUID 172 | #undef LUID 173 | #undef PLUID 174 | #undef _STRING 175 | #undef STRING 176 | #undef PSTRING 177 | #undef ANSI_STRING 178 | #undef PANSI_STRING 179 | #undef PCANSI_STRING 180 | #undef OEM_STRING 181 | #undef POEM_STRING 182 | #undef PCOEM_STRING 183 | #undef _LIST_ENTRY 184 | #undef LIST_ENTRY 185 | #undef PLIST_ENTRY 186 | #undef PRLIST_ENTRY 187 | #undef _SINGLE_LIST_ENTRY 188 | #undef SINGLE_LIST_ENTRY 189 | #undef PSINGLE_LIST_ENTRY 190 | #undef _LIST_ENTRY32 191 | #undef LIST_ENTRY32 192 | #undef PLIST_ENTRY32 193 | #undef _LIST_ENTRY64 194 | #undef LIST_ENTRY64 195 | #undef PLIST_ENTRY64 196 | #undef _ENUM_FLAG_INTEGER_FOR_SIZE 197 | #undef _ENUM_FLAG_SIZED_INTEGER 198 | #undef _LARGE_INTEGER 199 | #undef LARGE_INTEGER 200 | #undef PLARGE_INTEGER 201 | #undef _UNICODE_STRING 202 | #undef UNICODE_STRING 203 | #undef PUNICODE_STRING 204 | #undef PCUNICODE_STRING 205 | #undef _OBJECT_ATTRIBUTES 206 | #undef OBJECT_ATTRIBUTES 207 | #undef POBJECT_ATTRIBUTES 208 | #undef Int64ShllMod32 209 | #undef Int64ShraMod32 210 | #undef Int64ShrlMod32 211 | 212 | #undef _LDR_DATA_TABLE_ENTRY 213 | #undef LDR_DATA_TABLE_ENTRY 214 | #undef PLDR_DATA_TABLE_ENTRY 215 | #undef _PEB_LDR_DATA 216 | #undef PEB_LDR_DATA 217 | #undef PPEB_LDR_DATA 218 | #undef _PEB 219 | #undef PEB 220 | #undef PPEB 221 | #undef _TEB 222 | #undef TEB 223 | #undef PTEB 224 | #undef _RTL_USER_PROCESS_PARAMETERS 225 | #undef RTL_USER_PROCESS_PARAMETERS 226 | #undef PRTL_USER_PROCESS_PARAMETERS 227 | #undef _CLIENT_ID 228 | #undef CLIENT_ID 229 | #undef _FILE_INFORMATION_CLASS 230 | #undef FILE_INFORMATION_CLASS 231 | #undef PFILE_INFORMATION_CLASS 232 | #undef FileDirectoryInformation 233 | #undef _PROCESSINFOCLASS 234 | #undef PROCESSINFOCLASS 235 | #undef ProcessBasicInformation 236 | #undef ProcessDebugPort 237 | #undef ProcessWow64Information 238 | #undef ProcessImageFileName 239 | #undef ProcessBreakOnTermination 240 | #undef _PROCESS_BASIC_INFORMATION 241 | #undef PROCESS_BASIC_INFORMATION 242 | #undef PPROCESS_BASIC_INFORMATION 243 | #undef _THREADINFOCLASS 244 | #undef THREADINFOCLASS 245 | #undef ThreadIsIoPending 246 | #undef _SYSTEM_INFORMATION_CLASS 247 | #undef SYSTEM_INFORMATION_CLASS 248 | #undef _SYSTEM_PROCESS_INFORMATION 249 | #undef SYSTEM_PROCESS_INFORMATION 250 | #undef PSYSTEM_PROCESS_INFORMATION 251 | #undef _SYSTEM_THREAD_INFORMATION 252 | #undef SYSTEM_THREAD_INFORMATION 253 | #undef PSYSTEM_THREAD_INFORMATION 254 | #undef SystemBasicInformation 255 | #undef SystemPerformanceInformation 256 | #undef SystemTimeOfDayInformation 257 | #undef SystemProcessInformation 258 | #undef SystemProcessorPerformanceInformation 259 | #undef SystemInterruptInformation 260 | #undef SystemExceptionInformation 261 | #undef SystemRegistryQuotaInformation 262 | #undef SystemLookasideInformation 263 | #undef SystemCodeIntegrityInformation 264 | #undef SystemPolicyInformation 265 | #undef _OBJECT_INFORMATION_CLASS 266 | #undef OBJECT_INFORMATION_CLASS 267 | #undef ObjectBasicInformation 268 | #undef ObjectTypeInformation 269 | #undef PSID 270 | #undef _WINSTATIONINFOCLASS 271 | #undef WINSTATIONINFOCLASS 272 | #undef WinStationInformation 273 | 274 | // Windows NT definations 275 | #include "NTConst.h" 276 | #include "NTTypes.h" 277 | #include "NTStruct.h" 278 | #include "NT_R3Shared.h" 279 | #include "NT_MSTSTS.h" 280 | #include "NT_NTDDK.h" 281 | #include "NTAPI.h" 282 | #include "NTObject.h" 283 | 284 | #define PRTL_CONSTANT_UNICODE_STRING(s) ((&(UNICODE_STRING)RTL_CONSTANT_STRING(L##s))) 285 | #define PRTL_CONSTANT_ANSI_STRING(s) ((&(ANSI_STRING)RTL_CONSTANT_STRING(s))) 286 | #ifdef UNICODE 287 | #define PRTL_CONSTANT_STRING PRTL_CONSTANT_UNICODE_STRING 288 | #else 289 | #define PRTL_CONSTANT_STRING PRTL_CONSTANT_ANSI_STRING 290 | #endif 291 | 292 | #define ANYSIZE_STRUCT_SIZE(structure, field, size) UFIELD_OFFSET(structure, field[size]) 293 | 294 | #include "NTAOptions.h" 295 | --------------------------------------------------------------------------------