Skip to content

Roflane/libbase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

libbase — low-level utility library for Windows x64

Native DLL exposing system-level utilities with ability to export.

Stack: FASM

Features

  • FastZeroMemory — optimized memory zeroing
  • FastSort — fast sort implementation
  • Hardware-backed random number generation via RDRAND:
    • Integer types: Random64/32/16/8 with min/max range variants
    • Floating point: RandomDouble, RandomSingle

Note

Range functions may produce invalid results when min/max values are near the type's boundary limits.

C#

public static unsafe class XLib {
    [DllImport("base.dll")]
    public static extern void FastZeroMemory(void *ptr, Int64 size);

    [DllImport("base.dll")]
    public static extern void FastSort(void *ptr, Int64 size);

    [DllImport("base.dll")]
    public static extern UInt64 Random64();

    [DllImport("base.dll")]
    public static extern UInt32 Random32();

    [DllImport("base.dll")]
    public static extern UInt16 Random16();
    
    [DllImport("base.dll")]
    public static extern Int64 RandomInt64(Int64 min, Int64 max);
    
    [DllImport("base.dll")]
    public static extern Int32 RandomInt32(Int32 min, Int32 max);
        
    [DllImport("base.dll")]
    public static extern Int16 RandomInt16(Int16 min, Int16 max);
    
    [DllImport("base.dll")]
    public static extern Byte RandomByte(Byte min, Byte max);
    
    [DllImport("base.dll")]
    public static extern SByte RandomSByte(SByte min, SByte max);
    
    [DllImport("base.dll")]
    public static extern Double RandomDouble(Double min, Double max);
    
    [DllImport("base.dll")]
    public static extern Single RandomSingle(Single min, Single max);
}

C/C++

extern "C" __declspec(dllimport) void FastZeroMemory(void *ptr, size_t size);
extern "C" __declspec(dllimport) void FastSort(void *ptr, size_t size);
extern "C" __declspec(dllimport) uint64_t Random64();
extern "C" __declspec(dllimport) uint32_t Random32();
extern "C" __declspec(dllimport) uint16_t Random16();
extern "C" __declspec(dllimport) int64_t RandomInt64(int64_t min, int64_t max);
extern "C" __declspec(dllimport) int32_t RandomInt32(int32_t min, int32_t max);
extern "C" __declspec(dllimport) int16_t RandomInt16(int16_t min, int16_t max);
extern "C" __declspec(dllimport) int8_t RandomSByte(int8_t min, int8_t max);
extern "C" __declspec(dllimport) uint8_t RandomByte(uint8_t min, uint8_t max);
extern "C" __declspec(dllimport) double RandomDouble(double min, double max);
extern "C" __declspec(dllimport) float RandomSingle(float min, float max);

About

Libbase provides set of exported functions that are extremely useful; dialect: FASM.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors