Skip to content

Commit 319c3c6

Browse files
committed
Release: ObfuGuard_V2 – remove 5-byte function limit in manual junk injection mode
1 parent 3c94e6e commit 319c3c6

File tree

16 files changed

+11
-17
lines changed

16 files changed

+11
-17
lines changed

ObfuGuard/junkcode/junkcode.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
// Đặt include theo thứ tự này
2-
#include "junkcode.h"
1+
#include "junkcode.h"
32

4-
// System includes
53
#include <iostream>
64
#include <fstream>
75
#include <vector>
@@ -15,12 +13,10 @@
1513
#include <set>
1614
#define NOMINMAX
1715

18-
// Third-party includes
1916
#include <LIEF/LIEF.hpp>
2017
#include <capstone/capstone.h>
2118
#include <keystone/keystone.h>
2219

23-
// Local includes
2420
#include "../func2rva/func2rva.h"
2521

2622
// Hàm khởi tạo/Hàm huỷ
@@ -1078,7 +1074,7 @@ bool TrampolineInjector::inject_trampoline_to_multiple_functions(
10781074

10791075
// ============ IMPLEMENTATION CỦA JunkCodeManager ============
10801076

1081-
// Static constants moved from main.cpp
1077+
// các hàm nguy hiểm và tiền tố nguy hiểm
10821078
const std::set<std::string> JunkCodeManager::DANGEROUS_FUNCTION_NAMES = {
10831079
"mainCRTStartup","atexit",
10841080
"__scrt_initialize_onexit_tables",
@@ -1098,7 +1094,7 @@ const std::vector<std::string> JunkCodeManager::DANGEROUS_PREFIXES = {
10981094
"??_",
10991095
};
11001096

1101-
// Check if function is blacklisted (moved from main.cpp)
1097+
// Kiểm tra xem tên hàm có bị blacklist hay không
11021098
bool JunkCodeManager::is_function_blacklisted(const std::string& func_name) {
11031099
// Các hàm có ký tự đặc biệt như "_" hoặc "`" thường là các hàm nội bộ hoặc không mong muốn
11041100
if (func_name.find_first_of("`_") != std::string::npos) {
@@ -1124,7 +1120,7 @@ bool JunkCodeManager::is_function_blacklisted(const std::string& func_name) {
11241120
return false;
11251121
}
11261122

1127-
// Sort functions by size descending (moved from main.cpp)
1123+
// sắp xếp các hàm theo kích thước giảm dần
11281124
void JunkCodeManager::sort_functions_by_size_desc(std::vector<uint32_t>& function_rvas,
11291125
std::vector<std::string>& function_names,
11301126
const std::vector<FuncToRVA::FunctionInfo>& all_functions) {
@@ -1166,7 +1162,7 @@ void JunkCodeManager::sort_functions_by_size_desc(std::vector<uint32_t>& functio
11661162
function_names = std::move(sorted_names);
11671163
}
11681164

1169-
// Get multiple RVAs interactively (moved from main.cpp)
1165+
// Lấy nhiều RVAs tương tác từ người dùng
11701166
bool JunkCodeManager::get_multiple_rvas_interactive(const std::string& input_pe_path,
11711167
std::vector<uint32_t>& rvas_out,
11721168
std::vector<std::string>& names_out) {
@@ -1237,7 +1233,7 @@ bool JunkCodeManager::get_multiple_rvas_interactive(const std::string& input_pe_
12371233
}
12381234
}
12391235

1240-
// Filter functions by size (moved from main.cpp)
1236+
// Lọc các hàm theo kích thước tối thiểu
12411237
bool JunkCodeManager::filter_functions_by_size(const std::string& input_pe_path,
12421238
const std::vector<uint32_t>& input_rvas,
12431239
const std::vector<std::string>& input_names,
@@ -1312,7 +1308,7 @@ bool JunkCodeManager::filter_functions_by_size(const std::string& input_pe_path,
13121308
}
13131309
}
13141310

1315-
// Auto injection mode implementation
1311+
// Triển khai chế độ tự động chèn mã
13161312
int JunkCodeManager::run_auto_injection_mode(const std::string& input_pe_path,
13171313
const std::string& output_pe_path,
13181314
bool is_64_bit) {
@@ -1392,7 +1388,7 @@ int JunkCodeManager::run_auto_injection_mode(const std::string& input_pe_path,
13921388
}
13931389
}
13941390

1395-
// Manual injection mode implementation
1391+
// Triển khai chế độ chèn thủ công
13961392
int JunkCodeManager::run_manual_injection_mode(const std::string& input_pe_path,
13971393
const std::string& output_pe_path,
13981394
bool is_64_bit) {

ObfuGuard/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111
#define NOMINMAX
1212
#include <windows.h>
1313

14-
// Local includes - đặt sau system includes
1514
#include "pe/pe.h"
1615
#include "pdbparser/pdbparser.h"
1716
#include "obfuscatecff/obfuscatecff.h"
1817
#include "junkcode/junkcode.h"
1918
#include "func2rva/func2rva.h"
2019

21-
// In ra banner khi sử dụng công cụ
2220
void print_banner() {
2321
std::cout << "========================================\n";
2422
std::cout << " ObfuGuard Tool - sondt \n";
88.3 KB
Binary file not shown.
29.4 KB
Binary file not shown.
21.2 KB
Binary file not shown.

ObfuGuard/x64/Release/ObfuGuard.log

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ D:\vcpkg\installed\x64-windows\include\LIEF\PE\ResourcesManager.hpp(72,15): warn
6666
D:\vcpkg\installed\x64-windows\include\LIEF\PE\LoadConfigurations\LoadConfiguration.hpp(178,12): warning C4244: 'return': conversion from 'const uint64_t' to 'uint32_t', possible loss of data
6767
(compiling source file 'junkcode/junkcode.cpp')
6868

69-
E:\Graduation-Thesis-HUST\ObfuGuard\junkcode\junkcode.cpp(222,51): warning C4244: 'initializing': conversion from 'const int64_t' to 'int32_t', possible loss of data
70-
E:\Graduation-Thesis-HUST\ObfuGuard\junkcode\junkcode.cpp(245,47): warning C4244: 'initializing': conversion from 'const int64_t' to 'int32_t', possible loss of data
69+
E:\Graduation-Thesis-HUST\ObfuGuard\junkcode\junkcode.cpp(228,51): warning C4244: 'initializing': conversion from 'const int64_t' to 'int32_t', possible loss of data
70+
E:\Graduation-Thesis-HUST\ObfuGuard\junkcode\junkcode.cpp(251,47): warning C4244: 'initializing': conversion from 'const int64_t' to 'int32_t', possible loss of data
7171
Generating code
7272
Previous IPDB not found, fall back to full compilation.
73-
All 3047 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
73+
All 3063 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
7474
Finished generating code
7575
ObfuGuard.vcxproj -> E:\Graduation-Thesis-HUST\x64\Release\ObfuGuard-con.exe
7676
'pwsh.exe' is not recognized as an internal or external command,
0 Bytes
Binary file not shown.

ObfuGuard/x64/Release/func2rva.obj

0 Bytes
Binary file not shown.

ObfuGuard/x64/Release/junkcode.obj

514 KB
Binary file not shown.

ObfuGuard/x64/Release/main.obj

-395 KB
Binary file not shown.

0 commit comments

Comments
 (0)