what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

find.asm

find.asm
Posted Dec 15, 2003
Authored by Angelo Rosiello, rosiello | Site rosiello.org

Find file routine for Windows, in asm.

systems | windows
SHA-256 | 0b7f4f98ac3878c2534bdee8d0045cfa8a21c3084b6b3c175293850771857d70

find.asm

Change Mirror Download
; Copyright © 2003 Rosiello Security 
; All rights reserved.
;
; http://www.rosiello.org
; ------------------------------------------------------
; Find utility for Windows.
;
; Fix "COMFILE DB '*.COM',0" when you have
; to look for something different from *.COM files.
; ------------------------------------------------------

TITLE FIND FILES *.COM IN THE LOCAL DIRECTORY

.MODEL SMALL

.STACK 200h

.DATA
COMFILE DB '*.COM',0
CAPO DB 10,13,"$"
DTA DB 1AH dup (?)
.CODE

MAIN SEGMENT BYTE
ASSUME CS:MAIN,DS:MAIN,SS:NOTHING

START:
mov ax, @DATA
mov ds, ax

mov dx,offset dta ;point to temporary DTA buffer
mov ah,1ah ;set new disk transfer area
int 21h ;call dos

CALL FIND_FILE

mov ax,4c00h ;Returns control to DOS
int 21h

FIND_FILE:
mov dx,offset COMFILE
mov cx,3FH ;search for any file, no matter what the attributes
mov ah,4EH ;do DOS search first function
int 21H ;interrupt to DOS

FF_LOOP:
or al,al ;FILE Found ?
jnz EXIT ;no - jump to EXIT

FOUND:
mov bx,offset dta
add bx,30d ;move up to filename
mov cx,12d ;display 12-byte filename

READER:
mov al,[bx] ;get one byte
cmp al,0 ;end of filename reached?
je CONTINUE
mov ah,0eh ;display byte function
int 10h ;call bios Interrupt
inc bx
loop READER

CONTINUE:
mov ah,9
mov dx,offset CAPO
int 21h ;print "\n" after the name of the file

SEARCH_NEXT:
mov ah,4FH ;search for another file
int 21H ;interrupt to dos
jmp FF_LOOP ;go back up and see what happened


EXIT:
mov dx,80H ;fix the DTA
mov ah,1AH
int 21H ;interrupt to DOS
ret

ENDS MAIN
END START
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close