Hendricks266

FakeDate TSR Mod

Apr 25th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; nasm fakedate.asm -fbin -o FAKEDATE.COM
  2.  
  3. BITS 16
  4.  
  5. org 100h
  6.  
  7. section .text
  8.  
  9. start:
  10.     jmp INIT
  11.  
  12. setter:
  13.     cmp ah, 2Ah
  14.     jne dosjmp
  15.     mov cx, word [cs:year]
  16.     mov dh, byte [cs:month]
  17.     mov dl, byte [cs:day]
  18.     iret
  19. dosjmp:
  20.     db 0xEA
  21.     dw 0
  22.     dw 0
  23.  
  24. year   dw 1993
  25. month  db 10
  26. day    db 10
  27.  
  28. INIT:
  29.     push cs
  30.     pop ds
  31.  
  32.     mov ah,9
  33.     mov dx,0
  34.     mov dx, fakedate
  35.     int 21h
  36.  
  37.     mov ax,3521h
  38.     int 21h
  39.  
  40.     mov si,80h
  41.     mov cl,byte [si]
  42. lp:
  43.     dec cl
  44.     jle load
  45.     inc si
  46.     cmp byte [si],20h
  47.     je lp
  48.     cmp byte [si],'/'
  49.     jne next
  50.     cmp byte [si+1],'u'
  51.     je ul
  52.     cmp byte [si+1],'U'
  53.     jne load
  54. ul:
  55.     call instaled
  56.     mov dx, unist
  57.     jne sc
  58.     push bx
  59.     push es
  60.     mov dx,word [es:bx+dosjmp-setter+1]
  61.     mov ds,word [es:bx+dosjmp-setter+3]
  62.     mov ax,2521h
  63.     int 21h
  64.     push cs
  65.     pop ds
  66.     mov dx,unist
  67.     mov ah,9
  68.     int 21h
  69.     pop ax
  70.     pop dx
  71.     push cs
  72.     pop cx
  73.     sub dx, setter
  74.     jnc f
  75.     sub ax,1000h
  76. f:
  77.     sub cx,ax
  78.     shl cx,4
  79.     sub cx,dx
  80.     cmp cx, INIT
  81.     jne noul
  82.  
  83.     mov ds,ax
  84.     int 27h
  85.  
  86.  
  87. next:
  88.     cmp cl, 7
  89.     jl load
  90.     add si, 7
  91.  
  92.     ; DD
  93.     mov cx, 0
  94.     mov dx, 1
  95. dpos:
  96.     mov ax, 0
  97.     mov al, byte [si]
  98.     sub al, '0'
  99.     imul ax, dx
  100.     add cl, al
  101.     dec si
  102.     imul dx, 10
  103.     cmp dl, 100
  104.     jne dpos
  105.  
  106.     mov byte [cs:day], cl
  107.  
  108.     ; MM
  109.     mov cx, 0
  110.     mov dx, 1
  111. mpos:
  112.     mov ax, 0
  113.     mov al, byte [si]
  114.     sub al, '0'
  115.     imul ax, dx
  116.     add cl, al
  117.     dec si
  118.     imul dx, 10
  119.     cmp dl, 100
  120.     jne mpos
  121.  
  122.     mov byte [cs:month], cl
  123.  
  124.     ; YYYY
  125.     mov cx, 0
  126.     mov dx, 1
  127. ypos:
  128.     mov ax, 0
  129.     mov al, byte [si]
  130.     sub al, '0'
  131.     imul ax, dx
  132.     add cx, ax
  133.     dec si
  134.     imul dx, 10
  135.     cmp dx, 10000
  136.     jne ypos
  137.  
  138.     mov word [cs:year], cx
  139.  
  140. load:
  141.     call instaled
  142.     jne notinst
  143.     mov ah,9
  144.     mov dx, already
  145.     int 21h
  146.     mov dx, ulinst
  147. sc:
  148.     mov ah,9
  149.     int 21h
  150. noul:   int 20h
  151.  
  152. notinst:
  153.     mov word [dosjmp+1],bx
  154.     mov word [dosjmp+3],es
  155.     mov dx, setter
  156.     mov ax,2521h
  157.     int 21h
  158.     mov dx, inst
  159.     mov ah,9
  160.     int 21h
  161.     mov dx, ulinst
  162.     int 21h
  163.     mov dx, INIT
  164.     int     27h
  165.  
  166. instaled:
  167.     mov ax,word [es:bx]
  168.     cmp ax,word [cs:setter]
  169.     jne no
  170.     mov ax,word [es:bx+2]
  171.     cmp ax,word [cs:setter+2]
  172.     jne no
  173.     mov ax,word [es:bx+4]
  174.     cmp ax,word [cs:setter+4]
  175.     jne no
  176.     mov ax,word [es:bx+6]
  177.     cmp ax,word [cs:setter+6]
  178.     jne no
  179.     mov ax,word [es:bx+8]
  180.     cmp ax,word [cs:setter+8]
  181.     jne no
  182.     mov ax,word [es:bx+10]
  183.     cmp ax,word [cs:setter+10]
  184. no: ret
  185.  
  186. section .data
  187.  
  188. wten   dw 10
  189.  
  190. fakedate db 'FakeDate by Lee Killough, modified by Evan Ramos',0ah,0dh,'$'
  191. already  db 'FakeDate is already installed.',0ah,0dh,'$'
  192. ulinst   db 'Type FakeDate /u to uninstall.',0ah,0dh,'$'
  193. inst     db 'FakeDate installed.',0ah,0dh,'$'
  194. unist    db 'FakeDate uninstalled.',0ah,0dh,'$'
Advertisement
Add Comment
Please, Sign In to add comment