Compare commits

...
6 Commits
Author SHA1 Message Date
PYDT 316882bcd0 Add files via upload 2024-10-03 02:27:09 +08:00
PYDT b204e52297 Update README_zh_CN.md 2024-10-02 21:58:55 +08:00
PYDT f82a63f4c8 Update README_zh_TW.md 2024-10-02 21:58:40 +08:00
PYDT cb0f2108a4 Update README.md 2024-10-02 21:58:12 +08:00
PYDT 300b7a7a68 Add files via upload 2024-10-02 12:30:44 +08:00
PYDT c3852ca60d Add files via upload 2024-10-02 12:00:37 +08:00
7 changed files with 50 additions and 37 deletions

No files matched your search

+1 -1
View File
@@ -5,5 +5,5 @@
"Pixels": [224, 224],
"Values": 90
"Values": 95
}
Binary file not shown.
+10 -10
View File
@@ -1369,14 +1369,14 @@ class MainWindow_Controller(QMainWindow):
def memory_scan(self, p):
try:
match_data = {}
kernel32 = ctypes.windll.kernel32
base_address = self.get_module_base(p)
process_handle = ctypes.windll.kernel32.OpenProcess(0x1F0FFF, False, p.pid)
process_handle = kernel32.OpenProcess(0x1F0FFF, False, p.pid)
dos_header = ctypes.create_string_buffer(64)
ctypes.windll.kernel32.ReadProcessMemory(process_handle,
ctypes.c_void_p(base_address), dos_header, 64, None)
kernel32.ReadProcessMemory(process_handle, ctypes.c_void_p(base_address), dos_header, 64, None)
nt_headers_offset = struct.unpack("<I", dos_header[0x3C:0x3C + 4])[0]
nt_headers = ctypes.create_string_buffer(248)
ctypes.windll.kernel32.ReadProcessMemory(process_handle,
kernel32.ReadProcessMemory(process_handle,
ctypes.c_void_p(base_address + nt_headers_offset), nt_headers, 248, None)
number_of_sections = struct.unpack("<H", nt_headers[6:8])[0]
optional_header_size = struct.unpack("<H", nt_headers[20:22])[0]
@@ -1384,19 +1384,19 @@ class MainWindow_Controller(QMainWindow):
for i in range(number_of_sections):
section_header = ctypes.create_string_buffer(40)
section_address = base_address + section_headers_offset + i * 40
ctypes.windll.kernel32.ReadProcessMemory(process_handle,
kernel32.ReadProcessMemory(process_handle,
ctypes.c_void_p(section_address), section_header, 40, None)
section_name = section_header[:8].rstrip(b'\x00').decode()
virtual_address = struct.unpack("<I", section_header[12:16])[0]
section_name = section_header[:8].rstrip(b'\x00').decode('latin1')
virtual_size = struct.unpack("<I", section_header[8:12])[0]
virtual_address = struct.unpack("<I", section_header[12:16])[0]
characteristics = struct.unpack("<I", section_header[36:40])[0]
text_address = base_address + virtual_address
buffer = ctypes.create_string_buffer(virtual_size)
if ctypes.windll.kernel32.ReadProcessMemory(process_handle, ctypes.c_void_p(text_address),
buffer, virtual_size, ctypes.byref(ctypes.c_size_t(0))) and characteristics & 0x00000020:
if kernel32.ReadProcessMemory(process_handle, ctypes.c_void_p(text_address), buffer,
virtual_size, ctypes.byref(ctypes.c_size_t(0))) and characteristics & 0x00000020:
if not any(shell in section_name.lower() for shell in self.model.shells):
match_data[section_name] = buffer.raw
ctypes.windll.kernel32.CloseHandle(process_handle)
kernel32.CloseHandle(process_handle)
if self.start_scan(match_data):
return True
return False
+9 -8
View File
@@ -36,8 +36,6 @@ class YRScan:
class DLScan:
def __init__(self):
self.models = {}
self.detect = []
self.values = 0
self.shells = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!o',
'cry', 'test', 'ace', 'yg', 'obr', 'tvm', 'dec', 'enc', 'b1_', 'base',
'bss', 'clr_uef', 'cursors', 'trs_age', 'engine', 'enigma', 'protect',
@@ -56,14 +54,16 @@ class DLScan:
self.class_names = json.load(f)
elif ftype in [".onnx"]:
self.models[file_path] = onnxruntime.InferenceSession(file_path)
self.values = self.class_names['Values']
self.labels = self.class_names['Labels']
self.detect = self.class_names['Detect']
except:
self.pixels = self.class_names['Pixels']
self.values = self.class_names['Values']
except Exception as e:
pass
def dl_scan(self, file_data):
try:
target_size, sim = tuple(self.class_names['Pixels']), {}
target_size, sim = tuple(self.pixels), {}
image = self.preprocess_image(file_data, target_size)
image_array = numpy.array(image).astype('float32') / 255.0
image_expand = numpy.expand_dims(image_array, axis=0)
@@ -71,14 +71,15 @@ class DLScan:
input_name = model.get_inputs()[0].name
pre_answer = model.run(None, {input_name: image_expand})[0][0]
number = numpy.argmax(pre_answer)
label = self.class_names['Labels'][number].replace("\n", "")
label = self.labels[number].replace("\n", "")
sim[label] = sim.setdefault(label, 0) + pre_answer[number]
for local_label, sim_sum in sim.items():
if sim_sum > len(self.models) / 2:
local_level = sim_sum / len(self.models)
print(local_label, local_level * 100)
return local_label, local_level * 100
return False, False
except:
except Exception as e:
return False, False
def get_type(self, file_path):
@@ -88,7 +89,7 @@ class DLScan:
if ftype in [".exe", ".dll", ".sys", ".scr", ".com"]:
with pefile.PE(file_path, fast_load=True) as pe:
for section in pe.sections:
section_name = section.Name.decode().strip('\x00')
section_name = section.Name.rstrip(b'\x00').decode('latin1')
if (section.Characteristics & 0x00000020 and not
any(shell in section_name.lower() for shell in self.shells)):
match_data[section_name] = section.get_data()
+10 -6
View File
@@ -11,12 +11,16 @@
## Requirements
```
psutil==5.9.5
pefile==2023.2.7
requests==2.31.0
pyperclip==1.8.2
pywin32==306
PyQt5==5.15.9
pip install psutil==5.9.5
pip install pefile==2023.2.7
pip install requests==2.31.0
pip install pyperclip==1.8.2
pip install pywin32==306
pip install PyQt5==5.15.9
pip install yara-python==4.5.1
pip install numpy==2.1.1
pip install onnxruntime==1.18.1
pip install pillow==10.4.0
```
## File Information
+10 -6
View File
@@ -5,12 +5,16 @@
## 安装要求
```
psutil==5.9.5
pefile==2023.2.7
requests==2.31.0
pyperclip==1.8.2
pywin32==306
PyQt5==5.15.9
pip install psutil==5.9.5
pip install pefile==2023.2.7
pip install requests==2.31.0
pip install pyperclip==1.8.2
pip install pywin32==306
pip install PyQt5==5.15.9
pip install yara-python==4.5.1
pip install numpy==2.1.1
pip install onnxruntime==1.18.1
pip install pillow==10.4.0
```
## 文件信息
+10 -6
View File
@@ -5,12 +5,16 @@
## 安裝要求
```
psutil==5.9.5
pefile==2023.2.7
requests==2.31.0
pyperclip==1.8.2
pywin32==306
PyQt5==5.15.9
pip install psutil==5.9.5
pip install pefile==2023.2.7
pip install requests==2.31.0
pip install pyperclip==1.8.2
pip install pywin32==306
pip install PyQt5==5.15.9
pip install yara-python==4.5.1
pip install numpy==2.1.1
pip install onnxruntime==1.18.1
pip install pillow==10.4.0
```
## 檔案資訊