exploit the possibilities
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:

December 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Dec 1st
    0 Files
  • 2
    Dec 2nd
    41 Files
  • 3
    Dec 3rd
    0 Files
  • 4
    Dec 4th
    0 Files
  • 5
    Dec 5th
    0 Files
  • 6
    Dec 6th
    0 Files
  • 7
    Dec 7th
    0 Files
  • 8
    Dec 8th
    0 Files
  • 9
    Dec 9th
    0 Files
  • 10
    Dec 10th
    0 Files
  • 11
    Dec 11th
    0 Files
  • 12
    Dec 12th
    0 Files
  • 13
    Dec 13th
    0 Files
  • 14
    Dec 14th
    0 Files
  • 15
    Dec 15th
    0 Files
  • 16
    Dec 16th
    0 Files
  • 17
    Dec 17th
    0 Files
  • 18
    Dec 18th
    0 Files
  • 19
    Dec 19th
    0 Files
  • 20
    Dec 20th
    0 Files
  • 21
    Dec 21st
    0 Files
  • 22
    Dec 22nd
    0 Files
  • 23
    Dec 23rd
    0 Files
  • 24
    Dec 24th
    0 Files
  • 25
    Dec 25th
    0 Files
  • 26
    Dec 26th
    0 Files
  • 27
    Dec 27th
    0 Files
  • 28
    Dec 28th
    0 Files
  • 29
    Dec 29th
    0 Files
  • 30
    Dec 30th
    0 Files
  • 31
    Dec 31st
    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