Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphical interface #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions gui-rw-obfuscator/GUI-Obfuscator.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32210.238
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUI-Obfuscator", "GUI-Obfuscator\GUI-Obfuscator.vcxproj", "{0E1EAD0A-13B1-489C-AC9D-1941F9897DCA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0E1EAD0A-13B1-489C-AC9D-1941F9897DCA}.Debug|x64.ActiveCfg = Release|Win32
{0E1EAD0A-13B1-489C-AC9D-1941F9897DCA}.Debug|x64.Build.0 = Release|Win32
{0E1EAD0A-13B1-489C-AC9D-1941F9897DCA}.Debug|x86.ActiveCfg = Debug|Win32
{0E1EAD0A-13B1-489C-AC9D-1941F9897DCA}.Debug|x86.Build.0 = Debug|Win32
{0E1EAD0A-13B1-489C-AC9D-1941F9897DCA}.Release|x64.ActiveCfg = Release|x64
{0E1EAD0A-13B1-489C-AC9D-1941F9897DCA}.Release|x64.Build.0 = Release|x64
{0E1EAD0A-13B1-489C-AC9D-1941F9897DCA}.Release|x86.ActiveCfg = Release|Win32
{0E1EAD0A-13B1-489C-AC9D-1941F9897DCA}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BDA85466-6922-40B4-B170-77FF2E16D675}
EndGlobalSection
EndGlobal
122 changes: 122 additions & 0 deletions gui-rw-obfuscator/GUI-Obfuscator/BinaryIOHelpers.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#pragma once
#include <stdio.h>
#include <tchar.h>
#include <fstream>
#include <iostream>
#include <ctime>


typedef char int8;
typedef short int16;
typedef int int32;
typedef long long int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;
typedef float float32;

uint32
writeInt8(int8 tmp, std::ostream& rw)
{
rw.write(reinterpret_cast <char*> (&tmp), sizeof(int8));
return sizeof(int8);
}

uint32
writeUInt8(uint8 tmp, std::ostream& rw)
{
rw.write(reinterpret_cast <char*> (&tmp), sizeof(uint8));
return sizeof(uint8);
}

uint32
writeInt16(int16 tmp, std::ostream& rw)
{
rw.write(reinterpret_cast <char*> (&tmp), sizeof(int16));
return sizeof(int16);
}

uint32
writeUInt16(uint16 tmp, std::ostream& rw)
{
rw.write(reinterpret_cast <char*> (&tmp), sizeof(uint16));
return sizeof(uint16);
}

uint32
writeInt32(int32 tmp, std::ostream& rw)
{
rw.write(reinterpret_cast <char*> (&tmp), sizeof(int32));
return sizeof(int32);
}

uint32
writeUInt32(uint32 tmp, std::ostream& rw)
{
rw.write(reinterpret_cast <char*> (&tmp), sizeof(uint32));
return sizeof(uint32);
}

uint32
writeFloat32(float32 tmp, std::ostream& rw)
{
rw.write(reinterpret_cast <char*> (&tmp), sizeof(float32));
return sizeof(float32);
}

int8
readInt8(std::istream& rw)
{
int8 tmp;
rw.read(reinterpret_cast <char*> (&tmp), sizeof(int8));
return tmp;
}

uint8
readUInt8(std::istream& rw)
{
uint8 tmp;
rw.read(reinterpret_cast <char*> (&tmp), sizeof(uint8));
return tmp;
}

int16
readInt16(std::istream& rw)
{
int16 tmp;
rw.read(reinterpret_cast <char*> (&tmp), sizeof(int16));
return tmp;
}

uint16
readUInt16(std::istream& rw)
{
uint16 tmp;
rw.read(reinterpret_cast <char*> (&tmp), sizeof(uint16));
return tmp;
}

int32
readInt32(std::istream& rw)
{
int32 tmp;
rw.read(reinterpret_cast <char*> (&tmp), sizeof(int32));
return tmp;
}

uint32
readUInt32(std::istream& rw)
{
uint32 tmp;
rw.read(reinterpret_cast <char*> (&tmp), sizeof(uint32));
return tmp;
}

float32
readFloat32(std::istream& rw)
{
float32 tmp;
rw.read(reinterpret_cast <char*> (&tmp), sizeof(float32));
return tmp;
}
Binary file not shown.
118 changes: 118 additions & 0 deletions gui-rw-obfuscator/GUI-Obfuscator/GUI-Obfuscator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#include "Header.h"
#include "RWObfuscator.hpp"

#include "resource.h"



LRESULT WINAPI WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
// Interface part
LPCWSTR WndClassName = L"MainWindow";

WNDCLASSEX WndClass;
WndClass.cbSize = sizeof(WNDCLASSEX);
WndClass.style = CS_HREDRAW;
WndClass.cbWndExtra = 0;
WndClass.cbClsExtra = 0;
WndClass.hInstance = hInstance;
WndClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClass.hbrBackground = CreateSolidBrush(RGB(245, 245, 245));
WndClass.lpszMenuName = NULL;
WndClass.hIconSm = LoadIcon(WndClass.hInstance, MAKEINTRESOURCE(IDI_ICON1));
WndClass.lpfnWndProc = WndProc;
WndClass.lpszClassName = WndClassName;
RegisterClassEx(&WndClass);

MainFont = CreateFontW(17, 7, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, DEFAULT_PITCH, L"Helvetica");
LabelsFont = CreateFontW(16, 6, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, DEFAULT_PITCH, L"Helvetica");

MainWindow = CreateWindowExW(WS_EX_ACCEPTFILES, WndClassName, L"GUI-Obfuscator", WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, 725, 245, NULL, NULL, hInstance, NULL);

OriginIMGEdit = CreateWindowExW(WS_EX_CLIENTEDGE, L"edit", L"", WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL | ES_READONLY, 150, 40, 525, 26, MainWindow, (HMENU)IMG_ORIGIN_EDIT, hInstance, NULL);
OpenFolder = CreateWindowExW(WS_EX_CLIENTEDGE, L"button", L"Open file ", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 10, 39, 125, 30, MainWindow, (HMENU)Folder_Button, hInstance, NULL);

EncryptedIMGEdit = CreateWindowExW(WS_EX_CLIENTEDGE, L"edit", L"", WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL, 10, 100, 665, 26, MainWindow, (HMENU)IMG_ENCRYPTED_EDIT, hInstance, NULL);

EncryptKeyEdit1 = CreateWindowExW(WS_EX_CLIENTEDGE, L"edit", L"6", WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL, 10, 155, 100, 26, MainWindow, (HMENU)IMG_ENCRYPTED_EDIT, hInstance, NULL);
EncryptKeyEdit2 = CreateWindowExW(WS_EX_CLIENTEDGE, L"edit", L"23", WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL, 135, 155, 100, 26, MainWindow, (HMENU)IMG_ENCRYPTED_EDIT, hInstance, NULL);

EncryptButton = CreateWindowExW(WS_EX_CLIENTEDGE, L"button", L"Run Compile", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 500, 155, 200, 30, MainWindow, (HMENU)ENCRYPT_BUTTON, hInstance, NULL);

const COLORREF backgroundColor = RGB(200, 200, 200);
SetClassLongPtr(MainWindow, GCLP_HBRBACKGROUND, reinterpret_cast<LONG_PTR>(CreateSolidBrush(backgroundColor)));

ShowWindow(MainWindow, nShowCmd);
UpdateWindow(MainWindow);
MSG Message;
while (GetMessage(&Message, NULL, 0, 0))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
// Interface part

return 0;
}


LRESULT WINAPI WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC Writer;
PAINTSTRUCT Pstr;
switch (message)
{
case WM_DESTROY:
PostQuitMessage(0); // ��������� ��������� ���������
break;
case WM_CLOSE:
DestroyWindow(hWnd); // ��������� ����, ��� �������� � WM_DESTROY
break;
case WM_DROPFILES:
{
DWORD Size = DragQueryFileW((HDROP)wParam, 0, NULL, 0);
LPWSTR DroppedFileName = (LPWSTR)malloc(Size * 2 + 2);
DragQueryFileW((HDROP)wParam, 0, DroppedFileName, Size + 1);
SetWindowTextW(OriginIMGEdit, DroppedFileName);
free(DroppedFileName);

return 0;
}
break;
case WM_PAINT:
SendMessageW(OriginIMGEdit, WM_SETFONT, (WPARAM)MainFont, TRUE);
SendMessageW(EncryptedIMGEdit, WM_SETFONT, (WPARAM)MainFont, TRUE);
SendMessageW(EncryptButton, WM_SETFONT, (WPARAM)MainFont, TRUE);
SendMessageW(EncryptButton, WM_SETFONT, (WPARAM)MainFont, TRUE);
SendMessageW(EncryptKeyEdit1, WM_SETFONT, (WPARAM)MainFont, TRUE);
SendMessageW(EncryptKeyEdit2, WM_SETFONT, (WPARAM)MainFont, TRUE);
SendMessageW(OpenFolder, WM_SETFONT, (WPARAM)MainFont, TRUE);

Writer = BeginPaint(hWnd, &Pstr);
SelectObject(Writer, LabelsFont);
SetBkMode(Writer, TRANSPARENT);
TextOutW(Writer, 15, 15, L"Source File", 12);
TextOutW(Writer, 10, 80, L"Save path", 15);
TextOutW(Writer, 10, 135, L" Key Variant", 41);
EndPaint(hWnd, &Pstr);

return 0;
break;
case WM_COMMAND:
if (runFunction(hWnd, wParam))
{
startMission(lPARTS_NUM, lVARIANT_KEY);
return 0;
}

break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}

return 0;
}

58 changes: 58 additions & 0 deletions gui-rw-obfuscator/GUI-Obfuscator/GUI-Obfuscator.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Исходные файлы">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Файлы заголовков">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Файлы ресурсов">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Исходные файлы\LLIEPLLIEHb Module">
<UniqueIdentifier>{f5132650-66f5-42d2-ad26-9337f8f71ce3}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="crypter.h">
<Filter>Исходные файлы\LLIEPLLIEHb Module</Filter>
</ClInclude>
<ClInclude Include="key.h">
<Filter>Исходные файлы\LLIEPLLIEHb Module</Filter>
</ClInclude>
<ClInclude Include="Header.h">
<Filter>Исходные файлы\LLIEPLLIEHb Module</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="GUI-Obfuscator.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Шифратор.rc">
<Filter>Файлы ресурсов</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="small.ico">
<Filter>Файлы ресурсов</Filter>
</Image>
<Image Include="Шифратор.ico">
<Filter>Файлы ресурсов</Filter>
</Image>
</ItemGroup>
</Project>
Binary file not shown.
Loading