Skip to content

Instantly share code, notes, and snippets.

View james7132's full-sized avatar
❤️
Installing ring-0 anti-cheats into my heart

James Liu james7132

❤️
Installing ring-0 anti-cheats into my heart
View GitHub Profile
@james7132
james7132 / uniform_buffer_write_into_vec.rs
Created September 22, 2023 03:47
Assembly from encase
use encase::{*, internal::WriteInto};
#[derive(Debug, ShaderType, PartialEq, Clone, Copy)]
struct A {
f: f32,
u: u32,
i: i32,
nu: Option<core::num::NonZeroU32>,
ni: Option<core::num::NonZeroI32>,
wu: core::num::Wrapping<u32>,
@james7132
james7132 / original.s
Created November 4, 2022 02:30
Inefficient Query iteration
.text
.def @feat.00;
.scl 3;
.type 0;
.endef
.globl @feat.00
.set @feat.00, 0
.file "empty.2eb308ba-cgu.0"
.def _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17hbaba4511104e15d0E;
.scl 3;
@james7132
james7132 / bevy_gats.md
Last active June 29, 2022 00:06
GATs Case Study: Bevy Query/Fetch

GATs Case Study: Bevy Queries

Bevy is a game engine that uses Rust for both it's internal implemenation and user-facing programming language. One of the biggest selling points is its ease of use and ergonomics. It encodes the game world as entities. These entities can have components, which are just normal Rust types: structs, enums, etc. Game logic is encoded as systems which query for a specific set of components to apply the game logic to. For example, a simple "game" that just moves all entities upward may look like this:

#[derive(Component)]
pub struct Position(Vec3);

fn move_up_system(
  // The Query for all Position components as a *mutable* reference.
 mut positions: Query&lt;&amp;mut Position&gt;,
@james7132
james7132 / notes.md
Created October 15, 2021 13:36
Quick Security/Privacy Notes

Personal Security/Privacy Notes

This is a set of notes for personal privacy and security by a non-professional (I'm an ML engineer).

Assumptions

These guidelines are based on the following assumptions:

  • Public services provided by any organization, for-profit or not (looking at your Mozilla), do not respsect your privacy. If you provide them data, they will store it unencrypted and will not delete it, even if explicitly asked. Only exception to this is large enough regulatory pressure (i.e. GDPR/CCPA), and only if the service is 100% compliant.
  • Public services can and will be have data leaks and breaches. It's not a question of "if" but "when".
// Decompiled with JetBrains decompiler
// Type: LevelSceneControl.Level4_1
// Assembly: Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 349C91EF-FE4B-4E7F-8069-612CB2657429
// Assembly location: D:\Steam Games\steamapps\common\The Disappearing of Gensokyo\The Disappearing of Gensokyo_Data\Managed\Assembly-CSharp.dll
using GameEvents;
using PS4;
using System;
using System.Collections;