Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
9071 hidnplayr 1
;    seed.inc - Collect some entropy from KolibriOS system
2
;
3
;    Copyright (C) 2021 Jeffrey Amelynck
4
;
5
;    This program is free software: you can redistribute it and/or modify
6
;    it under the terms of the GNU General Public License as published by
7
;    the Free Software Foundation, either version 3 of the License, or
8
;    (at your option) any later version.
9
;
10
;    This program is distributed in the hope that it will be useful,
11
;    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
;    GNU General Public License for more details.
14
;
15
;    You should have received a copy of the GNU General Public License
16
;    along with this program.  If not, see .
17
 
18
 
19
align 4
20
create_seed:
21
 
22
        push    ebx edx
23
 
24
        mcall   3                       ; System time
25
        xor     edx, eax
26
        rol     edx, 1
27
        mcall   14                      ; Screen size
28
        xor     edx, eax
29
        rol     edx, 1
30
        mcall   18, 4                   ; Idle time counter
31
        xor     edx, eax
32
        rol     edx, 1
33
        mcall   18, 5                   ; CPU clock rate
34
        xor     edx, eax
35
        rol     edx, 1
36
        mcall   18, 7                   ; Active window slot
37
        xor     edx, eax
38
        rol     edx, 1
39
        mcall   18, 16                  ; Free RAM space
40
        xor     edx, eax
41
        rol     edx, 1
42
        mcall   18, 17                  ; Total RAM space
43
        xor     edx, eax
44
        rol     edx, 1
45
        mcall   18, 21                  ; Active window slot
46
        xor     edx, eax
47
        rol     edx, 1
48
        mcall   26, 10                  ; High precision time counter
49
        xor     edx, eax
50
        rol     edx, 1
51
        xor     edx, ebx
52
        rol     edx, 1
53
        mcall   37, 0                   ; Screen coordinates of the cursor
54
        xor     edx, eax
55
        rol     edx, 1
56
        mcall   54, 0                   ; Number of slots on the clipboard
57
        xor     edx, eax
58
        rol     edx, 1
59
        mcall   66, 3                   ; Status of the keyboard control keys
60
        xor     edx, eax
61
        rol     edx, 1
62
        mcall   68, 0                   ; Task switch counter
63
        xor     edx, eax
64
        rol     edx, 1
65
        mcall   74, 0x108               ; Network interface 1 TX bytes counter
66
        xor     edx, eax
67
        rol     edx, 1
68
        mcall   74, 0x109               ; Network interface 1 RX bytes counter
69
        xor     edx, eax
70
        rol     edx, 1
71
        mcall   76, 0x100               ; Network interface 1 MAC address
72
        xor     eax, ebx
73
        xor     eax, edx
74
 
75
        pop     edx ebx
76
 
77
        ret