Skip to content

Instantly share code, notes, and snippets.

@kyapp69
kyapp69 / Half.cs
Created February 18, 2020 09:28 — forked from vermorel/Half.cs
C# Half-precision data type
/// ================ Half.cs ====================
/// The code is free to use for any reason without any restrictions.
/// Ladislav Lang (2009), Joannes Vermorel (2017)
using System;
using System.Diagnostics;
using System.Globalization;
namespace SystemHalf
{
@kyapp69
kyapp69 / DualQuaternion.cs
Created February 17, 2020 07:54 — forked from maxattack/DualQuaternion.cs
Dual Quaternion Sample Implementation for Unity3D
using UnityEngine;
/*
Dual-Quaternions are an alternate encoding for rigid transforms (translation + rotation),
with the special property that linear combinations will "arc" the translation in response
to rotation, producing a skinning interpolation that prevents the kind of collapsing you
get from simple linear interpolation of translations in their native coordinates.
Copyright (c) 2018 Max Kaufmann
@kyapp69
kyapp69 / SkinnedMeshObjectPreviewExample.cs
Created January 23, 2020 01:39 — forked from radiatoryang/SkinnedMeshObjectPreviewExample.cs
An example of a custom ObjectPreview rendering out a SkinnedMesh for Unity Editor C#... I used it for facial expressions and blendshape editing, you might want to use it for something else. I hereby place it under MIT License. Full write-up here: http://www.blog.radiator.debacle.us/2016/06/working-with-custom-objectpreviews-and.html
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
[CustomPreview(typeof(YourCustomScriptableObject))] // THIS IS VERY IMPORTANT, this is so the editor knows what this is supposed to be previewing at all
public class SkinnedMeshObjectPreviewExample : ObjectPreview {
PreviewRenderUtility m_PreviewUtility;
@kyapp69
kyapp69 / SkinnedMeshCombiner.cs
Created January 23, 2020 01:37 — forked from radiatoryang/SkinnedMeshCombiner.cs
example code for combining SkinnedMeshRenderers at runtime (for optimization reasons usually), which I use in my games for Mixamo Fuse models specifically... PLEASE DON'T ASK ME FOR HELP WITH THIS, this is more for learning purposes, and it's not really an easy-to-use Asset Store thing? also I have a lot of weird hacks specific for my uses... ag…
// this code is under MIT License, by Robert Yang + others (credits in comments)
// a lot of this is based on http://wiki.unity3d.com/index.php?title=SkinnedMeshCombiner
// but I removed the atlasing stuff because I don't need it
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@kyapp69
kyapp69 / Texture2DArraySurface.Shader
Created January 2, 2020 03:18 — forked from unitycoder/Texture2DArraySurface.Shader
GPU Instancing + Texture2DArray
Shader "Custom/Texture2DArraySurfaceShader"
{
Properties
{
_Textures("Textures", 2DArray) = "" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
@kyapp69
kyapp69 / Embedded_HTTP_Header.txt
Created September 6, 2018 10:00 — forked from Morketh/Embedded_HTTP_Header.txt
XORDDOS Generation 2
^@/etc/init.d/%s^@/etc/cron.hourly/gcc.sh^@/etc/rc%d.d/S90%s^@/etc/rc.d/rc%d.d/S90%s^@--add^@chkconfig^@defaults^@update-rc.d^@^@sed -i '/\/etc\/cron.hourly$
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; TencentTraveler ; .NET CLR 1.1.4322)
^@Connection: Keep-Alive
^@http://^@^@POST %s HTTP/1.1
%sHost: %s
Content-Type: application/x-www-form-urlencoded
Content-Length: %d
%s%s^@GET %s HTTP/1.1
@kyapp69
kyapp69 / xor-ddos-decryption.py
Created September 6, 2018 09:52 — forked from christophetd/xor-ddos-decryption.py
Tool to decrypt configuration values and network communications of malwares of the Xor Ddos family
import binascii
import itertools
# XORs two byte strings together
def xor_bytes(bytes1, bytes2):
return [ chr(ord(a) ^ b) for (a, b) in zip(bytes1, bytes2) ]
# XORs a ciphertext with the malware's hardcoded key, and repeats it until it's long enough to match the ciphertext length.
def decrypt(cipher, key_hex = 'BB2FA36AAA9541F0'):
key_bytes = [ ord(a) for a in key_hex ]