Skip to content

Commit

Permalink
New release, update NTAssassin, improve project configurations and im…
Browse files Browse the repository at this point in the history
…age saving feature to support more image formats
  • Loading branch information
RatinCN committed Dec 24, 2022
1 parent 3a7a302 commit e64fcf2
Show file tree
Hide file tree
Showing 69 changed files with 820 additions and 591 deletions.
2 changes: 1 addition & 1 deletion Publish.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RD /S /Q "%~dp0Release"
MD "%~dp0Release"
COPY /Y "%~dp0Source\Win32\Release\AlleyWind.exe" "%~dp0Release\AlleyWind_x86.exe"
COPY /Y "%~dp0Source\x86\Release\AlleyWind.exe" "%~dp0Release\AlleyWind_x86.exe"
COPY /Y "%~dp0Source\x64\Release\AlleyWind.exe" "%~dp0Release\AlleyWind_x64.exe"
PAUSE
73 changes: 73 additions & 0 deletions Source/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Visual Studio generated .editorconfig file with C++ settings.
root = true

[*.{c,c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]

charset = utf-8-bom
end_of_line = crlf
insert_final_newline = true

# Visual C++ Code Style settings

cpp_generate_documentation_comments = xml

# Visual C++ Formatting settings

cpp_indent_braces = false
cpp_indent_multi_line_relative_to = innermost_parenthesis
cpp_indent_within_parentheses = align_to_parenthesis
cpp_indent_preserve_within_parentheses = true
cpp_indent_case_contents = true
cpp_indent_case_labels = true
cpp_indent_case_contents_when_block = false
cpp_indent_lambda_braces_when_parameter = true
cpp_indent_goto_labels = one_left
cpp_indent_preprocessor = none
cpp_indent_access_specifiers = false
cpp_indent_namespace_contents = true
cpp_indent_preserve_comments = true
cpp_new_line_before_open_brace_namespace = same_line
cpp_new_line_before_open_brace_type = same_line
cpp_new_line_before_open_brace_function = new_line
cpp_new_line_before_open_brace_block = same_line
cpp_new_line_before_open_brace_lambda = same_line
cpp_new_line_scope_braces_on_separate_lines = true
cpp_new_line_close_brace_same_line_empty_type = true
cpp_new_line_close_brace_same_line_empty_function = true
cpp_new_line_before_catch = false
cpp_new_line_before_else = false
cpp_new_line_before_while_in_do_while = false
cpp_space_before_function_open_parenthesis = remove
cpp_space_within_parameter_list_parentheses = false
cpp_space_between_empty_parameter_list_parentheses = false
cpp_space_after_keywords_in_control_flow_statements = true
cpp_space_within_control_flow_statement_parentheses = false
cpp_space_before_lambda_open_parenthesis = false
cpp_space_within_cast_parentheses = false
cpp_space_after_cast_close_parenthesis = false
cpp_space_within_expression_parentheses = false
cpp_space_before_block_open_brace = true
cpp_space_between_empty_braces = false
cpp_space_before_initializer_list_open_brace = false
cpp_space_within_initializer_list_braces = true
cpp_space_preserve_in_initializer_list = true
cpp_space_before_open_square_bracket = false
cpp_space_within_square_brackets = false
cpp_space_before_empty_square_brackets = false
cpp_space_between_empty_square_brackets = false
cpp_space_group_square_brackets = true
cpp_space_within_lambda_brackets = false
cpp_space_between_empty_lambda_brackets = false
cpp_space_before_comma = false
cpp_space_after_comma = true
cpp_space_remove_around_member_operators = true
cpp_space_before_inheritance_colon = true
cpp_space_before_constructor_colon = true
cpp_space_remove_before_semicolon = true
cpp_space_after_semicolon = true
cpp_space_remove_around_unary_operator = true
cpp_space_around_binary_operator = insert
cpp_space_around_assignment_operator = insert
cpp_space_pointer_reference_alignment = ignore
cpp_space_around_ternary_operator = insert
cpp_wrap_preserve_blocks = never
4 changes: 2 additions & 2 deletions Source/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.vs
/Win32
/x86
/x64
/AlleyWind/Win32
/AlleyWind/x86
/AlleyWind/x64
*.vcxproj.user
*.aps
Expand Down
8 changes: 4 additions & 4 deletions Source/AlleyWind/3rdParty/include/NTAssassin/NTACon.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ NTA_API DWORD NTAPI Con_Write(HANDLE ConHandle, _In_reads_bytes_opt_(Length) PVO
/// <param name="ConHandle">Handle to the console</param>
/// <param name="String">String to output</param>
/// <returns>Number of bytes actually written, or 0 if failed, error code storaged in last STATUS</returns>
NTA_API DWORD Con_WriteString(HANDLE ConHandle, _In_z_ PCSTR String);
NTA_API DWORD NTAPI Con_WriteString(HANDLE ConHandle, _In_z_ PCSTR String);

/// <summary>
/// Output string to console and starts a new line
/// </summary>
/// <seealso cref="Con_WriteString"/>
NTA_API DWORD Con_WriteLine(HANDLE ConHandle, _In_z_ PCSTR String);
NTA_API DWORD NTAPI Con_WriteLine(HANDLE ConHandle, _In_z_ PCSTR String);

/// <summary>
/// Prints formatted output to the console
/// <see>Con_Printf</see>
/// </summary>
/// <seealso cref="Con_Printf"/>
NTA_API DWORD Con_VPrintf(HANDLE ConHandle, _In_z_ _Printf_format_string_ PCSTR Format, _In_ va_list ArgList);
NTA_API DWORD NTAPI Con_VPrintf(HANDLE ConHandle, _In_z_ _Printf_format_string_ PCSTR Format, _In_ va_list ArgList);

/// <summary>
/// Prints formatted output to the console
Expand All @@ -56,4 +56,4 @@ NTA_API DWORD WINAPIV Con_Printf(HANDLE ConHandle, _In_z_ _Printf_format_string_
/// Prints formatted output to the console and starts a new line
/// </summary>
/// <seealso cref="Con_Printf"/>
NTA_API DWORD WINAPIV Con_PrintfLine(HANDLE ConHandle, _In_z_ _Printf_format_string_ PCSTR Format, ...);
NTA_API DWORD WINAPIV Con_PrintfLine(HANDLE ConHandle, _In_z_ _Printf_format_string_ PCSTR Format, ...);
3 changes: 1 addition & 2 deletions Source/AlleyWind/3rdParty/include/NTAssassin/NTAConst.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#define CODE_ALIGNMENT 0x10
#define STRING_ALIGNMENT 0x4

#define ASCII_CASE_MASK 0b100000
#define MAX_WORD_IN_DEC_CCH 6 // Max WORD in decimal is 65535
#define MAX_QWORD_IN_HEX_CCH 17
#define MAX_CLASSNAME_CCH 256
Expand All @@ -19,8 +20,6 @@
#define CURRENT_PROCESS_TOKEN_HANDLE ((HANDLE)-4)
#define CURRENT_THREAD_TOKEN_HANDLE ((HANDLE)-5)
#define CURRENT_THREAD_EFFECTIVETOKEN_HANDLE ((HANDLE)-6)
#define CURRENT_PROCESS_ID (NT_GetTEBMemberDWORD(ClientId.UniqueProcess))
#define CURRENT_THREAD_ID (NT_GetTEBMemberDWORD(ClientId.UniqueThread))
#define FIXED_IMAGE_BASE32 ((HINSTANCE)0x00400000)
#define FIXED_IMAGE_BASE64 ((HINSTANCE)0x0000000140000000)

Expand Down
5 changes: 3 additions & 2 deletions Source/AlleyWind/3rdParty/include/NTAssassin/NTACtl.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once

#include "NTADef.h"

#include "NTACtl_ColorPicker.h"

typedef struct _CTL_MENU CTL_MENU, * PCTL_MENU;
typedef struct _CTL_MENU CTL_MENU, *PCTL_MENU;
struct _CTL_MENU {
UINT Flags;
UINT_PTR ID;
Expand Down Expand Up @@ -35,7 +36,7 @@ typedef struct _CTL_LISTCTL_COLUME {
PCWSTR Title;
};
INT Width;
} CTL_LISTCTL_COLUME, * PCTL_LISTCTL_COLUME;
} CTL_LISTCTL_COLUME, *PCTL_LISTCTL_COLUME;

typedef struct _CTL_COMBOBOXCTL_ITEM {
union {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

#include "NTADef.h"

// No color specified in color picker yet
#define CTL_COLORPICKER_NOCOLOR 0xFF000000

/// <summary>
/// Subclasses a button control to be a RGB color picker
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions Source/AlleyWind/3rdParty/include/NTAssassin/NTAData.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// <param name="GroupCount">Number of groups</param>
/// <param name="Size">Size of single structure in bytes</param>
/// <param name="...">pst1, u1, pst2, u2, ...</param>
/// <returns>New allocated buffer that combined groups of structures input, should be freed by calling "Mem_HeapFree"</returns>
/// <returns>New allocated buffer that combined groups of structures input, should be freed by calling "Mem_Free"</returns>
NTA_API _Check_return_ PVOID WINAPIV Data_StructCombineEx(_In_ UINT GroupCount, _In_ UINT Size, ...);

#define Data_StructCombine(GroupCount, Type, ...) (Type*)Data_StructCombineEx(GroupCount, sizeof(Type), __VA_ARGS__)
#define Data_StructCombine(GroupCount, Type, ...) (Type*)Data_StructCombineEx(GroupCount, sizeof(Type), __VA_ARGS__)
Original file line number Diff line number Diff line change
Expand Up @@ -15,77 +15,76 @@ struct _DATA_LIST_NODE {
typedef struct _DATA_LIST {
PDATA_LIST_NODE First; // Pointer to the first node
PDATA_LIST_NODE Last; // Pointer to the last node
BOOL Lock; // Set to TRUE to implement thread-safe
UINT Length; // Number of nodes the list has
CRITICAL_SECTION Reserved; // Internal lock to implement thread-safe, do not use it
RTL_SRWLOCK Lock; // SRW lock to implement thread-safe, do not use it
} DATA_LIST, *PDATA_LIST;

/// <summary>
/// Initializes DATA_LIST structure
/// </summary>
NTA_API VOID NTAPI Data_ListInit(_Out_ PDATA_LIST DataList);
NTA_API VOID NTAPI Data_ListInit(_Out_ PDATA_LIST List);

/// <summary>
/// Inserts node to the end of list
/// </summary>
/// <param name="DataList">Pointer to the DATA_LIST structure</param>
/// <param name="List">Pointer to the DATA_LIST structure</param>
/// <param name="NodeValue">Node value to the new node to be inserted</param>
/// <returns>TRUE if succeeded, or FALSE if failed</returns>
NTA_API BOOL NTAPI Data_ListPushBack(_In_ PDATA_LIST DataList, PVOID NodeValue);
NTA_API BOOL NTAPI Data_ListPushBack(_In_ PDATA_LIST List, PVOID NodeValue);

/// <summary>
/// Inserts node to the beginning of list
/// </summary>
/// <param name="DataList">Pointer to the DATA_LIST structure</param>
/// <param name="List">Pointer to the DATA_LIST structure</param>
/// <param name="NodeValue">Node value to the new node to be inserted</param>
/// <returns>TRUE if succeeded, or FALSE if failed</returns>
NTA_API BOOL NTAPI Data_ListPushFront(_In_ PDATA_LIST DataList, PVOID NodeValue);
NTA_API BOOL NTAPI Data_ListPushFront(_In_ PDATA_LIST List, PVOID NodeValue);

/// <summary>
/// Removes node in the end of list
/// </summary>
/// <param name="DataList">Pointer to the DATA_LIST structure</param>
/// <param name="List">Pointer to the DATA_LIST structure</param>
/// <param name="NodeValue">Pointer to a buffer to receive node value to be removed</param>
/// <returns>TRUE if succeeded, or FALSE if failed</returns>
_Success_(return != FALSE) NTA_API BOOL NTAPI Data_ListPopBack(_In_ PDATA_LIST DataList, _Out_opt_ PVOID* NodeValue);
_Success_(return != FALSE) NTA_API BOOL NTAPI Data_ListPopBack(_In_ PDATA_LIST List, _Out_opt_ PVOID * NodeValue);

/// <summary>
/// Removes node in the beginning of list
/// </summary>
/// <param name="DataList">Pointer to the DATA_LIST structure</param>
/// <param name="List">Pointer to the DATA_LIST structure</param>
/// <param name="NodeValue">Pointer to a buffer to receive node value to be removed</param>
/// <returns>TRUE if succeeded, or FALSE if failed</returns>
_Success_(return != FALSE) NTA_API BOOL NTAPI Data_ListPopFront(_In_ PDATA_LIST DataList, _Out_opt_ PVOID* NodeValue);
_Success_(return != FALSE) NTA_API BOOL NTAPI Data_ListPopFront(_In_ PDATA_LIST List, _Out_opt_ PVOID * NodeValue);

/// <summary>
/// Inserts node before specified node
/// </summary>
/// <param name="DataList">Pointer to the DATA_LIST structure</param>
/// <param name="List">Pointer to the DATA_LIST structure</param>
/// <param name="RelNode">Pointer to DATA_LIST_NODE structure of the node relative to</param>
/// <param name="NodeValue">Node value to the new node to be inserted</param>
/// <returns>TRUE if succeeded, or FALSE if failed</returns>
NTA_API BOOL NTAPI Data_ListInsertBefore(_In_ PDATA_LIST DataList, _In_ PDATA_LIST_NODE RelNode, PVOID NodeValue);
NTA_API BOOL NTAPI Data_ListInsertBefore(_In_ PDATA_LIST List, _In_ PDATA_LIST_NODE RelNode, PVOID NodeValue);

/// <summary>
/// Inserts node after specified node
/// </summary>
/// <param name="DataList">Pointer to the DATA_LIST structure</param>
/// <param name="List">Pointer to the DATA_LIST structure</param>
/// <param name="RelNode">Pointer to DATA_LIST_NODE structure of the node relative to</param>
/// <param name="NodeValue">Node value to the new node to be inserted</param>
/// <returns>TRUE if succeeded, or FALSE if failed</returns>
NTA_API BOOL NTAPI Data_ListInsertAfter(_In_ PDATA_LIST DataList, _In_ PDATA_LIST_NODE RelNode, PVOID NodeValue);
NTA_API BOOL NTAPI Data_ListInsertAfter(_In_ PDATA_LIST List, _In_ PDATA_LIST_NODE RelNode, PVOID NodeValue);

/// <summary>
/// Removes specified node
/// </summary>
/// <param name="DataList">Pointer to the DATA_LIST structure</param>
/// <param name="List">Pointer to the DATA_LIST structure</param>
/// <param name="Node">Pointer to DATA_LIST_NODE structure of the node to be removed</param>
/// <returns>TRUE if succeeded, or FALSE if failed</returns>
NTA_API BOOL NTAPI Data_ListRemove(_In_ PDATA_LIST DataList, _In_ PDATA_LIST_NODE Node);
NTA_API BOOL NTAPI Data_ListRemove(_In_ PDATA_LIST List, _In_ PDATA_LIST_NODE Node);

/// <summary>
/// Resets list structure
/// </summary>
/// <param name="DataList">Pointer to the DATA_LIST structure</param>
/// <param name="List">Pointer to the DATA_LIST structure</param>
/// <param name="FreeValuePtr">Set to TRUE to frees each memory address in node value by calling <c>Mem_Free</c></param>
NTA_API VOID NTAPI Data_ListReset(_In_ PDATA_LIST DataList, BOOL FreeValuePtr);
NTA_API VOID NTAPI Data_ListReset(_In_ PDATA_LIST List, BOOL FreeValuePtr);
4 changes: 2 additions & 2 deletions Source/AlleyWind/3rdParty/include/NTAssassin/NTADbg.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "NTAssassin.h"
#include "NTADef.h"

#if _DEBUG

#endif
#endif
24 changes: 10 additions & 14 deletions Source/AlleyWind/3rdParty/include/NTAssassin/NTADef.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#pragma once

#pragma comment(lib, "ntdll.lib")

// NTAssassin
#include "NTAMacro.h"
#include "NTAConst.h"
#include "NTATypes.h"

// Windows

// Conflicts with NTAssassin
#define _LDR_DATA_TABLE_ENTRY _MS_LDR_DATA_TABLE_ENTRY
#define LDR_DATA_TABLE_ENTRY MS_LDR_DATA_TABLE_ENTRY
Expand Down Expand Up @@ -76,6 +76,12 @@
#define _WINSOCKAPI_
#include <Windows.h>
#include <Winternl.h>
#include <suppress.h>
#include <CommCtrl.h>

// NTSTATUS
#undef WIN32_NO_STATUS
#include <ntstatus.h>

// Conflicts in ntdef.h

Expand Down Expand Up @@ -203,18 +209,6 @@
#undef Int64ShraMod32
#undef Int64ShrlMod32

#include <WindowsX.h>
#include <CommCtrl.h>
#include <Shlobj.h>
#include <Shlwapi.h>
#include <shellscalingapi.h>
#include <dwmapi.h>
#include <Tpcshrd.h>
#include <wtsapi32.h>
#include <WinSock2.h>
#include <UserEnv.h>
#include <ntsecapi.h>

#undef _LDR_DATA_TABLE_ENTRY
#undef LDR_DATA_TABLE_ENTRY
#undef PLDR_DATA_TABLE_ENTRY
Expand Down Expand Up @@ -296,3 +290,5 @@
#endif

#define ANYSIZE_STRUCT_SIZE(structure, field, size) UFIELD_OFFSET(structure, field[size])

#include "NTAOptions.h"
21 changes: 0 additions & 21 deletions Source/AlleyWind/3rdParty/include/NTAssassin/NTADepends.h

This file was deleted.

Loading

0 comments on commit e64fcf2

Please sign in to comment.