Advertisement
Xylitol

K4SCREEN.asm

Mar 15th, 2018
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;  830 bytes 16-bit DOS patch.
  2.  
  3. ; \masm32\bin\ml /c K4SCREEN.asm
  4. ; \masm32\bin\link16 K4SCREEN.obj;
  5.  
  6. .MODEL  small
  7. .STACK 500h
  8. .DATA
  9. .CODE
  10. PatchL         EQU 6
  11. Buffer         Db  PatchL Dup(1)
  12. handle   dw ?
  13. intro    db "The Penguins Little Crack Patch",0dh,0ah,"For 4screens$" ;<---- Insert program name here
  14.  
  15. FileName db "4screens.EXE",0 ;<------- Filename to be patched
  16. notfound db 0dh,0ah,"File not found!  Make sure Crack Patch is in program directory.$"
  17. cracked  db 0dh,0ah,"File successfully patched. Enjoy!$"
  18. Cant     db 0dh,0ah,"Can't write to file.$"
  19. Done     db "File has been made.$"
  20. String   db 085h,0 ;<------------- Byte e.g "85" to be patched
  21.  
  22. START:
  23. mov     ax,cs
  24. mov     ds,ax
  25. mov     dx,offset intro ;<-------point to the time prompt
  26. mov     ah,9 ;<------------------DOS: print string
  27. int     21h
  28. jmp openfile
  29.  
  30. openfile:
  31.  
  32. mov     ax,cs
  33. mov     ds,ax
  34. mov     ax,3d02h
  35. mov     dx,offset FileName
  36. int     21h
  37. mov     handle,ax
  38. cmp     ax,02h
  39. je      filedontexist
  40. jmp     write
  41.  
  42. filedontexist:
  43. mov     ax,cs
  44. mov     ds,ax
  45. mov     dx,offset notfound
  46. mov     ah,9 ;<------------------DOS: print string
  47. int     21h ;<-------------------Display the time prompt
  48. jmp exit
  49.  
  50. Write:
  51. mov     bx,handle
  52. mov     cx,0000h
  53. mov     dx,07D6h ;<------------- Insert offset e.g "07d6" you want to Patch
  54. mov ax,4200h
  55. int     21h
  56.  
  57. mov     cx,patchl
  58. mov     dx,offset String
  59. mov     ah,40h
  60. mov     cx,01h
  61. int     21h
  62. mov     ax,cs
  63. mov     ds,ax
  64. mov     dx,offset cracked
  65. mov     ah,9 ;<------------------DOS: print string
  66. int     21h ;<-------------------Display the time prompt
  67. jmp exit
  68.  
  69. Exit:
  70. mov     ah,3eh
  71. int     21h
  72. mov     ax,4c00h
  73. int     21h
  74. END START
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement