Skip to content

Instantly share code, notes, and snippets.

View DamianSuess's full-sized avatar
👍
Enjoying every day

Damian DamianSuess

👍
Enjoying every day
View GitHub Profile

Tools for Debugging and ReverseE

.NET

  • dnSpyEx - Unofficial revival of the well known .NET debugger and assembly editor, dnSpy
  • CodemerxDecompile - .NET multi-platform decompiler (original makers of JustDecompile)
  • de4dot - .NET deobfuscator and unpacker. (archived 2020)
  • ILSpy - .NET Decompiler with support for PDB generation, ReadyToRun, Metadata - cross-platform!
  • Iced - Blazing fast and correct x86/x64 disassembler, assembler, decoder, encoder for Rust, .NET, Java, Python, Lua
@DamianSuess
DamianSuess / BuildNumberIncrementor.md
Created March 17, 2025 16:05
Build Number Incrementor

Build Incrementor

Build Command

dotnet build MyProject.csproj --configuration Release /p:Version=%1

References

@DamianSuess
DamianSuess / ImageCache.cs
Created January 18, 2025 19:28
ImageCache for .NET MAUI
using Microsoft.Maui.Storage;
using System.Security.Cryptography;
using System.Text;
// Based on: https://github.com/soyfrien/ImageCache
namespace MyProjectNamespace;
/// <summary>
/// Use this class to cache images from the Internet.
/// Its functions receive a URI and turn the resource into an ImageSource, byte array, Stream, or Func‹Stream›.
@DamianSuess
DamianSuess / Avalonia-MultiBinding.axaml
Created August 28, 2024 20:02
Avalonia-MultiBinding
<UserControl.Resources>
<ResourceDictionary>
<DataTemplate x:Key="FlatDeviceInfo" DataType="models:DeviceInfo">
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} - {1}">
<Binding Path="Address" />
<Binding Path="DeviceTypeName" />
</MultiBinding>
</TextBlock.Text>
@DamianSuess
DamianSuess / Laravel-ApiAndWebController.php
Created June 15, 2024 14:12
Laravel 11 - API and Web Sharing Controller
/*
* Example showing how to share an API route with a Web (view)
* If the request expects JSON, it shall receive it. Otherwise, display the View.
* Remember, just because you can, doesn't mean you should.
*/
class ActivityController extends Controller
{
/**
* Display a listing of the resource.
*/
@DamianSuess
DamianSuess / Bash-Readme.md
Last active May 20, 2024 16:05
C# Linux BASH

About C# BASH Sample

The example code here references Docker and IoT Edge as an example. The user/pass is Base64 encoded as part of the Bash class in this example.

By no means should you keep the admin user/pass hard-coded in the production class, this is an example piece.

What's The Difference?

The Bash class has both RunAs(..) and Command(..), and each allows you to run using sudo. The difference is, the RunAs(...) method does not require your app to be started with elevated privledges. Where as, Command(..) requires you to start the app with elevated privledges in order to execute commands using sudo.

@DamianSuess
DamianSuess / VSCode-Linting.md
Last active January 23, 2024 15:02
VSCode Automatic Linting

When developing in medium to larger teams, becomes more important to be able to automatically maintain code styling throughout the project to maintain readability and clarity. This rule also applies to smaller projects as well, abiet at times easier to manage ("New guy, please remove the 5 blank lines in a row in the method. And the blank spaces after the statements.").

Below is a quick snip for configuring VSCode to automagically take care of this every time you press save (Ctrl+S). The following assumes you already have a project workspace already started in VSCode.

TL;DR Configuration

Key files:

  • .vscode/extensions.json
  • .vscode/settings.json
@DamianSuess
DamianSuess / AvaloniaDoubleClickListBox.axml
Last active May 24, 2024 21:10
Avalonia - DoubleTapped Behavior
<UserControl ...>
<!-- Sample 1 - ListBox Data Template - Dobule-Tapped -->
<UserControl.Resources>
<ResourceDictionary>
<DataTemplate x:DataType="models:HardwareEvent" x:Key="BleAdvertisement">
<Panel Background="Transparent">
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="DoubleTapped">
<!-- Must set the parent, otherwise it will look for the 'Command' in the template's DataType -->
<ia:InvokeCommandAction Command="{Binding $parent.((vm:BluetoothViewModel)DataContext).CmdCopyText}"
@DamianSuess
DamianSuess / CommandBehaviorBase.cs
Last active September 7, 2023 21:22
Avalonia Custom Behaviors
using System.Windows.Input;
using Avalonia;
using Avalonia.Xaml.Interactivity;
namespace SuessLabs.Tool.Common.Behaviors;
/// <summary>Base class for behavior command binding event on its source and executes its actions when that event is fired.</summary>
/// <typeparam name="T">Type of behavior.</typeparam>
public class CommandBehaviorBase<T>
: Behavior<T>
@DamianSuess
DamianSuess / CacheService.cs
Last active August 29, 2023 20:20
C# CacheService
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Caching.Memory;
using CacheExample.Extensions;
namespace CacheExample.Services;