views:

115

answers:

2

i am trying to read a username and a password from a file in x86 assembly for the perpose of authentication obviously the file consists of two lines , the user name and the password how can i read the two lines seperately and compare them?

My attempt:

proc read_file

  mov ah,3dh
  lea dx,file_name
  int 21h

  mov bx, ax 
  xor si,si

repeat:

  mov ah, 3fh
  lea dx, buffer
  mov cx, 100 
  int 21h

  mov si, ax
  mov buffer[si], '$'
  mov ah, 09h
  int 21h ;print on screen


  cmp si, 100
  je repeat 

  jmp stop;jump to end
stop:
   RET
    read_file ENDP
+1  A: 

Go here and read up on functions like CreateFile and ReadFile.

Jens Björnhager
i beleive this is high level ,i'm talking assembly , but thanks thpugh
Natasha
I believe you said windows 7, and that's as low as it gets.
Jens Björnhager
A: 

You should use system class to do that and it depends on whether you use Windows or Linux. Check this : http://www.freebsd.org/doc/en/books/developers-handbook/x86-system-calls.html

Morano88