add: pas sûr de ce que sa fait

This commit is contained in:
Jérémy 2025-04-30 17:05:01 +02:00
parent 60a502fded
commit 0acb0f46b5
4 changed files with 59 additions and 6 deletions

54
dir_sans_gui.asm Normal file
View file

@ -0,0 +1,54 @@
.386
.model flat,stdcall
option casemap:none
WinMain proto :DWORD
include c:\masm32\include\windows.inc
include c:\masm32\include\gdi32.inc
include c:\masm32\include\gdiplus.inc
include c:\masm32\include\user32.inc
include c:\masm32\include\kernel32.inc
includelib c:\masm32\lib\kernel32.lib
includelib c:\masm32\lib\gdi32.lib
includelib c:\masm32\lib\user32.lib
.DATA
ClassName db "C:\Users\jerem\Desktop\Save\Cour\2024-2025\Assembleur\td1\projet\",0
.DATA?
hInstance HINSTANCE ?
.CODE
; Dev un DIR \s sans GUI
; 1. Afficher la liste des fichier présent dans le terminal (sans GUI)
start:
push ebp
mov ebp, esp
mov eax, [ebp+8] ; Get the first argument (directory path)
invoke FindFirstFile, ClassName, eax
mov hInstance, eax ; Store the handle to the first file
boucle:
invoke FindNextFile, hInstance, eax ; Get the next file in the directory
cmp eax, 0 ; Check if there are more files
je fin ; If no more files, exit the loop
; Display the file name in the console
invoke ctr_printf, "%s\n", eax
jmp boucle ; Repeat for the next file
fin:
invoke FindClose, hInstance ; Close the file handle
push 0
call ExitProcess
end start