Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .386
- .Model Flat,stdcall
- ;stale plik
- GENERIC_READ equ 80000000h
- GENERIC_WRITE equ 40000000h
- CREATE_NEW equ 1
- CREATE_ALWAYS equ 2
- OPEN_EXISTING equ 3
- OPEN_ALWAYS equ 4
- ;normal
- WriteConsoleA PROTO:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
- GetStdHandle PROTO:DWORD
- ExitProcess PROTO:DWORD
- ;plik
- ReadFile PROTO :DWORD, :DWORD, :DWORD, :DWORD, :DWORD
- CreateFileA PROTO :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD
- .data
- ;plik
- path byte "C:\Users\Hubert\source\repos\lab07\2\MyFile.txt",0
- handle_plik DWORD 0
- ;normal
- buffor byte 255 dup(0)
- odczytane DWORD 0
- ;wypisz consola
- wypisz DWORD 0
- .code
- main proc
- invoke CreateFileA, offset path,GENERIC_READ,0,0,OPEN_EXISTING,0,0
- mov handle_plik,eax
- invoke ReadFile, handle_plik,offset buffor, lengthof buffor, offset odczytane,0
- invoke GetStdHandle, -11
- mov wypisz,eax
- invoke WriteConsoleA, wypisz,offset buffor, lengthof buffor, offset odczytane,0
- invoke ExitProcess,0
- main endp
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement