diff --git a/.gitignore b/.gitignore index aa7bac3..a8fd5d7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ main.obj main.exe sha-256.obj .vscode/tasks.json.etalon +sha-256.dll diff --git a/sha-256.asm b/sha-256.asm index c560bef..1c43282 100644 --- a/sha-256.asm +++ b/sha-256.asm @@ -6,19 +6,32 @@ includelib includes\user32.lib OPTION PROLOGUE:none OPTION EPILOGUE:none .data -AppName db "DLL Skeleton",0 -HelloMsg db "Hello, you're calling a function in this DLL",0 -LoadMsg db "The DLL is loaded",0 -UnloadMsg db "The DLL is unloaded",0 -SHAMsg db "SHA256 is started",0 +AppName dw 0044h,004ch,004ch,0020h,0053h,006bh,0065h,006ch,0065h,0074h,006fh,006eh,0000h +HelloMsg dw 0412h,044bh,0437h,0432h,0430h,043dh,0430h,0020h,0444h,0443h,043dh,043ah,0446h,0438h,044fh,0020h,0054h,0065h,0073h,0074h,0048h,0065h,006ch,006ch,006fh,0000h +LoadMsg dw 0044h,004ch,004ch,0020h,0417h,0430h,0433h,0440h,0443h,0436h,0435h,043dh,0430h,0000h +UnloadMsg dw 0044h,004ch,004ch,0020h,0432h,044bh,0433h,0440h,0443h,0436h,0435h,043dh,0430h,0000h +SHAMsg dw 0053h,0048h,0041h,0032h,0035h,0036h,0020h,0417h,0430h,043fh,0443h,0449h,0435h,043dh,0430h,0021h,0000h ;"SHA256 Запущена!" +DllAtata dw 041dh,0435h,043eh,0436h,0438h,0434h,0430h,043dh,043dh,043eh,0020h,043fh,0440h,0438h,043bh,0435h,0442h,0435h,043bh,0020h,0044h,004ch,004ch,005fh,0054h,0048h,0052h,0045h,0041h,0044h,005fh,0041h,0054h,0054h,0041h,0043h,0048h,0000h +DllDetata dw 041dh,0435h,043eh,0436h,0438h,0434h,0430h,043dh,043dh,043eh,0020h,043fh,0440h,0438h,043bh,0435h,0442h,0435h,043bh,0020h,0044h,004ch,004ch,005fh,0050h,0052h,004fh,0043h,0045h,0053h,0053h,005fh,0044h,0045h,0054h,0041h,0043h,0048h,0000h .code DllMain proc hInstDLL:QWORD, reason:QWORD, unused:QWORD + ;push rbp + ;mov rbp,rsp sub rsp,28h .if edx==DLL_PROCESS_ATTACH lea rdx,LoadMsg - jmp exit .elseif edx==DLL_PROCESS_DETACH lea rdx,UnloadMsg + .elseif edx==DLL_THREAD_ATTACH + ;lea rdx,DllAtata + add rsp,28h + xor rax,rax + ret + .elseif edx==DLL_THREAD_DETACH + ;lea rdx,DllDetata + add rsp,28h + xor rax,rax + ret .endif mov r9d,MB_OK jmp exit @@ -29,7 +42,9 @@ TestHello proc mov r9d,MB_OK + MB_ICONERROR exit:: lea r8,AppName xor rcx,rcx - call MessageBox + call MessageBoxW + ;mov rsp,rbp + ;pop rbp add rsp,28h mov rax,TRUE ret @@ -39,11 +54,11 @@ sub rsp,28h ;Основа lea rdx,SHAMsg mov r9d,MB_OK + MB_ICONERROR - lea r8,AppName + lea r8,SHAMsg xor ecx,ecx call MessageBoxW add rsp,28h - mov rax,TRUE + xor rax,rax ret Sha256 Endp end \ No newline at end of file diff --git a/sha-256.dll b/sha-256.dll index 63b7b79..ffaffed 100644 Binary files a/sha-256.dll and b/sha-256.dll differ