Skip to content

Instantly share code, notes, and snippets.

View DeviousMalcontent's full-sized avatar
💭
apply hot fix and lie.

Mark DeviousMalcontent

💭
apply hot fix and lie.
View GitHub Profile
echo "<!DOCTYPE html><html><head><style>table {font-family: arial, sans-serif;border-collapse: collapse;}td, th {border: 1px solid #00000;text-align: left;padding: 8px;}</style></head><body><table>" | Out-File htmlcolors.html -Append
for($i=0; $i -le 16777215; $i++){
$result = if ($i -le 8388607) {$textColour="FFFFFF"} else {$textColour="000000"}
$HTMLColour = ('{0:X6}' -f $i)
echo "<tr><td style='background-color:#$HTMLColour; color:#$textColour;'>#$HTMLColour</td></tr>" | Out-File htmlcolors.html -Append
}
echo "</table></body></html>" | Out-File htmlcolors.html -Append
@DeviousMalcontent
DeviousMalcontent / ASCIICodeChart.ps1
Last active December 31, 2022 03:40
A PowerShell One-liner, to print an ASCII Code chart in the console.
#PowerShell One-liner, print ASCII Code chart:
$ExcludedChars = 0,7,8,9,10,13,27,155; for($i=0; $i -le 255; $i++){Write-Host "Char:" $(if ($ExcludedChars -contains $i) {([char]32)} else {([char]$i)})"Dec:"$i" Hex:"('{0:X}' -f $i)"Bin:"([convert]::ToString($i,2))}
@DeviousMalcontent
DeviousMalcontent / win32-GetSystemDPI-Console.asm
Last active February 28, 2021 05:47
Simple Console app to Get System DPI for future dpiAware apps on Windows 6 (Vista) onwards, the plan is to next build a template win32 GUI app and to test the UI scaling on my 2k monitor...
; #########################################################################
;
; Program: win32-GetSystemDPI-Console
; Purpose: Simple Console app to Get System DPI for future dpiAware apps on Windows 6 (Vista) onwards
; Author: Mark Albanese
; Date: 28 February 2021
; Version: 1.0
; Release: 1
; Language: x86 Assembly / Microsoft Macro Assembler
; Compiler: MASM32 SDK
@DeviousMalcontent
DeviousMalcontent / makeit-cl.bat
Created February 28, 2021 05:43
The build script that I have now started to use to build my Win32 C++ based projects; trying to remove the requirement for Visual Studio and just use the Build Tools, in the past I have had issues trying to compile older projects with newer versions and a lot of fucking around finding the SDKs, and the bloat. One thing to note, you will need to …
@ECHO off
SET projectpath=%CD:~0,-6%
if exist "MyProject.obj" del "MyProject.obj"
if exist "MyProject.exe" del "MyProject.exe"
REM Find MSVC Compiler install path.
REM Using MSVC 2019 Community
IF EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" (
@DeviousMalcontent
DeviousMalcontent / makeit-ml.bat
Last active February 28, 2021 05:17
The build script that I use to build my MASM32 based projects that does not require me to build the application on the same hard drive that the SDK is installed to. – I also do not need to specify the include, macros, and lib file paths.
@echo off
Rem Marks trademark super awesome MASM32 build script.
Rem Find MASM32 install path
IF EXIST "A:\masm32\bin\ml.exe" (set masmpath=A:\masm32)
IF EXIST "B:\masm32\bin\ml.exe" (set masmpath=B:\masm32)
IF EXIST "C:\masm32\bin\ml.exe" (set masmpath=C:\masm32)
IF EXIST "D:\masm32\bin\ml.exe" (set masmpath=D:\masm32)
IF EXIST "E:\masm32\bin\ml.exe" (set masmpath=E:\masm32)
IF EXIST "F:\masm32\bin\ml.exe" (set masmpath=F:\masm32)
IF EXIST "G:\masm32\bin\ml.exe" (set masmpath=G:\masm32)