Subversion Repositories Kolibri OS

Rev

Rev 524 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. include '..\..\macros.inc'
  2. use32
  3.         db      'MENUET01'
  4.         dd      1
  5.         dd      start
  6.         dd      i_end
  7.         dd      mem, mem
  8.         dd      0, 0
  9.  
  10. start:
  11.         push    70
  12.         pop     eax
  13.         mov     ebx, fileinfo
  14.         mcall
  15.         cmp     ebx, max_file_size
  16.         jz      exit
  17.         cmp     ebx, -1
  18.         jnz     @f
  19. exit:
  20.         or      eax, -1
  21.         mcall
  22. @@:
  23.         mov     esi, filebuf
  24.         xor     ecx, ecx
  25. scan1l1:
  26.         or      edi, -1
  27. scan1:
  28.         inc     edi
  29.         lodsb
  30.         test    al, al
  31.         jz      scan1done
  32.         cmp     al, 13
  33.         jz      newline
  34.         cmp     al, 10
  35.         jnz     scan1
  36. newline:
  37.         test    edi, edi
  38.         jz      scan1l1
  39.         inc     ecx
  40.         jmp     scan1l1
  41. scan1done:
  42.         test    edi, edi
  43.         jz      @f
  44.         inc     ecx
  45. @@:
  46.         jecxz   exit
  47.         push    3
  48.         pop     eax
  49.         mcall
  50.         ror     eax, 16
  51.         mov     edx, 1024
  52. @@:
  53.         sub     eax, 0x43ab45b5
  54.         ror     eax, 1
  55.         xor     eax, 0x32c4324f
  56.         ror     eax, 1
  57.         dec     edx
  58.         jnz     @b
  59.         div     ecx
  60. ; use edx as random index
  61.         mov     esi, filebuf
  62. scan2l1:
  63.         push    esi
  64.         or      edi, -1
  65. scan2:
  66.         inc     edi
  67.         lodsb
  68.         test    al, al
  69.         jz      newline2
  70.         cmp     al, 13
  71.         jz      newline2
  72.         cmp     al, 10
  73.         jnz     scan2
  74. newline2:
  75.         pop     eax
  76.         test    edi, edi
  77.         jz      scan2l1
  78.         dec     edx
  79.         jns     scan2l1
  80.         mov     byte [esi-1], 0
  81. ; set eax (-> ASCIIZ string) as skin
  82.         mov     ecx, eax
  83.         push    48
  84.         pop     eax
  85.         mov     bl, 8
  86.         mcall
  87.         jmp     exit
  88.  
  89. fileinfo:
  90.         dd      0
  91.         dq      0
  92.         dd      max_file_size
  93.         dd      filebuf
  94.         db      '/sys/skinsel.dat',0
  95. i_end:
  96. max_file_size = 0x1000 - 0x40 - $
  97. filebuf:
  98.         rb      max_file_size
  99. ; stack
  100.         rb      0x40
  101. mem:
  102.