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:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close