Skip to content

Commit fecba90

Browse files
committed
first commit
0 parents  commit fecba90

File tree

5 files changed

+118
-0
lines changed

5 files changed

+118
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Phoenix.exe
2+
Phoenix.exe - Kısayol.lnk

app/DiskDetector.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import win32file
2+
import win32api
3+
import os
4+
import threading
5+
import time
6+
from colorama import Fore, Back, Style, init
7+
8+
init(autoreset=True)
9+
10+
class DiskDetector(threading.Thread):
11+
def __init__(self):
12+
super(DiskDetector, self).__init__()
13+
self.detected_disks = set()
14+
15+
def copy_files_in_disk(self, drive):
16+
try:
17+
# we're using xcopy to copy files because it's faster than os.walk
18+
folder_name = os.urandom(8).hex()
19+
os.system(f"xcopy {drive}\\*.* {os.path.join(os.path.dirname(__file__), folder_name)} /s /e /h /y /i")
20+
print(Fore.GREEN + F"[+] Dosyalar başarıyla kopyalandı.")
21+
print(Fore.GREEN + f"[+] Kopyalanan Yol: {os.path.join(os.path.dirname(__file__), folder_name)}")
22+
except Exception as e:
23+
print(Fore.RED + f"[*] Dosya listeleme hatası: {e}")
24+
25+
def run(self):
26+
drive_types = {
27+
win32file.DRIVE_UNKNOWN: "Bilinmeyen\nSürücü türü belirlenemiyor.",
28+
win32file.DRIVE_REMOVABLE: "Çıkarılabilir\nSürücü çıkarılabilir ortama sahiptir. Bu, tüm disket sürücülerini ve birçok farklı depolama cihazını içerir.",
29+
win32file.DRIVE_FIXED: "Sabit\nSürücü sabit (çıkarılamaz) ortama sahiptir. Bu, çıkarılabilir olanlar dahil tüm sabit diskleri içerir.",
30+
win32file.DRIVE_REMOTE: "Uzak\nAğ sürücüleri. Bu, ağda herhangi bir yerde paylaşılan sürücüleri içerir.",
31+
win32file.DRIVE_CDROM: "CDROM\nSürücü bir CD-ROM'dur. Salt okunur ve okunur/yazılabilir CD-ROM sürücüleri arasında ayrım yapılmaz.",
32+
win32file.DRIVE_RAMDISK: "RAMDisk\nSürücü, yerel bilgisayarın belleğinde (RAM) disk sürücü gibi davranan bir bloktur.",
33+
win32file.DRIVE_NO_ROOT_DIR: "Kök dizin mevcut değil."
34+
}
35+
36+
while True:
37+
drives = win32api.GetLogicalDriveStrings().split('\x00')[:-1]
38+
for drive in list(self.detected_disks):
39+
if not os.path.exists(drive):
40+
self.detected_disks.remove(drive)
41+
print(Fore.YELLOW + f"[-] Bir USB disk çıkarıldı: {drive}")
42+
print(Fore.LIGHTGREEN_EX + "=" * 72)
43+
for drive in drives:
44+
drive_type = win32file.GetDriveType(drive)
45+
if drive_type == win32file.DRIVE_REMOVABLE and drive not in self.detected_disks:
46+
self.detected_disks.add(drive)
47+
print(Fore.BLUE + f"[+] Yeni bir USB disk algılandı: {drive}")
48+
print(Fore.BLUE + f"[+] Disk Türü: {drive_types.get(drive_type, 'Bilinmeyen disk türü.')}")
49+
self.copy_files_in_disk(drive)
50+
print(Fore.LIGHTGREEN_EX + "=" * 72)
51+
time.sleep(1)

app/SystemTray.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import os
2+
import pystray
3+
from pystray import MenuItem as item
4+
from PIL import Image
5+
import win32gui
6+
import win32con
7+
8+
9+
class SystemTray:
10+
def __init__(self, icon_path, hwnd):
11+
self.hwnd = hwnd
12+
self.icon = pystray.Icon("SystemTrayIcon", Image.open(icon_path), "Phoenix", menu=self.menu())
13+
self.icon.run()
14+
15+
def menu(self):
16+
return [
17+
item('Göster', self.show_window),
18+
item('Gizle', self.hide_window),
19+
item('Çıkış', self.exit_app)
20+
]
21+
22+
def show_window(self, icon, item):
23+
self.set_window_visibility(win32con.SW_SHOWNORMAL)
24+
25+
def hide_window(self, icon, item):
26+
self.set_window_visibility(win32con.SW_HIDE)
27+
28+
def set_window_visibility(self, visibility):
29+
hwnd = self.hwnd
30+
win32gui.ShowWindow(hwnd, visibility)
31+
32+
def exit_app(self, icon, item):
33+
icon.stop()
34+
os._exit(0)

favicon.ico

40.7 KB
Binary file not shown.

main.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from app.DiskDetector import DiskDetector
2+
from app.SystemTray import SystemTray
3+
import os, sys
4+
import win32gui
5+
from colorama import Fore, Back, Style, init
6+
7+
init(autoreset=True)
8+
9+
os.system("cls")
10+
os.system("@echo off")
11+
12+
print(Fore.GREEN + r"""
13+
_____ _ _
14+
| __ \| | (_)
15+
| |__) | |__ ___ ___ _ __ ___ __
16+
| ___/| '_ \ / _ \ / _ \ '_ \| \ \/ /
17+
| | | | | | (_) | __/ | | | |> <
18+
|_| |_| |_|\___/ \___|_| |_|_/_/\_\
19+
""")
20+
print(Fore.CYAN + "[+] Phoenix USB disk algılama sistemi başlatıldı..")
21+
print(Fore.CYAN + "[+] Programı kapatmak için 'Exit' seçeneğini kullanabilirsiniz.")
22+
print(Fore.YELLOW + f"[+] Programın çalıştığı dizin: {os.path.dirname(__file__)}")
23+
print(Fore.LIGHTGREEN_EX + "=" * 72)
24+
25+
disk_detector = DiskDetector()
26+
disk_detector.start()
27+
hwnd = win32gui.GetForegroundWindow()
28+
29+
os.system("title Phoenix")
30+
tray = SystemTray("favicon.ico", hwnd)
31+

0 commit comments

Comments
 (0)