forked from vic4key/Vutils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSample.DF.h
More file actions
97 lines (73 loc) · 3.81 KB
/
Sample.DF.h
File metadata and controls
97 lines (73 loc) · 3.81 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#pragma once
#include "Sample.h"
DEF_SAMPLE(DF)
{
const std::tstring FILE_DIR = _T("C:\\Intel\\Logs\\");
const std::tstring FILE_PATH = _T("C:\\Intel\\Logs\\IntelGFX.log");
std::tcout << (vu::IsDirectoryExists(FILE_DIR) ? _T("Directory is exist") : _T("Directory isn't exist")) << std::endl;
std::tcout << (vu::IsFileExists(FILE_PATH) ? _T("File is exist") : _T("File isn't exist")) << std::endl;
std::tcout << vu::FileType(FILE_PATH) << std::endl;
std::tcout << vu::ExtractFileDirectory(FILE_PATH) << std::endl;
std::tcout << vu::ExtractFileDirectory(FILE_PATH, false) << std::endl;
std::tcout << vu::ExtractFileName(FILE_PATH) << std::endl;
std::tcout << vu::ExtractFileName(FILE_PATH, false) << std::endl;
std::tcout << vu::GetCurDirectory() << std::endl;
std::tcout << vu::GetCurDirectory(false) << std::endl;
std::tcout << vu::GetContainDirectory() << std::endl;
std::tcout << vu::GetContainDirectory(false) << std::endl;
std::tcout << vu::GetCurrentFilePath() << std::endl;
std::tcout << vu::JoinPath(_T("C:\\path\\to\\"), _T("\\file.exe")) << std::endl;
std::tcout << vu::JoinPath(_T("C:\\path\\to\\"), _T("file.exe")) << std::endl;
std::tcout << vu::JoinPath(_T("C:\\path\\to"), _T("\\file.exe")) << std::endl;
std::tcout << vu::JoinPath(_T("C:\\path\\to"), _T("file.exe")) << std::endl;
std::tcout << vu::NormalizePath(_T("C:/path/to/file.exe"), vu::ePathSep::POSIX) << std::endl;
std::tcout << vu::NormalizePath(_T("C:\\path\\to\\file.exe"), vu::ePathSep::POSIX) << std::endl;
std::tcout << vu::NormalizePath(_T("C:\\path\\\\to\\file.exe"), vu::ePathSep::POSIX) << std::endl;
std::tcout << vu::NormalizePath(_T("C:\\path\\\\to\\file.exe"), vu::ePathSep::POSIX) << std::endl;
std::tcout << vu::NormalizePath(_T("C:\\\\path\\to/file.exe"), vu::ePathSep::POSIX) << std::endl;
std::tcout << vu::NormalizePath(_T("C:/path/to/file.exe")) << std::endl;
std::tcout << vu::NormalizePath(_T("C:\\path\\to\\file.exe")) << std::endl;
std::tcout << vu::NormalizePath(_T("C:\\path\\\\to\\file.exe")) << std::endl;
std::tcout << vu::NormalizePath(_T("C:\\path\\\\to\\file.exe")) << std::endl;
std::tcout << vu::NormalizePath(_T("C:\\\\path\\to/file.exe")) << std::endl;
vu::CPath fileDir;
fileDir.Join(_T(" C:/Users")).Join(_T("/Vic")).Join(_T("\\.vscode\\")).Finalize();
vu::CPath fileDirTmp = std::tstring(_T("C:/Users/Vic\\.vscode\\extensions"));
vu::CPath filePath(fileDir);
filePath += vu::CPath(_T("argv.json"));
filePath.Finalize();
vu::CPath filePathTmp(fileDir);
filePathTmp = filePathTmp + vu::CPath(_T("argv-tmp.json"));
filePathTmp.Finalize();
std::tcout << fileDir << std::endl;
std::tcout << fileDirTmp << std::endl;
std::tcout << filePath << std::endl;
std::tcout << filePathTmp << std::endl;
std::tcout << (filePath == filePathTmp) << std::endl;
std::tcout << (filePath != filePathTmp) << std::endl;
std::tcout << _T("Exists (Dir) : ") << fileDir.Exists() << std::endl;
std::tcout << _T("Exists (File) : ") << filePath.Exists() << std::endl;
std::tcout << _T("File Name : ") << filePath.FileName().AsString() << std::endl;
std::tcout << _T("File Directory : ") << filePath.FileDirectory().AsString() << std::endl;
// TODO: Vic. Uncompleted.
// #ifdef _WIN64
// #define EXE_NAME _T("x64dbg.exe")
// #else // _WIN32
// #define EXE_NAME _T("x32dbg.exe")
// #endif // _WIN64
//
// auto PIDs = vu::NameToPID(EXE_NAME);
// if (PIDs.empty())
// {
// return 1;
// }
//
// vu::ulong PID = *PIDs.begin();
//
// std::cout << std::hex << vu::RemoteGetModuleHandleA(PID, "kernel32.dll") << std::endl;
// std::tcout << vu::LastError().c_str() << std::endl;
//
// std::wcout << std::hex << vu::RemoteGetModuleHandleW(PID, L"kernel32.dll") << std::endl;
// std::tcout << vu::LastError().c_str() << std::endl;
return vu::VU_OK;
}