Skip to content

Instantly share code, notes, and snippets.

View Subv's full-sized avatar

Sebastian Valle Subv

  • Barranquilla, Colombia
View GitHub Profile
@Subv
Subv / RRO.EX2
Created September 1, 2018 22:08 — forked from FernandoS27/RRO.EX2
unsigned int approx(float f) {
float ax = fabs(f);
unsigned int extra = 1;
if (ax >= 128.f) {
ax = 129.f;
extra = 0;
}
double w;
float ax2 = modf(ax, &w);
unsigned int sign = (f < 0.0f) << 31;
#include <3ds.h>
#include <stdio.h>
#include <cstdint>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
static s64 base_tick;
Result __fastcall KResourceLimit::SetMaxLimit(KResourceLimit *resLimit, LimitableResource resType, u32 resCount)
{
signed int v3; // r10@0
KResourceLimit *v5; // r6@1
KObjectMutex *v6; // r0@1
KObjectMutex *v8; // r4@1
unsigned int v9; // r2@1
bool v10; // zf@1
unsigned int v11; // r3@2
Result result; // r0@8
@Subv
Subv / wally.md
Last active August 29, 2015 14:23 — forked from lioncash/wally.md
KERNEL_HEAP:FFF93BB0 C0 D4 F2 FF+first_resource_limit DCD KResourceLimit_vtable; vtable
KERNEL_HEAP:FFF93BB0 01 00 00 00+ ; DATA XREF: .data:resource_limit_linko
KERNEL_HEAP:FFF93BB0 18 00 00 00+ ; KERNEL_HEAP:stru_FFF7BB40o
KERNEL_HEAP:FFF93BB0 00 00 00 04+ ; KERNEL_HEAP:resourcelimit_linked_list_firsto
KERNEL_HEAP:FFF93BB0 20 00 00 00+ DCD 1 ; refCount
KERNEL_HEAP:FFF93BB0 20 00 00 00+ DCD 0x18 ; max_thread_prio
KERNEL_HEAP:FFF93BB0 20 00 00 00+ DCD 0x4000000 ; max_commit
KERNEL_HEAP:FFF93BB0 08 00 00 00+ DCD 0x20 ; max_thread
KERNEL_HEAP:FFF93BB0 08 00 00 00+ DCD 0x20 ; max_event
KERNEL_HEAP:FFF93BB0 10 00 00 00+ DCD 0x20 ; max_mutex
class stdin_stream: boost::noncopyable {
typedef boost::function<void (const boost::system::error_code &, size_t bytes_transferred)> read_handler_type;
public:
stdin_stream(boost::asio::io_service &io, HANDLE hin): io(io), hin(hin), hev(CreateEvent(0, 0, 0, 0)), handler(), buffer(0), size(0) {
_beginthread(&stdin_stream::thread_handler_gateway, 0, this);
}
~stdin_stream() {
buffer = 0;
CloseHandle(hev);
}
@Subv
Subv / gist:1442725
Created December 7, 2011 13:04 — forked from LordJZ/gist:1435671
SMSG_CHAR_ENUM as of 4.3, reversed in 26 minutes
using System;
using Kamilla.WorldOfWarcraft.Latest.OpcodeDatas;
using Microsoft.Xna.Framework;
namespace Kamilla.WorldOfWarcraft.Latest.Parsers.Lobby
{
[WowPacketParser(WowOpcodes.SMSG_ENUM_CHARACTERS_RESULT)]
internal sealed class CharEnumParser : WowPacketParser
{
protected unsafe override void Parse()
@Subv
Subv / gist:1381218
Created November 21, 2011 00:03 — forked from LordJZ/gist:1193348
SMSG_PHASE_SHIFT_CHANGE 4.2.0
using System;
using System.Text;
namespace Kamilla.WorldOfWarcraft.Latest.OpcodeDatas
{
public sealed class SetPhaseShift : PackedData
{
public readonly byte[][] Data = new byte[4][];
public WowGuid Guid;
public uint Unk;
@Subv
Subv / 1.cs
Created November 21, 2011 00:03 — forked from LordJZ/1.cs
using System;
using System.Collections;
using System.Linq;
namespace Kamilla.WorldOfWarcraft.Latest.OpcodeDatas
{
public abstract class PackedData : OpcodeData
{
protected virtual bool IsMaskSequenceSwapped { get { return true; } }
protected abstract int[] MaskSequence { get; }
@Subv
Subv / StreamHandler.cs
Created November 19, 2011 14:54 — forked from LordJZ/StreamHandler.cs
StreamHandler + StructHelper + Time classes
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Xna.Framework;
namespace Kamilla
{