从汇编中的文件读取 [英] reading from File in assembly
本文介绍了从汇编中的文件读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试从x86程序集中的文件中读取用户名和密码,以进行身份验证 显然文件由两行组成,用户名和密码,我如何分别读取这两行并进行比较?
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?
我的尝试:
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
推荐答案
您应该使用系统类来做到这一点,这取决于您使用Windows还是Linux. 检查以下内容: http://www.freebsd .org/doc/en/books/developers-handbook/x86-system-calls.html
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
这篇关于从汇编中的文件读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文