summaryrefslogtreecommitdiff
path: root/protocols/Tox/tox/deflibcreator
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-01-03 08:12:27 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-01-03 08:12:27 +0000
commitf1f8a71bd4df7f239e28a9625b82ee02428c3f3f (patch)
tree9bfbccff9826c0cb530805eec4373a1365122201 /protocols/Tox/tox/deflibcreator
parentc42d4e21629ebefaf5a720c5270e77187edfc720 (diff)
Tox: work commit
- removed *.lib and lib generator - disabled profile encryption and import - loading tox profile on connection - project reordering - http proxy support git-svn-id: http://svn.miranda-ng.org/main/trunk@11730 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/tox/deflibcreator')
-rw-r--r--protocols/Tox/tox/deflibcreator/as.exebin792360 -> 0 bytes
-rw-r--r--protocols/Tox/tox/deflibcreator/as64.exebin1510620 -> 0 bytes
-rw-r--r--protocols/Tox/tox/deflibcreator/deflibcreator.exebin77824 -> 0 bytes
-rw-r--r--protocols/Tox/tox/deflibcreator/dlltool.exebin611153 -> 0 bytes
-rw-r--r--protocols/Tox/tox/deflibcreator/dlltool64.exebin1023386 -> 0 bytes
-rw-r--r--protocols/Tox/tox/deflibcreator/link.exebin733440 -> 0 bytes
-rw-r--r--protocols/Tox/tox/deflibcreator/link.exe.manifest11
-rw-r--r--protocols/Tox/tox/deflibcreator/mspdb80.dllbin173056 -> 0 bytes
-rw-r--r--protocols/Tox/tox/deflibcreator/mspdb80.dll.2.manifest11
-rw-r--r--protocols/Tox/tox/deflibcreator/src/build.cmd5
-rw-r--r--protocols/Tox/tox/deflibcreator/src/deflib.manifest8
-rw-r--r--protocols/Tox/tox/deflibcreator/src/deflibcreator.cpp310
-rw-r--r--protocols/Tox/tox/deflibcreator/src/dlc.icobin34494 -> 0 bytes
-rw-r--r--protocols/Tox/tox/deflibcreator/src/resource.rc94
14 files changed, 0 insertions, 439 deletions
diff --git a/protocols/Tox/tox/deflibcreator/as.exe b/protocols/Tox/tox/deflibcreator/as.exe
deleted file mode 100644
index e1b3143100..0000000000
--- a/protocols/Tox/tox/deflibcreator/as.exe
+++ /dev/null
Binary files differ
diff --git a/protocols/Tox/tox/deflibcreator/as64.exe b/protocols/Tox/tox/deflibcreator/as64.exe
deleted file mode 100644
index 4f5095abf8..0000000000
--- a/protocols/Tox/tox/deflibcreator/as64.exe
+++ /dev/null
Binary files differ
diff --git a/protocols/Tox/tox/deflibcreator/deflibcreator.exe b/protocols/Tox/tox/deflibcreator/deflibcreator.exe
deleted file mode 100644
index 5969f5d4c2..0000000000
--- a/protocols/Tox/tox/deflibcreator/deflibcreator.exe
+++ /dev/null
Binary files differ
diff --git a/protocols/Tox/tox/deflibcreator/dlltool.exe b/protocols/Tox/tox/deflibcreator/dlltool.exe
deleted file mode 100644
index 7874bdd13e..0000000000
--- a/protocols/Tox/tox/deflibcreator/dlltool.exe
+++ /dev/null
Binary files differ
diff --git a/protocols/Tox/tox/deflibcreator/dlltool64.exe b/protocols/Tox/tox/deflibcreator/dlltool64.exe
deleted file mode 100644
index 6a41e5228c..0000000000
--- a/protocols/Tox/tox/deflibcreator/dlltool64.exe
+++ /dev/null
Binary files differ
diff --git a/protocols/Tox/tox/deflibcreator/link.exe b/protocols/Tox/tox/deflibcreator/link.exe
deleted file mode 100644
index 5215aecd5d..0000000000
--- a/protocols/Tox/tox/deflibcreator/link.exe
+++ /dev/null
Binary files differ
diff --git a/protocols/Tox/tox/deflibcreator/link.exe.manifest b/protocols/Tox/tox/deflibcreator/link.exe.manifest
deleted file mode 100644
index 2981431665..0000000000
--- a/protocols/Tox/tox/deflibcreator/link.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
-<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
- <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
- <security>
- <requestedPrivileges>
- <requestedExecutionLevel level='asInvoker' uiAccess='false' />
- </requestedPrivileges>
- </security>
- </trustInfo>
-<dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.4940" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity></dependentAssembly></dependency>
-</assembly>
diff --git a/protocols/Tox/tox/deflibcreator/mspdb80.dll b/protocols/Tox/tox/deflibcreator/mspdb80.dll
deleted file mode 100644
index cbe888915c..0000000000
--- a/protocols/Tox/tox/deflibcreator/mspdb80.dll
+++ /dev/null
Binary files differ
diff --git a/protocols/Tox/tox/deflibcreator/mspdb80.dll.2.manifest b/protocols/Tox/tox/deflibcreator/mspdb80.dll.2.manifest
deleted file mode 100644
index 2981431665..0000000000
--- a/protocols/Tox/tox/deflibcreator/mspdb80.dll.2.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
-<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
- <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
- <security>
- <requestedPrivileges>
- <requestedExecutionLevel level='asInvoker' uiAccess='false' />
- </requestedPrivileges>
- </security>
- </trustInfo>
-<dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.4940" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity></dependentAssembly></dependency>
-</assembly>
diff --git a/protocols/Tox/tox/deflibcreator/src/build.cmd b/protocols/Tox/tox/deflibcreator/src/build.cmd
deleted file mode 100644
index abcf258d0a..0000000000
--- a/protocols/Tox/tox/deflibcreator/src/build.cmd
+++ /dev/null
@@ -1,5 +0,0 @@
-@echo off
-rc /d "_UNICODE" /d "UNICODE" /fo".\release\resource.res" resource.rc
-cl /EHsc /DUNICODE /D_UNICODE /Ox /Oi /Ot /DWIN32 /DNDEBUG /nologo /GL /TP /GS /Gz /MD deflibcreator.cpp /link /LTCG /release /manifest:no /Machine:x86 .\release\resource.res /out:.\release\deflibcreator.exe
-del deflibcreator.obj
-del .\release\resource.res \ No newline at end of file
diff --git a/protocols/Tox/tox/deflibcreator/src/deflib.manifest b/protocols/Tox/tox/deflibcreator/src/deflib.manifest
deleted file mode 100644
index 414433b643..0000000000
--- a/protocols/Tox/tox/deflibcreator/src/deflib.manifest
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
-<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
- <dependency>
- <dependentAssembly>
- <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.4940' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
- </dependentAssembly>
- </dependency>
-</assembly>
diff --git a/protocols/Tox/tox/deflibcreator/src/deflibcreator.cpp b/protocols/Tox/tox/deflibcreator/src/deflibcreator.cpp
deleted file mode 100644
index 6480fda7e3..0000000000
--- a/protocols/Tox/tox/deflibcreator/src/deflibcreator.cpp
+++ /dev/null
@@ -1,310 +0,0 @@
-#define WIN32_LEAN_AND_MEAN
-#define _WIN32_WINNT 0x0501
-#include <windows.h>
-#include <dbghelp.h>
-#include <shlwapi.h>
-#include <shellapi.h>
-#include <map>
-#include <set>
-#include <string>
-#include <vector>
-#include <cstring>
-#include <fstream>
-#include <sstream>
-#include <iostream>
-
-#pragma comment(lib, "dbghelp.lib")
-#pragma comment(lib, "shlwapi.lib")
-#pragma comment(lib, "shell32.lib")
-
-// ordinals to names
-typedef std::map<DWORD, std::vector<const char*> > ExportMap;
-
-void GetExports(PVOID pMapping, ExportMap& exports, WORD& imageType)
-{
- ULONG size = 0;
- PIMAGE_NT_HEADERS pHead = ImageNtHeader(pMapping);
- PIMAGE_EXPORT_DIRECTORY pDir = static_cast<PIMAGE_EXPORT_DIRECTORY>(ImageDirectoryEntryToData(pMapping, FALSE, IMAGE_DIRECTORY_ENTRY_EXPORT, &size));
- if(pHead && pDir)
- {
- imageType = pHead->FileHeader.Machine;
- char* base = static_cast<char*>(pMapping);
- DWORD rvaExportDir = reinterpret_cast<char*>(pDir) - base;
- PIMAGE_SECTION_HEADER pSec = NULL;
- PDWORD namesAddr = static_cast<PDWORD>(ImageRvaToVa(pHead, pMapping, pDir->AddressOfNames, &pSec));
- PWORD ordinalAddr = static_cast<PWORD>(ImageRvaToVa(pHead, pMapping, pDir->AddressOfNameOrdinals, &pSec));
- DWORD numFuncs = pDir->NumberOfFunctions;
- DWORD numNames = pDir->NumberOfNames;
- DWORD baseOrd = pDir->Base;
-
- std::set<DWORD> ordinals;
- DWORD lastOrd = baseOrd + numFuncs;
- for(DWORD i = baseOrd; i < lastOrd; ++i)
- {
- ordinals.insert(i);
- }
-
- for(DWORD i = 0; i < numNames; ++i)
- {
- WORD thisZeroBasedOrd = ordinalAddr[i];
- DWORD thisBasedOrd = thisZeroBasedOrd + baseOrd;
- ordinals.erase(thisBasedOrd);
- LPCSTR name = static_cast<LPCSTR>(ImageRvaToVa(pHead, pMapping, namesAddr[i], &pSec));
- exports[thisBasedOrd].push_back(name);
- }
-
- for(std::set<DWORD>::const_iterator iter = ordinals.begin(), end = ordinals.end();
- iter != end;
- ++iter
- )
- {
- exports.insert(std::make_pair(*iter, ExportMap::mapped_type()));
- }
- }
-}
-
-PVOID MapFile(HANDLE hFile, DWORD fileMapPerm, DWORD mappedPerms)
-{
- PVOID base = NULL;
- HANDLE hMap = CreateFileMappingW(
- hFile,
- NULL,
- fileMapPerm,
- 0,
- 0,
- NULL
- );
- if(hMap)
- {
- base = MapViewOfFile(hMap, mappedPerms, 0, 0, 0);
- CloseHandle(hMap);
- }
- return base;
-}
-
-PVOID MapFile(const wchar_t* fileName, DWORD filePerms, DWORD fileMapPerm, DWORD mappedPerms)
-{
- PVOID base = NULL;
- HANDLE hFile = CreateFileW(
- fileName,
- filePerms,
- FILE_SHARE_READ,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
- NULL
- );
- if(hFile != INVALID_HANDLE_VALUE)
- {
- base = MapFile(hFile, fileMapPerm, mappedPerms);
- CloseHandle(hFile);
- }
- return base;
-}
-
-PVOID MapFileRO(const wchar_t* fileName, BOOL image)
-{
- return MapFile(fileName, GENERIC_READ, PAGE_READONLY | (image ? SEC_IMAGE : 0), FILE_MAP_READ);
-}
-
-std::wstring GetFileName(const wchar_t* pFilePath)
-{
- const wchar_t* pAfterSlash = pFilePath, *pSlash = NULL;
- while((pSlash = wcspbrk(pAfterSlash, L"\\/")) != NULL)
- {
- pAfterSlash = pSlash + 1;
- }
- const wchar_t* pDot = wcschr(pAfterSlash, L'.');
- if(pDot != NULL)
- {
- return std::wstring(pAfterSlash, pDot);
- }
- else return std::wstring(pAfterSlash);
-}
-
-std::wstring MakeWString(const char* string)
-{
- size_t reqd = mbstowcs(NULL, string, 0);
- if(reqd != static_cast<size_t>(-1))
- {
- std::wstring str(reqd, 0);
- mbstowcs(&str[0], string, reqd);
- return str;
- }
- return std::wstring(string, string + strlen(string) + 1);
-}
-
-void DoAndWaitForExecution(SHELLEXECUTEINFO& sei)
-{
- if(!ShellExecuteEx(&sei))
- {
- std::wcerr << L"Couldn't execute \"" << sei.lpFile << L'\n';
- }
- else
- {
- WaitForSingleObject(sei.hProcess, INFINITE);
- CloseHandle(sei.hProcess);
- }
-}
-
-void CreateLibs(const std::wstring& defFile, const std::wstring& baseName, const std::wstring& outDir, WORD machineType)
-{
- std::wstring curDir(1000, 0);
- curDir.resize(GetModuleFileName(GetModuleHandle(NULL), &curDir[0], curDir.length()));
- curDir.resize(curDir.find_last_of(L"\\/") + 1);
- SHELLEXECUTEINFO sei = {sizeof(sei), 0};
- sei.fMask = SEE_MASK_NOCLOSEPROCESS;
- sei.hwnd = GetConsoleWindow();
- sei.lpVerb = L"open";
- sei.lpDirectory = outDir.c_str();
-
- // 32-bit libs
- if(machineType == IMAGE_FILE_MACHINE_I386)
- {
- std::wcout << L"Creating 32-bit libs...\n";
- // dlltool for mingw (x86)
- std::wcout << L"\tCreating lib" << baseName << L".a...\n";
- std::wostringstream pstream;
- pstream << L"-d \"" << defFile << L"\" -l lib" << baseName << L".a";
-
- std::wstring binary = curDir + L"dlltool.exe";
- std::wstring parameters = pstream.str();
-
- sei.lpFile = binary.c_str();
- sei.lpParameters = parameters.c_str();
-
- DoAndWaitForExecution(sei);
-
- pstream.str(L"");
-
- // link for msvc (x86)
- std::wcout << L"\tCreating " << baseName << L".lib...\n";
- pstream << L"/lib /nologo /machine:x86 /def:\"" << defFile << "\" /out:\"" << outDir << baseName << L".lib\"";
-
- binary = curDir + L"link.exe";
- parameters = pstream.str();
- sei.lpFile = binary.c_str();
- sei.lpParameters = parameters.c_str();
- DoAndWaitForExecution(sei);
- }
- else
- {
- std::wcout << L"Creating 64-bit libs...\n";
- // dlltool for mingw (x64) (my fail if running on 32-bit comp)
- std::wcout << L"\tlib" << baseName << L"-x64.a...\n";
-
- std::wstring binary = curDir + L"dlltool64.exe";
- std::wstring as64Pos = L"\"";
- as64Pos += (curDir + L"as64.exe\"");
- std::wostringstream pstream;
- pstream << L"-d \"" << defFile << L"\" -S " << as64Pos << L" -l lib" << baseName << L"-x64.a";
-
- std::wstring parameters = pstream.str();
- sei.lpFile = binary.c_str();
- sei.lpParameters = parameters.c_str();
- DoAndWaitForExecution(sei);
-
- pstream.str(L"");
-
- // link for msvc (x64)
- std::wcout << L'\t' << baseName << L"-x64.lib...\n";
- binary = curDir + L"link.exe";
- pstream << L"/lib /nologo /machine:x64 /def:\"" << defFile << "\" /out:\"" << outDir << baseName << L"-x64.lib\"";
- parameters = pstream.str();
- sei.lpFile = binary.c_str();
- sei.lpParameters = parameters.c_str();
- DoAndWaitForExecution(sei);
- }
-}
-
-BOOL CreateDef(LPCWSTR dllFile, const std::wstring& defFile, WORD& machineType)
-{
- std::wcout << L"Creating " << defFile << L"...\n";
- // this is FALSE on purpose. If it's true, some dll's (mainly bcrypt.dll from Vista)
- // fail to map as an image because of some funkyness with the certificate or
- // something (STATUS_INVALID_IMAGE_HASH fyi). So this is just easier
- PVOID pMapping = MapFileRO(dllFile, FALSE);
- if(pMapping)
- {
- ExportMap exports;
- GetExports(pMapping, exports, machineType);
- if(!exports.empty())
- {
- std::wofstream defFile(defFile.c_str());
- std::wostringstream expDetails;
- defFile << L"LIBRARY \"" << GetFileName(dllFile) << L"\"\n\nEXPORTS\n";
- for(ExportMap::const_iterator iter = exports.begin(), end = exports.end();
- iter != end;
- ++iter
- )
- {
- expDetails.str(L"");
- expDetails.clear();
- expDetails << L'\t';
- const ExportMap::mapped_type& names = iter->second;
- if(!names.empty())
- {
- const std::wstring& initialName = MakeWString(*(names.begin()));
- expDetails << initialName << L"\t@" << iter->first << L'\n';
- for(ExportMap::mapped_type::const_iterator namesIter = names.begin() + 1, namesEnd = names.end();
- namesIter != namesEnd;
- ++namesIter
- )
- {
- expDetails << '\t' << MakeWString(*namesIter) << L'=' << initialName << L'\n';
- }
- }
- // unnamed export
- else
- {
- expDetails << L"Ordinal" << iter->first << L" NONAME\t@" << iter->first << L'\n';
- }
- defFile << expDetails.str();
- }
- }
- else
- {
- std::wcerr << dllFile << L" has no exports, nothing to do\n";
- return FALSE;
- }
- UnmapViewOfFile(pMapping);
- }
- return TRUE;
-}
-
-int __cdecl wmain(int argc, wchar_t** argv)
-{
- std::wcout << L"DefLibCreator v1.0 - Airesoft.co.uk\n\n";
- if(argc < 2)
- {
- puts("Usage: DefLibCreator dll [outDir]");
- return 1;
- }
- else
- {
- std::wstring baseFileName = PathFindFileName(argv[1]);
- baseFileName.erase(baseFileName.find_last_of('.'));
- int outDirArg = (argc >= 3) ? 2 : 1;
- LPWSTR pFilePart = NULL;
- std::wstring outDir(GetFullPathName(argv[outDirArg], 0, NULL, NULL), 0);
- outDir.resize(GetFullPathName(argv[outDirArg], outDir.length(), &outDir[0], &pFilePart));
- // if the explicit output dir wasn't specified, we need to chop the dll filename off the end of outDir
- if(outDirArg == 1)
- {
- outDir.resize(pFilePart - outDir.c_str());
- }
- else
- {
- CreateDirectory(outDir.c_str(), NULL);
- }
- outDir.push_back(L'\\'); // ensure it ends with a slash
- std::wstring defFile(outDir);
- defFile += (baseFileName + L".def");
- WORD machineType = 0;
- if(CreateDef(argv[1], defFile, machineType))
- {
- CreateLibs(defFile, baseFileName, outDir, machineType);
- }
- }
- return 0;
-}
diff --git a/protocols/Tox/tox/deflibcreator/src/dlc.ico b/protocols/Tox/tox/deflibcreator/src/dlc.ico
deleted file mode 100644
index aa524c729c..0000000000
--- a/protocols/Tox/tox/deflibcreator/src/dlc.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/Tox/tox/deflibcreator/src/resource.rc b/protocols/Tox/tox/deflibcreator/src/resource.rc
deleted file mode 100644
index 503ec99a76..0000000000
--- a/protocols/Tox/tox/deflibcreator/src/resource.rc
+++ /dev/null
@@ -1,94 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "winresrc.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.K.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""winresrc.h""\r\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
-END
-
-#endif // APSTUDIO_INVOKED
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-1 ICON "dlc.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,0
- PRODUCTVERSION 1,0,0,0
- FILEFLAGSMASK 0x17L
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "080904b0"
- BEGIN
- VALUE "CompanyName", "Airesoft"
- VALUE "FileDescription", "DefLibCreator"
- VALUE "FileVersion", "1, 0, 0, 0"
- VALUE "InternalName", "DefLibCreator.exe"
- VALUE "LegalCopyright", "Copyright (C) Airesoft 2012"
- VALUE "OriginalFilename", "DefLibCreator.exe"
- VALUE "ProductName", "DefLibCreator"
- VALUE "ProductVersion", "1, 0, 0, 0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x809, 1200
- END
-END
-
-#endif // English (U.K.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-/// Manifest
-CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST deflib.manifest \ No newline at end of file