home *** CD-ROM | disk | FTP | other *** search
/ Steganos Hacker Tools / SHT151.iso / programme / pw_bios / awcrack / AWCRACK.ASM next >
Encoding:
Assembly Source File  |  1996-11-14  |  10.8 KB  |  444 lines

  1. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  2. ;
  3. ; *** Award Modular BiOS crack tool ***
  4. ;
  5. ;      (c) 1996 by The Immortal
  6. ;
  7. ; Have fun with this cool program!
  8. ;
  9. ; Have a look at the info-file so you
  10. ; know how to use this awesome cool &
  11. ; powerful program!!
  12. ;
  13. ;               bye & have fun,
  14. ;
  15. ;                       The Immortal.
  16. ;
  17. ; P.S.: Assembler used: TASM 3.2
  18. ; PP.S.: contact me at 'The Source'!
  19. ;
  20. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  21.  
  22.     .MODEL TINY
  23.     .CODE                   ;make it a com-file!
  24.     ORG 100h
  25.  
  26. ;▒▒▒ program start: ▒▒▒
  27. start:
  28.  
  29.     jmp     real_start      ;jump to real program start...
  30.  
  31. ;▒▒▒ global data: ▒▒▒
  32. copyr   db      13, "════════════════════════════════════════════════════════════════════════════", 13, 10
  33.     db      " *** Award Modular BiOS crack tool, (c) 1996 by The Immortal / AUSTRiA! ***", 13, 10
  34.     db      "════════════════════════════════════════════════════════════════════════════"
  35.     db      13, 10, "$"
  36.  
  37. pw_1    db      13, 10, "* Password needed to enter System!", 13, 10, "$"
  38. pw_2    db      13, 10, "* Password needed to enter Setup!", 13, 10, "$"
  39. pw_3    db      13, 10, "* Supervisor-password is disabled!", 13, 10, "$"
  40. pw_4    db      13, 10, "* Supervisor-password is enabled!", 13, 10, "$"
  41. pw_5    db      13, 10, "* User-password is disabled!", 13, 10, "$"
  42. pw_6    db      13, 10, "* User-password is enabled!", 13, 10, "$"
  43.  
  44. ;format:        length, "cmdl":
  45. ;-------------------------------
  46. p_show  db      4, "SHOW"               ;command-line parameters...
  47. p_soff  db      8, "SUPEROFF"
  48. p_son   db      7, "SUPERON"
  49. p_system db     6, "SYSTEM"
  50. p_setup db      5, "SETUP"
  51. p_uoff  db      7, "USEROFF"
  52. p_uon   db      6, "USERON"
  53.  
  54. num_params      EQU     7
  55.  
  56. help    db      13, 10, "Usage: AW-CRACK [SHOW | SUPERON|SUPEROFF | USERON|USEROFF | SYSTEM|SETUP]"
  57.     db      13, 10
  58.     db      13, 10, "     SHOW ... displays password status, also if it's set to"
  59.     db      13, 10, "              system or setup level!"
  60.     db      13, 10
  61.     db      13, 10, "     SUPERON|SUPEROFF,"
  62.     db    13, 10, "     USERON|USEROFF: ... enables or disables the bios-password!"
  63.     db      13, 10, "                         WARNING!: never enable unknown password(s),"
  64.     db    13, 10, "                                   if you don't have a backdoor!"
  65.     db      13, 10
  66.     db      13, 10, "     SYSTEM|SETUP ... sets password-check to system or setup level!"
  67.     db      13, 10, 13, 10, "* Please note: only one single parameter is allowed at a run!"
  68.     db    13, 10, "* This program won't work with other BIOS-types than Award _Modular_!"
  69.     db      13, 10, "$"
  70.  
  71. cmdl    db      128 dup (?)
  72.     db      "$"
  73.  
  74. ;▒▒▒ print_msg: ▒▒▒
  75. print_msg:
  76.     mov     ah, 09h         ;DOS: print message
  77.     int     21h
  78.     ret
  79.  
  80. ;▒▒▒ parse_cmdl: ▒▒▒
  81. ;
  82. ;return: AX: 0000h = SHOW
  83. ;            0001h = ON, 0002h = OFF
  84. ;            0003h = SYSTEM, 0004h = SETUP
  85. ;            FFFFh = error... (unknown command-line parameter!)
  86. parse_cmdl:
  87.  
  88. ;*** copy command-line first: ***
  89.     mov     si, 80h         ;PSP: command-line
  90.     lea     di, cmdl
  91.     lodsb
  92.     xor     cx, cx
  93.     mov     cl, al          ;CX = length of cmdl
  94.     lodsb
  95.     rep     movsb
  96.  
  97. ;*** upcase command-line: ***
  98.     lea     di, cmdl
  99.     lea     si, cmdl
  100.     mov     cl, al          ;CX = length of cmdl
  101. uploop:
  102.     lodsb
  103.     cmp     al, 97          ;'a'
  104.     jb      upok
  105.  
  106.     cmp     al, 122         ;'z'
  107.     ja      upok
  108.  
  109.     sub     al, (97-65)     ;upcase it!
  110. upok:
  111.     stosb                   ;store char...
  112.     loop    uploop
  113.  
  114. ;*** compare cmdl-parameters: ***
  115.  
  116.     lea     si, p_show
  117.  
  118.     xor     ax, ax          ;return value!
  119.  
  120.     mov     cx, num_params  ;possible # of command-line params...
  121. comp_loop:
  122.     push    cx
  123.     push    ax
  124.  
  125.     lea     di, cmdl
  126.     lodsb
  127.     xor     cx, cx          ;get length
  128.     mov     cl, al
  129.     repe    cmpsb
  130.     mov     bx, cx
  131.  
  132.     add     si, cx          ;add unused to offset
  133.  
  134.     pop     ax              ;get return-value
  135.     pop     cx
  136.  
  137.     or      bx, bx          ;parameter match...
  138.     jz      done
  139.  
  140.     inc     ax
  141.     loop    comp_loop
  142.  
  143. error:
  144.     mov     ax, 0ffffh      ;error!
  145.  
  146. done:
  147.     ret                     ;back 2 caller!
  148.  
  149. ;▒▒▒ read_CMOS: ▒▒▒
  150. read_CMOS:
  151.     mov     dx, 70h         ;read CMOS position in AL
  152.     out     dx, al
  153.     inc     dx
  154.     in      al, dx
  155.     ret                     ;return: AL
  156.  
  157. ;▒▒▒ write_CMOS: ▒▒▒
  158. write_CMOS:
  159.     mov     dx, 70h         ;write AH to CMOS position in AL
  160.     out     dx, al
  161.     inc     dx
  162.     mov     al, ah
  163.     out     dx, al
  164.     ret
  165.  
  166. ;▒▒▒ show_info: ▒▒▒
  167. show_info:                      ;*** Password at system/setup level? ***
  168.  
  169. ;*** Supervisor-password disabled/enabled? ***
  170.  
  171.     mov     al, 11h         ;read CMOS-position 11h
  172.     call    read_CMOS
  173.  
  174.     lea     dx, pw_3        ;supervisor-pwd disabled
  175.  
  176.     and     al, 02h         ;Password: disabled/enabled?
  177.     jz      pw_superdisabled
  178.  
  179.     lea     dx, pw_4        ;supervisor-pwd enabled
  180.     call    print_msg
  181.     jmp     pw_level
  182.  
  183. pw_superdisabled:
  184.     call    print_msg       ;print message
  185.  
  186. ;*** User-password disabled/enabled? ***
  187.     
  188.     mov     al, 5eh         ;read CMOS-position 5eh
  189.     call    read_CMOS
  190.  
  191.     lea     dx, pw_5        ;user-pwd disabled
  192.  
  193.     and     al, 01h         ;Password: disabled/enabled?
  194.     jz      pw_userdisabled
  195.  
  196.     lea     dx, pw_6        ;user-pwd enabled
  197.     call    print_msg
  198.     jmp     pw_level
  199.  
  200. pw_userdisabled:
  201.     call    print_msg       ;print message
  202.     jmp     show_done
  203.     
  204. pw_level:                       ;▒▒▒ write out pwd-level ▒▒▒
  205.  
  206.     mov     al, 11h         ;read CMOS-position 11h
  207.     call    read_CMOS
  208.  
  209.     lea     dx, pw_1        ;System level
  210.  
  211.     and     al, 01h         ;Password: System/Setup level
  212.     jnz     pw_system
  213.  
  214.     lea     dx, pw_2        ;Setup level
  215.  
  216. pw_system:
  217.     call    print_msg       ;print message
  218.  
  219. show_done:
  220.  
  221.     ret                     ;back 2 caller!
  222.  
  223. ;▒▒▒ do_checksum: ▒▒▒
  224. do_checksum:                    ;calculate new CMOS checksum,
  225.                 ;and write it back to the CMOS...
  226.  
  227.     mov     cx, 2dh - 10h + 1       ;CMOS-reg. 10h - 2dh (both incl.!)
  228.     xor     ah, ah
  229.     xor     bx, bx
  230.  
  231. checksum_loop:
  232.  
  233.     mov     dx, 70h
  234.     mov     al, 2dh + 1
  235.     sub     al, cl          ;al = register in CMOS
  236.     out     dx, al
  237.     inc     dx
  238.     in      al, dx          ;read CMOS-reg!
  239.  
  240.     add     bx, ax          ;add 2 checksum!
  241.  
  242.     loop    checksum_loop
  243.  
  244.     mov     dx, 70h         ;write new checksum back to CMOS!
  245.     mov     al, 2eh
  246.     out     dx, al
  247.     inc     dx
  248.     mov     al, bh          ;write high-byte!
  249.     out     dx, al
  250.  
  251.     mov     dx, 70h         ;write low-byte!
  252.     mov     al, 2fh
  253.     out     dx, al
  254.     inc     dx
  255.     mov     al, bl
  256.     out     dx, al          ;done!
  257.  
  258.     ret                     ;return to caller!
  259.   
  260. ;▒▒▒ do_checksum_ext: ▒▒▒
  261. do_checksum_ext:                ;calculate new extended CMOS checksum,
  262.                 ;and write it back to the CMOS...
  263.  
  264.  
  265.     mov     cx, 79h - 42h + 1       ;42h - 79h (both incl.!)
  266.     xor     ah, ah
  267.     xor     bx, bx
  268.  
  269. check_loop_ext:
  270.  
  271.     mov     dx, 70h
  272.     mov     al, 79h + 1
  273.     sub     al, cl          ;al = register in CMOS
  274.     out     dx, al
  275.     inc     dx
  276.     in      al, dx          ;read reg
  277.  
  278.     add     bx, ax          ;add 2 checksum!
  279.  
  280.     loop    check_loop_ext
  281.     
  282.     mov     dx, 70h         ;write new ext.-checksum back to CMOS!
  283.     mov     al, 7ah
  284.     out     dx, al
  285.     inc     dx
  286.     mov     al, bh          ;write high-byte!
  287.     out     dx, al
  288.  
  289.     mov     dx, 70h         ;write low-byte!
  290.     mov     al, 7bh
  291.     out     dx, al
  292.     inc     dx
  293.     mov     al, bl
  294.     out     dx, al          ;done!
  295.  
  296.     ret                     ;return 2 caller!
  297.  
  298. ;▒▒▒ real_start: ▒▒▒
  299. real_start:                     ;program real-entry point!
  300.  
  301.     push    cs              ;DS = CS
  302.     pop     ds
  303.     push    cs              ;ES = CS
  304.     pop     es
  305.  
  306. ;*** print copyright ***
  307.     lea     dx, copyr
  308.     call    print_msg
  309.  
  310.     call    parse_cmdl      ;parse command-line...
  311.  
  312.     cmp     ax, 0000h       ;display pwd-info...
  313.     je      pwd_info
  314.  
  315.     cmp     ax, 0002h       ;enable supervisor-pwd...
  316.     je      pwd_superenable
  317.  
  318.     cmp     ax, 0001h       ;disable supervisor-pwd...
  319.     je      pwd_superdisable
  320.  
  321.     cmp     ax, 0003h       ;set pwd to system level
  322.     je      pwd_system
  323.  
  324.     cmp     ax, 0004h       ;set pwd to setup level
  325.     je      pwd_setup
  326.     
  327.     cmp     ax, 0006h       ;enable user-pwd...
  328.     je      pwd_userenable
  329.  
  330.     cmp     ax, 0005h       ;disable user-pwd...
  331.     je      pwd_userdisable
  332.  
  333.     jmp     helpscreen 
  334.  
  335. ;*** display pwd-information ***
  336. pwd_info:
  337.     call    show_info       ;show pwd-info...
  338.     jmp     back2dos
  339.  
  340. ;*** set pwd to setup level ***
  341. pwd_setup:
  342.     mov     al, 11h         ;read CMOS-reg. 11h
  343.     call    read_CMOS
  344.     and     al, NOT 1       ;set pwd to setup-level
  345.     mov     ah, al
  346.     mov     al, 11h
  347.     call    write_CMOS      ;write CMOS-reg. 11h
  348.  
  349.     call    do_checksum
  350.  
  351.     lea     dx, pw_2        ;print info-messy
  352.     call    print_msg
  353.     jmp     back2dos
  354.  
  355. ;*** set pwd to system level ***
  356. pwd_system:
  357.     mov     al, 11h         ;read CMOS-reg 11h
  358.     call    read_CMOS
  359.     or      al, 1           ;set pwd to system level
  360.     mov     ah, al
  361.     mov     al, 11h
  362.     call    write_CMOS      ;write CMOS-reg. 11h
  363.  
  364.     call    do_checksum
  365.     
  366.     lea     dx, pw_1        ;print info-messy
  367.     call    print_msg
  368.     jmp     back2dos
  369.  
  370. ;*** enable bios supervisor-password ***
  371. pwd_superenable:
  372.     mov     al, 11h         ;read CMOS-reg 11h
  373.     call    read_CMOS
  374.     or      al, 2           ;enable PWD-bit
  375.     mov     ah, al
  376.     mov     al, 11h         ;write CMOS-reg 11h
  377.     call    write_CMOS
  378.  
  379.     call    do_checksum     ;calculate new CMOS checksum
  380.  
  381.     lea     dx, pw_4        ;print info-messy
  382.     call    print_msg
  383.     jmp     back2dos
  384.  
  385. ;*** disable bios supervisor-password ***
  386. pwd_superdisable:
  387.     mov     al, 11h         ;read CMOS-reg 11h
  388.     call    read_CMOS
  389.     and     al, NOT 2       ;disable PWD-bit
  390.     mov     ah, al
  391.     mov     al, 11h         ;write CMOS-reg 11h
  392.     call    write_CMOS
  393.  
  394.     call    do_checksum     ;calculate new CMOS checksum
  395.  
  396.     lea     dx, pw_3        ;print info-messy
  397.     call    print_msg
  398.     jmp     back2dos
  399.  
  400. ;*** dummy jump ***
  401. pwd_userdisable:
  402.     jmp     real_userdisable
  403.  
  404. ;*** enable bios user-password ***
  405. pwd_userenable:
  406.     mov     al, 5eh         ;read CMOS-reg 5eh
  407.     call    read_CMOS
  408.     or      al, 1           ;enable PWD-bit
  409.     mov     ah, al
  410.     mov     al, 5eh         ;write CMOS-reg 5eh
  411.     call    write_CMOS
  412.  
  413.     call    do_checksum_ext ;calculate new CMOS checksum
  414.  
  415.     lea     dx, pw_6        ;print info-messy
  416.     call    print_msg
  417.     jmp     back2dos
  418.  
  419. ;*** disable bios user-password ***
  420. real_userdisable:
  421.     mov     al, 5eh         ;read CMOS-reg 5eh
  422.     call    read_CMOS
  423.     and     al, NOT 1       ;disable PWD-bit
  424.     mov     ah, al
  425.     mov     al, 5eh         ;write CMOS-reg 5eh
  426.     call    write_CMOS
  427.  
  428.     call    do_checksum_ext ;calculate new CMOS checksum
  429.  
  430.     lea     dx, pw_5        ;print info-messy
  431.     call    print_msg
  432.     jmp     back2dos
  433.  
  434. ;*** write helpscreen ***
  435. helpscreen:
  436.     lea     dx, help        ;print helpscreen
  437.     call    print_msg
  438. ;       jmp     back2dos
  439.  
  440. back2dos:
  441.     .exit 0                 ;back 2 dos
  442.  
  443.     END start
  444.