mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-03 00:03:19 +02:00
SMBServer v1.0.5
This commit is contained in:
parent
b75820452d
commit
bd1006cb81
400 changed files with 28062 additions and 0 deletions
33
Utilities/ByteUtils/LittleEndianReader.cs
Normal file
33
Utilities/ByteUtils/LittleEndianReader.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Utilities
|
||||
{
|
||||
public class LittleEndianReader
|
||||
{
|
||||
public static ushort ReadUInt16(byte[] buffer, ref int offset)
|
||||
{
|
||||
offset += 2;
|
||||
return LittleEndianConverter.ToUInt16(buffer, offset - 2);
|
||||
}
|
||||
|
||||
public static uint ReadUInt32(byte[] buffer, ref int offset)
|
||||
{
|
||||
offset += 4;
|
||||
return LittleEndianConverter.ToUInt32(buffer, offset - 4);
|
||||
}
|
||||
|
||||
public static ulong ReadUInt64(byte[] buffer, ref int offset)
|
||||
{
|
||||
offset += 8;
|
||||
return LittleEndianConverter.ToUInt64(buffer, offset - 8);
|
||||
}
|
||||
|
||||
public static Guid ReadGuid(byte[] buffer, ref int offset)
|
||||
{
|
||||
offset += 16;
|
||||
return LittleEndianConverter.ToGuid(buffer, offset - 16);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue