git-svn-id: https://spexeah.com:8443/svn/Asuro@918 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
kieron
2020-07-09 21:06:52 +00:00
parent 6db9d71479
commit 5d26e199aa
28 changed files with 240 additions and 15 deletions
+2 -1
View File
@@ -78,7 +78,7 @@ type
OSXSAVE : Boolean;
AVX : Boolean;
RESV3 : Boolean;
RESV4 : Boolean;
RDRAND : Boolean;
RESV5 : Boolean;
end;
TClockSpeed = record
@@ -247,6 +247,7 @@ begin
if CPUID.Capabilities1^.XSAVE then writestringWND(', XSAVE', WND);
if CPUID.Capabilities1^.OSXSAVE then writestringWND(', OSXSAVE', WND);
if CPUID.Capabilities1^.AVX then writestringWND(', AVX', WND);
if CPUID.Capabilities1^.RDRAND then writestringWND(', RDRAND', WND);
writestringlnWND(' ', WND);
end;
+27 -2
View File
@@ -166,13 +166,28 @@ type
UID : uint32;
end;
PUDPHeader = ^TUDPHeader;
TUDPHeader = record
TUDPHeader = packed record
SrcPort : uint16;
DstPort : uint16;
Length : uint16;
Checksum : uint16;
end;
TUDPSendContext = record
DstPort : uint16;
socket : PUDPBindContext;
context : PPacketContext;
end;
PUDPSendContext = ^TUDPSendContext;
TUDPPseudoHeader = packed record
Source_IP : uint32;
Destination_IP : uint32;
Protocol : uint16;
Length : uint16;
UDP_Source : uint16;
UDP_Destination : uint16;
UDP_Length : uint16;
end;
PUDPPseudoHeader = ^TUDPPseudoHeader;
{ Callback Types }
@@ -187,12 +202,22 @@ const
NULL_MAC : Array[0..5] of uint8 = ($00, $00, $00, $00, $00, $00);
FORCE_MAC : Array[0..5] of uint8 = ($08, $00, $27, $E6, $3F, $81);
{ IPs }
BROADCAST_IP : Array[0..3] of uint8 = ($FF, $FF, $FF, $FF);
NULL_IP : Array[0..3] of uint8 = ($00, $00, $00, $00);
{ ICMP Data }
ICMP_DATA_GENERIC : Array[0..31] of uint8 = ( $61, $62, $63, $64, $65, $66, $67, $68,
$69, $6a, $6b, $6c, $6d, $6e, $6f, $70,
$71, $72, $73, $74, $75, $76, $77, $61,
$62, $63, $64, $65, $66, $67, $68, $69 );
{ UDP Test Data }
UDPT_S_IP : Array[0..3] of uint8 = ($C0, $A8, $00, $1F);
UDPT_D_IP : Array[0..3] of uint8 = ($C0, $A8, $00, $1E);
UDPT_DATA : Array[0..1] of uint8 = ($48, $69);
implementation
end.
File diff suppressed because it is too large Load Diff
+36
View File
@@ -0,0 +1,36 @@
unit rand;
interface
function rand32 : uint32;
function rand16 : uint16;
function rand8 : uint8;
procedure srand(seed : uint32);
implementation
var
next : uint32 = 1;
function rand32 : uint32;
begin
next:= next * 1103515245 + 12345;
rand32:= (next div 65536) mod 32768;
end;
function rand16 : uint16;
begin
rand16:= rand32 AND $FFFF;
end;
function rand8 : uint8;
begin
rand8:= rand32 AND $FF;
end;
procedure srand(seed : uint32);
begin
next:= seed;
end;
end.
+4 -2
View File
@@ -38,14 +38,15 @@ uses
shell,
memview,
splash,
cpu,
themer,
netlog,
vmlog,
vm,
vmstate,
edit,
udpcat;
udpcat,
cpu,
rand;
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
@@ -154,6 +155,7 @@ begin
isrmanager.init();
faults.init();
RTC.init();
rand.srand((getDateTime.Seconds SHR 24) OR (getDateTime.Minutes SHR 16) OR (getDateTime.Hours SHR 8) OR (getDateTime.Day));
pmemorymanager.init();
vmemorymanager.init();
lmemorymanager.init();
+20 -1
View File
@@ -8,7 +8,7 @@ unit udpcat;
interface
uses
console, terminal, keyboard, util, strings, tracer, udp, nettypes, lmemorymanager;
console, terminal, keyboard, util, strings, tracer, udp, nettypes, netutils, lmemorymanager;
procedure init();
@@ -32,6 +32,8 @@ procedure OnReceive(p_data : void; p_len : uint16; p_context : PUDPPacketContext
var
c : pchar;
i : uint16;
sendContext : PUDPSendContext;
Message : pchar;
begin
c:= pchar(p_data);
@@ -39,6 +41,23 @@ begin
writecharWND(c[i], Handle);
end;
writestringlnWND(' ', Handle);
sendContext:= PUDPSendContext(kalloc(sizeof(TUDPSendContext)));
sendContext^.DstPort:= p_context^.SrcPort;
sendContext^.Socket:= context;
sendContext^.context:= p_context^.PacketContext;
sendContext^.context^.TTL:= 128;
contextMACSwitch(p_context^.PacketContext);
contextIPv4Switch(p_context^.PacketContext);
Message:= pchar(kalloc(6));
Message[0]:= 'A';
Message[1]:= 'S';
Message[2]:= 'U';
Message[3]:= 'R';
Message[4]:= 'O';
Message[5]:= '!';
udp.send(void(Message), 6, sendContext);
kfree(void(sendContext));
kfree(void(Message));
end;
procedure run(Params : PParamList);