├── README.md ├── ShellCode ├── FunctionOrder.txt ├── MYLZ4.cpp ├── MYLZ4.h ├── MY_API.cpp ├── ShellCode.cpp ├── ShellCode.sln ├── ShellCode.vcxproj ├── ShellCode.vcxproj.filters ├── ShellCode.vcxproj.user ├── TOOL.h ├── To64.cpp ├── To64.h ├── X64.asm ├── X86.asm ├── lz4.cpp ├── lz4.h ├── lz4压缩使用示例.cpp ├── mpafile └── x64 │ └── Debug │ ├── ShellCodeBuild.exe │ └── ShellCodeBuild.pdb └── ShellCodeBuild ├── 1.bin ├── C_ToShell.cpp ├── C_ToShell.h ├── Debug ├── ShellCodeBuild.exe.recipe └── ShellCodeBuild.vcxproj.FileListAbsolute.txt ├── PE_TOOL.cpp ├── PE_TOOL.h ├── ShellCodeBuild.cpp ├── ShellCodeBuild.vcxproj ├── ShellCodeBuild.vcxproj.filters ├── ShellCodeBuild.vcxproj.user ├── ShellLoader.h ├── lz4.cpp ├── lz4.h └── x64 └── Debug ├── C_ToShell.obj ├── PE_TOOL.obj ├── ShellCodeBuild.exe.recipe ├── ShellCodeBuild.ilk ├── ShellCodeBuild.log ├── ShellCodeBuild.obj ├── ShellCodeBuild.tlog ├── CL.command.1.tlog ├── CL.read.1.tlog ├── CL.write.1.tlog ├── ShellCodeBuild.lastbuildstate ├── link.command.1.tlog ├── link.read.1.tlog └── link.write.1.tlog ├── ShellCodeBuild.vcxproj.FileListAbsolute.txt ├── lz4.obj ├── vc142.idb └── vc142.pdb /README.md: -------------------------------------------------------------------------------- 1 | 这是一个shellcode简单的示例demo,使目标exe程序转换为shellcode可执行程序的一个demo【并不打算后期维护】,两年前写的,我发现被工作磨平了对技术的探索,今天翻到发现的。 2 | 3 | # 编译 4 | 1. 打开Shellcode中的.sln文件 5 | 2. 对shellcode进行生成。 6 | 3. 打开x96Dbg 找到Messagebox中EntryPoint(); 进入其中。 7 | 4. 使用鼠标将从进入EntryPoint()函数后所有的shellcode直到Mian中看到Messagebox前全部选中,右键导出shellcode形式 8 | 5. 恭喜你提取到了shellcode 9 | 6. 该项目配备了一个shellcodeBuild 是使用shellcode 做创建的。 10 | 7. ShellcodeBuild主要是使用Shellcode 作为引导加载exe【比如DHL】。 11 | 8. 注意该shellcode只做了简单重定位区段修复,不能加载较为复杂的程序,仅供学习使用 12 | 13 | -------------------------------------------------------------------------------- /ShellCode/FunctionOrder.txt: -------------------------------------------------------------------------------- 1 | ?EntryPoint@@YAXXZ 2 | ?GetFunAddrByHash@@YAHHPAUHINSTANCE__@@@Z 3 | ?Hash_CmpString@@YA_NPADH@Z 4 | ?MemZero@@YAXPAEH@Z -------------------------------------------------------------------------------- /ShellCode/MYLZ4.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCode/MYLZ4.cpp -------------------------------------------------------------------------------- /ShellCode/MYLZ4.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef _1 4 | 5 | 6 | 7 | 8 | #define MEMORY_USAGE 14 9 | 10 | 11 | 12 | 13 | /* 14 | * HEAPMODE : 15 | * Select how default compression functions will allocate memory for their hash table, 16 | * in memory stack (0:default, fastest), or in memory heap (1:requires memory allocation (malloc)). 17 | */ 18 | #define HEAPMODE 0 19 | 20 | 21 | /************************************** 22 | CPU Feature Detection 23 | **************************************/ 24 | /* 32 or 64 bits ? */ 25 | #if (defined(__x86_64__) || defined(_M_X64) || defined(_WIN64) \ 26 | || defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) \ 27 | || defined(__64BIT__) || defined(_LP64) || defined(__LP64__) \ 28 | || defined(__ia64) || defined(__itanium__) || defined(_M_IA64) ) /* Detects 64 bits mode */ 29 | # define LZ4_ARCH64 1 30 | #else 31 | # define LZ4_ARCH64 0 32 | #endif 33 | 34 | /* 35 | * Little Endian or Big Endian ? 36 | * Overwrite the #define below if you know your architecture endianess 37 | */ 38 | #if defined (__GLIBC__) 39 | # include 40 | # if (__BYTE_ORDER == __BIG_ENDIAN) 41 | # define LZ4_BIG_ENDIAN 1 42 | # endif 43 | #elif (defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN) || defined(_BIG_ENDIAN)) && !(defined(__LITTLE_ENDIAN__) || defined(__LITTLE_ENDIAN) || defined(_LITTLE_ENDIAN)) 44 | # define LZ4_BIG_ENDIAN 1 45 | #elif defined(__sparc) || defined(__sparc__) \ 46 | || defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) \ 47 | || defined(__hpux) || defined(__hppa) \ 48 | || defined(_MIPSEB) || defined(__s390__) 49 | # define LZ4_BIG_ENDIAN 1 50 | #else 51 | /* Little Endian assumed. PDP Endian and other very rare endian format are unsupported. */ 52 | #endif 53 | 54 | /* 55 | * Unaligned memory access is automatically enabled for "common" CPU, such as x86. 56 | * For others CPU, such as ARM, the compiler may be more cautious, inserting unnecessary extra code to ensure aligned access property 57 | * If you know your target CPU supports unaligned memory access, you want to force this option manually to improve performance 58 | */ 59 | #if defined(__ARM_FEATURE_UNALIGNED) 60 | # define LZ4_FORCE_UNALIGNED_ACCESS 1 61 | #endif 62 | 63 | /* Define this parameter if your target system or compiler does not support hardware bit count */ 64 | #if defined(_MSC_VER) && defined(_WIN32_WCE) /* Visual Studio for Windows CE does not support Hardware bit count */ 65 | # define LZ4_FORCE_SW_BITCOUNT 66 | #endif 67 | 68 | /* 69 | * BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE : 70 | * This option may provide a small boost to performance for some big endian cpu, although probably modest. 71 | * You may set this option to 1 if data will remain within closed environment. 72 | * This option is useless on Little_Endian CPU (such as x86) 73 | */ 74 | 75 | /* #define BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE 1 */ 76 | 77 | 78 | /************************************** 79 | Compiler Options 80 | **************************************/ 81 | #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ 82 | /* "restrict" is a known keyword */ 83 | #else 84 | # define restrict /* Disable restrict */ 85 | #endif 86 | 87 | #ifdef _MSC_VER /* Visual Studio */ 88 | # define FORCE_INLINE static __forceinline 89 | # include /* For Visual 2005 */ 90 | # if LZ4_ARCH64 /* 64-bits */ 91 | # pragma intrinsic(_BitScanForward64) /* For Visual 2005 */ 92 | # pragma intrinsic(_BitScanReverse64) /* For Visual 2005 */ 93 | # else /* 32-bits */ 94 | # pragma intrinsic(_BitScanForward) /* For Visual 2005 */ 95 | # pragma intrinsic(_BitScanReverse) /* For Visual 2005 */ 96 | # endif 97 | # pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ 98 | #else 99 | # ifdef __GNUC__ 100 | # define FORCE_INLINE static inline __attribute__((always_inline)) 101 | # else 102 | # define FORCE_INLINE static inline 103 | # endif 104 | #endif 105 | 106 | #ifdef _MSC_VER /* Visual Studio */ 107 | # define lz4_bswap16(x) _byteswap_ushort(x) 108 | #else 109 | # define lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))) 110 | #endif 111 | 112 | #define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) 113 | 114 | #if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__) 115 | # define expect(expr,value) (__builtin_expect ((expr),(value)) ) 116 | #else 117 | # define expect(expr,value) (expr) 118 | #endif 119 | 120 | #define likely(expr) expect((expr) != 0, 1) 121 | #define unlikely(expr) expect((expr) != 0, 0) 122 | 123 | 124 | /************************************** 125 | Memory routines 126 | **************************************/ 127 | #include /* malloc, calloc, free */ 128 | #define ALLOCATOR(n,s) calloc(n,s) 129 | #define FREEMEM free 130 | #include /* memset, memcpy */ 131 | #define MEM_INIT memset 132 | 133 | 134 | /************************************** 135 | Includes 136 | **************************************/ 137 | #include "lz4.h" 138 | 139 | #include 140 | 141 | 142 | /************************************** 143 | Basic Types 144 | **************************************/ 145 | #if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ 146 | 147 | //#include "lz4.cpp" 148 | typedef uint8_t BYTE; 149 | typedef uint16_t U16; 150 | typedef uint32_t U32; 151 | typedef int32_t S32; 152 | typedef uint64_t U64; 153 | #else 154 | 155 | typedef unsigned char BYTE; 156 | typedef unsigned short U16; 157 | typedef unsigned int U32; 158 | typedef signed int S32; 159 | typedef unsigned long long U64; 160 | #endif 161 | 162 | #if defined(__GNUC__) && !defined(LZ4_FORCE_UNALIGNED_ACCESS) 163 | # define _PACKED __attribute__ ((packed)) 164 | #else 165 | # define _PACKED 166 | #endif 167 | 168 | #if !defined(LZ4_FORCE_UNALIGNED_ACCESS) && !defined(__GNUC__) 169 | # if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) 170 | # pragma pack(1) 171 | # else 172 | # pragma pack(push, 1) 173 | # endif 174 | #endif 175 | 176 | typedef struct { U16 v; } _PACKED U16_S; 177 | typedef struct { U32 v; } _PACKED U32_S; 178 | typedef struct { U64 v; } _PACKED U64_S; 179 | typedef struct { size_t v; } _PACKED size_t_S; 180 | 181 | #if !defined(LZ4_FORCE_UNALIGNED_ACCESS) && !defined(__GNUC__) 182 | # if defined(__SUNPRO_C) || defined(__SUNPRO_CC) 183 | # pragma pack(0) 184 | # else 185 | # pragma pack(pop) 186 | # endif 187 | #endif 188 | 189 | #define A16(x) (((U16_S *)(x))->v) 190 | #define A32(x) (((U32_S *)(x))->v) 191 | #define A64(x) (((U64_S *)(x))->v) 192 | #define AARCH(x) (((size_t_S *)(x))->v) 193 | 194 | 195 | /************************************** 196 | Constants 197 | **************************************/ 198 | #define LZ4_HASHLOG (MEMORY_USAGE-2) 199 | #define HASHTABLESIZE (1 << MEMORY_USAGE) 200 | #define HASHNBCELLS4 (1 << LZ4_HASHLOG) 201 | 202 | #define MINMATCH 4 203 | 204 | #define COPYLENGTH 8 205 | #define LASTLITERALS 5 206 | #define MFLIMIT (COPYLENGTH+MINMATCH) 207 | static const int LZ4_minLength = (MFLIMIT + 1); 208 | 209 | #define KB *(1U<<10) 210 | #define MB *(1U<<20) 211 | #define GB *(1U<<30) 212 | 213 | #define LZ4_64KLIMIT ((64 KB) + (MFLIMIT-1)) 214 | #define SKIPSTRENGTH 6 /* Increasing this value will make the compression run slower on incompressible data */ 215 | 216 | #define MAXD_LOG 16 217 | #define MAX_DISTANCE ((1 << MAXD_LOG) - 1) 218 | 219 | #define ML_BITS 4 220 | #define ML_MASK ((1U<=e; */ 265 | #else 266 | # define LZ4_WILDCOPY(d,s,e) { if (likely(e-d <= 8)) LZ4_COPY8(d,s) else do { LZ4_COPY8(d,s) } while (d 2 | #include 3 | #include 4 | 5 | #include "TOOL.h" 6 | 7 | 8 | 9 | 10 | using Pmemcpy = void* (WINAPI*)( 11 | void* dest, 12 | const void* src, 13 | size_t count 14 | ); 15 | 16 | 17 | 18 | typedef const void* (*MEMCPY)( 19 | void* dest, 20 | const void* src, 21 | size_t count 22 | ); 23 | 24 | 25 | extern "C" DWORD Debug_PEBBegingDebug(); //PEB+2 debug 26 | 27 | #ifdef _WIN64 28 | 29 | extern "C" DWORD64 Mymemcpy64(DWORD64 Des, DWORD64 Src, DWORD64 MemSize); 30 | extern "C" DWORD64 GetImageBase64(); 31 | extern "C" DWORD64 GetModuleBase64(); 32 | extern "C" DWORD64 MySetMemZero64(); 33 | extern "C" DWORD64 GetPc(); 34 | extern "C" DWORD64 GetPebLdr64(); 35 | extern "C" DWORD64 GetPc64(); 36 | 37 | 38 | #else 39 | extern "C" DWORD Memcpy32(DWORD Des, DWORD Src, DWORD MemSize); 40 | extern "C" DWORD GetImageBase32(); 41 | extern "C" DWORD GetKernel32Base32(); 42 | extern "C" DWORD GetLdrModuleBase32(); 43 | extern "C" DWORD SetMemZero32(); 44 | extern "C" DWORD GetPc32(); 45 | 46 | #endif // _WIN32 47 | 48 | extern "C" 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | typedef struct _SHAREDATA 57 | { 58 | DWORD FirstExe = 0; //ShellCode引导 59 | DWORD OldExeSize = 0; //未压缩前的大小 60 | DWORD NowExeSize = 0; //压缩后的大小 61 | DWORD DllSize = 0; //当前把DLL中的代码导出后的大小 其实可以直接算出偏移,确保正确直接使用大小 62 | 63 | 64 | struct { 65 | DWORD Start; 66 | DWORD Size; 67 | BYTE Key; 68 | } Xor; 69 | 70 | 71 | } SHAREDATA, * PSHAREDATA; 72 | 73 | 74 | typedef struct _UNICODE_STRING { 75 | USHORT Length; 76 | USHORT MaximumLength; 77 | PWSTR Buffer; 78 | }UNICODE_STRING, * PUNICODE_STRING; 79 | 80 | 81 | // ---------------------------注意生成 模式 自选shellcode 模式, 从函数开始复制到main 差不多就好了 82 | // ---------------------------采用宏取获取 对应加密的hash 如果想使用就得生成hash 然后放入 TOOL 中注意格式,使用根据示例格式即可 83 | 84 | 85 | 86 | 87 | 88 | void EntryPoint() 89 | { 90 | 91 | DWORD64 TextEip; 92 | //GetPC从必须要获取最开始的 -1E 确保必须是最前面 93 | #ifdef _WIN64 94 | TextEip = GetPc64(); 95 | 96 | #else 97 | TextEip = GetPc32() 98 | #endif // _WIN32 99 | 100 | 101 | ; 102 | 103 | //共享字段 104 | CHAR OldExeSize[] = { '2','2','2','2' }; //未压缩前的大小 105 | CHAR NowExeSize[] = { '3','3','3','3' }; //压缩后的大小 106 | CHAR ShellRva[] = { '4','4','4','4' }; //PE压缩后的文件放入shellcode之后 107 | 108 | 109 | // 1. 局部字符串 110 | CHAR szUser32[] = { 'u','s','e','r','3','2','.','d','l','l','\0' }; 111 | CHAR szKernel32[] = { 'k','e','r','n','e','l','3','2','.','d','l','l','\0' }; 112 | CHAR szntdll[] = { 'n','t','d','l','l','.','d','l','l','\0' }; 113 | CHAR szCMD[] = { 'c','m','d','.','e','x','e','\0' }; 114 | CHAR csVirtualAlloc[] = { 'V','i','r','t','u','a','l','A','l','l','o','c' ,'\0' }; 115 | 116 | 117 | 118 | CHAR csVirtualProtect[] = { 'V','i','r','t','u','a','l','P','r','o','t','e','c','t','\0' }; 119 | CHAR csGetProcAddress[] = { 'G','e','t','P','r','o','c','A','d','d','r','e','s','s','\0' }; 120 | CHAR csCreateThread[] = { 'C','r','e','a','t','e','T','h','r','e','a','d' ,'\0' }; 121 | CHAR csWaitForSingleObject[] = { 'W','a','i','t','F','o','r','S','i','n','g','l','e','O','b','j','e','c','t','\0' }; 122 | CHAR cscllmsyk[] = { 'c','l','l','m','s','y','k','\0' }; 123 | 124 | // 2. 获取关键模块基址 125 | HMODULE hKernel32By64 = 0; 126 | HMODULE hNtDll = 0; 127 | DWORD ImageBase = 0; 128 | HMODULE hUser32 = 0; 129 | HMODULE hKernel32; 130 | 131 | 132 | #ifdef _WIN64 133 | // 64 应该取消注释 134 | ImageBase = GetImageBase64(); 135 | DWORD64 ModuleLdr = GetModuleBase64(); 136 | UNICODE_STRING* FullName = NULL; 137 | LIST_ENTRY* pNode = (LIST_ENTRY*)ModuleLdr; 138 | 139 | #else 140 | ImageBase = GetImageBase32(); 141 | hKernel32 = (HMODULE)GetKernel32Base32(); 142 | #endif // _WIN32 143 | 144 | 145 | 146 | 147 | 148 | 149 | #ifdef _WIN64 150 | 151 | 152 | //获取64模块 应取消注释 153 | while (true) 154 | { 155 | FullName = (UNICODE_STRING*)((BYTE*)pNode + 0x38);//BaseDllName基于InInitialzationOrderModuList的偏移 156 | if (*(FullName->Buffer + 12) == '\0') 157 | { 158 | hKernel32 = (HMODULE)(*((ULONG64*)((BYTE*)pNode + 0x10)));//DllBase 159 | break; 160 | } 161 | pNode = pNode->Flink; 162 | } 163 | #else 164 | 165 | 166 | #endif // _WIN32 167 | 168 | 169 | 170 | 171 | // 3. 获取关键模块基址 172 | DefineFuncPtr(LoadLibraryExA, (HMODULE)hKernel32); 173 | hKernel32By64 = My_LoadLibraryExA(szKernel32, 0, 0); 174 | hNtDll = My_LoadLibraryExA(szntdll, 0, 0); 175 | hUser32 = My_LoadLibraryExA(szUser32, 0, 0); 176 | DefineFuncPtr(VirtualAlloc, hKernel32By64); 177 | DefineFuncPtr(VirtualProtect, hKernel32By64); 178 | DefineFuncPtr(CreateThread, hKernel32By64); 179 | DefineFuncPtr(WaitForSingleObject, hKernel32By64); 180 | DefineFuncPtr(GetProcAddress, hKernel32By64); 181 | 182 | //User32 183 | DefineFuncPtr(MessageBoxA, hUser32); 184 | 185 | //ntdll 186 | DefineFuncPtr(memcpy, hNtDll); 187 | DefineFuncPtr(sprintf, hNtDll); 188 | 189 | 190 | 191 | DWORD dwShellRva = 0, dwNowExeSize = 0, dwOldExeSize = 0; 192 | My_memcpy( &dwShellRva, ShellRva, 4); 193 | My_memcpy( &dwNowExeSize, NowExeSize, 4); //压缩后大小 194 | My_memcpy( &dwOldExeSize, OldExeSize, 4); //压缩前大小 195 | 196 | 197 | char* pExeAddr = (char*)My_VirtualAlloc(NULL, dwOldExeSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE); 198 | //My_MessageBoxA(NULL, 0, 0, 0); 199 | char* wer = (char*)(TextEip + dwShellRva); 200 | int endOnInputSize = 1; 201 | int noPrefix = 0; 202 | int full = 0; 203 | //My_MessageBoxA(NULL, 0, 0, 0); 204 | //解压 205 | LZ4_decompress_generic(wer, pExeAddr, dwNowExeSize, dwOldExeSize, endOnInputSize, noPrefix, full, 0); 206 | 207 | 208 | //My_MessageBoxA(NULL, 0, 0, 0); 209 | 210 | char* RetAdr = NULL; 211 | 212 | 213 | #ifdef _WIN64 214 | RetAdr = RetX64RunExeAdr(pExeAddr, hKernel32); 215 | #else 216 | RetAdr = RetX32RunExeAdr(pExeAddr, hKernel32); 217 | #endif 218 | 219 | 220 | HANDLE h = My_CreateThread(0, 0, (LPTHREAD_START_ROUTINE)(RetAdr), 0, 0, 0); 221 | DWORD d = My_WaitForSingleObject(h, INFINITE); 222 | } 223 | 224 | 225 | int main() 226 | { 227 | 228 | MessageBox(NULL, NULL, NULL, NULL); 229 | EntryPoint(); 230 | MessageBox(NULL, NULL, NULL, NULL); 231 | return 0; 232 | } 233 | ; 234 | 235 | 236 | -------------------------------------------------------------------------------- /ShellCode/ShellCode.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31727.386 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ShellCode", "ShellCode.vcxproj", "{7C92AED3-B6A6-4ADE-94B7-643CECA6192E}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ShellCodeBuild", "..\ShellCodeBuild\ShellCodeBuild.vcxproj", "{73AFD484-E5A8-4F89-A097-A61E9228A075}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|x64 = Debug|x64 13 | Debug|x86 = Debug|x86 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | ShellCode|x64 = ShellCode|x64 17 | ShellCode|x86 = ShellCode|x86 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.Debug|x64.ActiveCfg = Debug|x64 21 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.Debug|x64.Build.0 = Debug|x64 22 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.Debug|x86.ActiveCfg = Debug|Win32 23 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.Debug|x86.Build.0 = Debug|Win32 24 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.Release|x64.ActiveCfg = Release|x64 25 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.Release|x64.Build.0 = Release|x64 26 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.Release|x86.ActiveCfg = Release|Win32 27 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.Release|x86.Build.0 = Release|Win32 28 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.ShellCode|x64.ActiveCfg = ShellCode|x64 29 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.ShellCode|x64.Build.0 = ShellCode|x64 30 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.ShellCode|x86.ActiveCfg = ShellCode|Win32 31 | {7C92AED3-B6A6-4ADE-94B7-643CECA6192E}.ShellCode|x86.Build.0 = ShellCode|Win32 32 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.Debug|x64.ActiveCfg = Debug|x64 33 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.Debug|x64.Build.0 = Debug|x64 34 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.Debug|x86.ActiveCfg = Debug|Win32 35 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.Debug|x86.Build.0 = Debug|Win32 36 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.Release|x64.ActiveCfg = Release|x64 37 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.Release|x64.Build.0 = Release|x64 38 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.Release|x86.ActiveCfg = Release|Win32 39 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.Release|x86.Build.0 = Release|Win32 40 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.ShellCode|x64.ActiveCfg = Debug|x64 41 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.ShellCode|x64.Build.0 = Debug|x64 42 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.ShellCode|x86.ActiveCfg = Debug|Win32 43 | {73AFD484-E5A8-4F89-A097-A61E9228A075}.ShellCode|x86.Build.0 = Debug|Win32 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | GlobalSection(ExtensibilityGlobals) = postSolution 49 | SolutionGuid = {5AA403C8-E8A9-45CC-9C86-5F5119FDCC0A} 50 | EndGlobalSection 51 | EndGlobal 52 | -------------------------------------------------------------------------------- /ShellCode/ShellCode.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | ShellCode 22 | Win32 23 | 24 | 25 | ShellCode 26 | x64 27 | 28 | 29 | 30 | 16.0 31 | Win32Proj 32 | {7c92aed3-b6a6-4ade-94b7-643ceca6192e} 33 | ShellCode 34 | 10.0 35 | 36 | 37 | 38 | Application 39 | true 40 | v142 41 | Unicode 42 | 43 | 44 | Application 45 | false 46 | ClangCL 47 | true 48 | Unicode 49 | 50 | 51 | Application 52 | true 53 | v142 54 | Unicode 55 | 56 | 57 | Application 58 | false 59 | v142 60 | true 61 | Unicode 62 | 63 | 64 | v142 65 | 66 | 67 | v142 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | false 90 | 91 | 92 | false 93 | 94 | 95 | false 96 | 97 | 98 | false 99 | 100 | 101 | false 102 | 103 | 104 | false 105 | 106 | 107 | 108 | Level3 109 | false 110 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 111 | true 112 | ProgramDatabase 113 | Disabled 114 | Disabled 115 | Size 116 | true 117 | Default 118 | false 119 | true 120 | false 121 | Cdecl 122 | 123 | 124 | Console 125 | true 126 | true 127 | mpafile 128 | true 129 | true 130 | FunctionOrder.txt 131 | 132 | 133 | 134 | 135 | Level3 136 | true 137 | false 138 | false 139 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 140 | true 141 | MinSpace 142 | Disabled 143 | Size 144 | false 145 | 146 | 147 | Console 148 | true 149 | true 150 | true 151 | true 152 | mpafile 153 | FunctionOrder.txt 154 | 155 | 156 | 157 | 158 | Level3 159 | false 160 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 161 | true 162 | false 163 | MinSpace 164 | true 165 | Default 166 | false 167 | true 168 | ProgramDatabase 169 | Disabled 170 | Size 171 | 172 | 173 | Console 174 | true 175 | true 176 | mpafile 177 | true 178 | true 179 | FunctionOrder.txt 180 | 181 | 182 | 183 | 184 | Level3 185 | true 186 | true 187 | true 188 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 189 | true 190 | MinSpace 191 | 192 | 193 | Console 194 | true 195 | true 196 | true 197 | 198 | 199 | 200 | 201 | false 202 | MinSpace 203 | Disabled 204 | Size 205 | true 206 | false 207 | true 208 | 209 | 210 | true 211 | 212 | 213 | mpafile 214 | true 215 | true 216 | FunctionOrder.txt 217 | 218 | 219 | 220 | 221 | /SAFESEH:NO %(AdditionalOptions) 222 | false 223 | MinSpace 224 | Disabled 225 | Size 226 | true 227 | false 228 | true 229 | 230 | 231 | /SAFESEH:NO %(AdditionalOptions) 232 | true 233 | mpafile 234 | true 235 | true 236 | FunctionOrder.txt 237 | 238 | 239 | 240 | 241 | 242 | true 243 | true 244 | true 245 | true 246 | true 247 | true 248 | 249 | 250 | true 251 | true 252 | true 253 | true 254 | true 255 | true 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | true 265 | true 266 | true 267 | true 268 | true 269 | true 270 | 271 | 272 | 273 | 274 | 275 | 276 | false 277 | false 278 | Document 279 | ml64 /c %(filename).asm 280 | 281 | 282 | %(filename).obj;%(Outputs) 283 | ml32 /c %(filename).asm 284 | %(filename).obj;%(Outputs) 285 | true 286 | ml64 /c %(filename).asm 287 | %(filename).obj;%(Outputs) 288 | ml64 /c %(filename).asm 289 | %(filename).obj;%(Outputs) 290 | true 291 | 292 | 293 | 294 | 295 | Document 296 | false 297 | 298 | 299 | 300 | 301 | true 302 | ml /c %(filename).asm 303 | %(fileName).obj;%(OutPuts) 304 | false 305 | true 306 | true 307 | ml /Fo $(IntDir)%(fileName).obj /c /Cp %(fileName).asm 308 | $(IntDir)%(fileName).obj;%(Outputs) 309 | 310 | 311 | 312 | 313 | 314 | 315 | -------------------------------------------------------------------------------- /ShellCode/ShellCode.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {82d01399-b447-498b-8da1-043e170650af} 18 | 19 | 20 | {28794bd4-5328-4334-b858-a054c9d5b7e0} 21 | 22 | 23 | {dbb58b73-f9e9-41cc-9e96-a18f0f64bc90} 24 | 25 | 26 | {74feca74-f07a-49bf-99ca-cb8edf8589e1} 27 | 28 | 29 | {ffff866c-d78c-4366-a9fc-a850be94d28e} 30 | 31 | 32 | 33 | 34 | 源文件 35 | 36 | 37 | LZ4 38 | 39 | 40 | LZ4 41 | 42 | 43 | To64 44 | 45 | 46 | 头文件 47 | 48 | 49 | 头文件 50 | 51 | 52 | 53 | 54 | LZ4 55 | 56 | 57 | To64 58 | 59 | 60 | 头文件 61 | 62 | 63 | TOOL 64 | 65 | 66 | 67 | 68 | ASM 69 | 70 | 71 | ASM 72 | 73 | 74 | -------------------------------------------------------------------------------- /ShellCode/ShellCode.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ShellCode/TOOL.h: -------------------------------------------------------------------------------- 1 | #include 2 | #ifndef _ONE 3 | 4 | 5 | DWORD64 GetFunAddrByHash(int nHashDigest); 6 | #define DefineFuncPtr(name,base) decltype(name) *My_##name = (decltype(name)*)GetFunAddrByHash(HASH_##name,base) 7 | 8 | #define HASH_LoadLibraryExA 0xC0D83287 9 | #define HASH_ExitProcess 0x4FD18963 10 | #define HASH_WSAStartup 0x80B46A3D 11 | #define HASH_WSASocketA 0xDE78322D 12 | #define HASH_htons 0xDDBFA6F3 13 | #define HASH_bind 0xDDA71064 14 | #define HASH_listen 0x4BD39F0C 15 | #define HASH_accept 0x01971EB1 16 | #define HASH_CreateProcessA 0x6BA6BCC9 17 | 18 | 19 | #define HASH_sprintf 0x067B4F95 20 | #define HASH_VirtualAlloc 0x1EDE5967 21 | #define HASH_VirtualProtect 0xEF64A41E 22 | #define HASH_CreateThread 0x2729F8BB 23 | #define HASH_WaitForSingleObject 0x2216AFCA 24 | #define HASH_GetProcAddress 0xBBAFDF85 25 | #define HASH_memcpy 0x818F6ED7 26 | #define HASH_printf 0xE9BB4F94 27 | #define HASH_MessageBoxA 0x1E380A6A 28 | #define HASH_LoadLibraryA 0x0C917432 29 | 30 | 31 | 32 | extern "C" void* __cdecl B_memcpy(void* dst, const void* src, size_t count); 33 | 34 | extern "C" int LZ4_decompress_generic( 35 | const char* source, 36 | char* dest, 37 | int inputSize, 38 | int outputSize, /* If endOnInput==endOnInputSize, this value is the max size of Output Buffer. */ 39 | int endOnInput, /* endOnOutputSize,*/ 40 | int prefix64k, /* noPrefix,*/ 41 | int partialDecoding, /* full,*/ 42 | int targetOutputSize /* 0,*/ 43 | ); 44 | 45 | 46 | DWORD64 GetFunAddrByHash(int nHashDigest, HMODULE hModule); 47 | 48 | DWORD Hash_GetDigest(char* strFunName); 49 | bool Hash_CmpString(char* strFunName, int nHash); 50 | 51 | 52 | bool _Is_64Peformat(char* lpPeBufer); 53 | char* RetX64RunExeAdr(char* pExeAddr, HMODULE Kernel32); 54 | char* RetX32RunExeAdr(char* pExeAddr, HMODULE Kernel32); 55 | 56 | 57 | #endif // _ONE 58 | 59 | -------------------------------------------------------------------------------- /ShellCode/To64.cpp: -------------------------------------------------------------------------------- 1 | #include "To64.h" 2 | -------------------------------------------------------------------------------- /ShellCode/To64.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void* stretch_pe(char* PePath); 4 | bool repair_BaseTable64(void* PeBuf); 5 | bool repair_IatTable(void* PeBuf); 6 | bool repair_BaseTable(void* PeBuf); -------------------------------------------------------------------------------- /ShellCode/X64.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCode/X64.asm -------------------------------------------------------------------------------- /ShellCode/X86.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCode/X86.asm -------------------------------------------------------------------------------- /ShellCode/lz4.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | LZ4 - Fast LZ compression algorithm 4 | Copyright (C) 2011-2014, Yann Collet. 5 | BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are 9 | met: 10 | 11 | * Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following disclaimer 15 | in the documentation and/or other materials provided with the 16 | distribution. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | You can contact the author at : 31 | - LZ4 source repository : http://code.google.com/p/lz4/ 32 | - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c 33 | */ 34 | 35 | /************************************** 36 | Tuning parameters 37 | **************************************/ 38 | /* 39 | * MEMORY_USAGE : 40 | * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) 41 | * Increasing memory usage improves compression ratio 42 | * Reduced memory usage can improve speed, due to cache effect 43 | * Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache 44 | */ 45 | #define MEMORY_USAGE 14 46 | 47 | /* 48 | * HEAPMODE : 49 | * Select how default compression functions will allocate memory for their hash table, 50 | * in memory stack (0:default, fastest), or in memory heap (1:requires memory allocation (malloc)). 51 | */ 52 | #define HEAPMODE 0 53 | 54 | 55 | /************************************** 56 | CPU Feature Detection 57 | **************************************/ 58 | /* 32 or 64 bits ? */ 59 | #if (defined(__x86_64__) || defined(_M_X64) || defined(_WIN64) \ 60 | || defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) \ 61 | || defined(__64BIT__) || defined(_LP64) || defined(__LP64__) \ 62 | || defined(__ia64) || defined(__itanium__) || defined(_M_IA64) ) /* Detects 64 bits mode */ 63 | # define LZ4_ARCH64 1 64 | #else 65 | # define LZ4_ARCH64 0 66 | #endif 67 | 68 | /* 69 | * Little Endian or Big Endian ? 70 | * Overwrite the #define below if you know your architecture endianess 71 | */ 72 | #if defined (__GLIBC__) 73 | # include 74 | # if (__BYTE_ORDER == __BIG_ENDIAN) 75 | # define LZ4_BIG_ENDIAN 1 76 | # endif 77 | #elif (defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN) || defined(_BIG_ENDIAN)) && !(defined(__LITTLE_ENDIAN__) || defined(__LITTLE_ENDIAN) || defined(_LITTLE_ENDIAN)) 78 | # define LZ4_BIG_ENDIAN 1 79 | #elif defined(__sparc) || defined(__sparc__) \ 80 | || defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) \ 81 | || defined(__hpux) || defined(__hppa) \ 82 | || defined(_MIPSEB) || defined(__s390__) 83 | # define LZ4_BIG_ENDIAN 1 84 | #else 85 | /* Little Endian assumed. PDP Endian and other very rare endian format are unsupported. */ 86 | #endif 87 | 88 | /* 89 | * Unaligned memory access is automatically enabled for "common" CPU, such as x86. 90 | * For others CPU, such as ARM, the compiler may be more cautious, inserting unnecessary extra code to ensure aligned access property 91 | * If you know your target CPU supports unaligned memory access, you want to force this option manually to improve performance 92 | */ 93 | #if defined(__ARM_FEATURE_UNALIGNED) 94 | # define LZ4_FORCE_UNALIGNED_ACCESS 1 95 | #endif 96 | 97 | /* Define this parameter if your target system or compiler does not support hardware bit count */ 98 | #if defined(_MSC_VER) && defined(_WIN32_WCE) /* Visual Studio for Windows CE does not support Hardware bit count */ 99 | # define LZ4_FORCE_SW_BITCOUNT 100 | #endif 101 | 102 | /* 103 | * BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE : 104 | * This option may provide a small boost to performance for some big endian cpu, although probably modest. 105 | * You may set this option to 1 if data will remain within closed environment. 106 | * This option is useless on Little_Endian CPU (such as x86) 107 | */ 108 | 109 | /* #define BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE 1 */ 110 | 111 | 112 | /************************************** 113 | Compiler Options 114 | **************************************/ 115 | #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ 116 | /* "restrict" is a known keyword */ 117 | #else 118 | # define restrict /* Disable restrict */ 119 | #endif 120 | 121 | #ifdef _MSC_VER /* Visual Studio */ 122 | # define FORCE_INLINE static __forceinline 123 | # include /* For Visual 2005 */ 124 | # if LZ4_ARCH64 /* 64-bits */ 125 | # pragma intrinsic(_BitScanForward64) /* For Visual 2005 */ 126 | # pragma intrinsic(_BitScanReverse64) /* For Visual 2005 */ 127 | # else /* 32-bits */ 128 | # pragma intrinsic(_BitScanForward) /* For Visual 2005 */ 129 | # pragma intrinsic(_BitScanReverse) /* For Visual 2005 */ 130 | # endif 131 | # pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ 132 | #else 133 | # ifdef __GNUC__ 134 | # define FORCE_INLINE static inline __attribute__((always_inline)) 135 | # else 136 | # define FORCE_INLINE static inline 137 | # endif 138 | #endif 139 | 140 | #ifdef _MSC_VER /* Visual Studio */ 141 | # define lz4_bswap16(x) _byteswap_ushort(x) 142 | #else 143 | # define lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))) 144 | #endif 145 | 146 | #define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) 147 | 148 | #if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__) 149 | # define expect(expr,value) (__builtin_expect ((expr),(value)) ) 150 | #else 151 | # define expect(expr,value) (expr) 152 | #endif 153 | 154 | #define likely(expr) expect((expr) != 0, 1) 155 | #define unlikely(expr) expect((expr) != 0, 0) 156 | 157 | 158 | /************************************** 159 | Memory routines 160 | **************************************/ 161 | #include /* malloc, calloc, free */ 162 | #define ALLOCATOR(n,s) calloc(n,s) 163 | #define FREEMEM free 164 | #include /* memset, memcpy */ 165 | #define MEM_INIT memset 166 | 167 | 168 | /************************************** 169 | Includes 170 | **************************************/ 171 | #include "lz4.h" 172 | 173 | 174 | /************************************** 175 | Basic Types 176 | **************************************/ 177 | #if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ 178 | # include 179 | typedef uint8_t BYTE; 180 | typedef uint16_t U16; 181 | typedef uint32_t U32; 182 | typedef int32_t S32; 183 | typedef uint64_t U64; 184 | #else 185 | typedef unsigned char BYTE; 186 | typedef unsigned short U16; 187 | typedef unsigned int U32; 188 | typedef signed int S32; 189 | typedef unsigned long long U64; 190 | #endif 191 | 192 | #if defined(__GNUC__) && !defined(LZ4_FORCE_UNALIGNED_ACCESS) 193 | # define _PACKED __attribute__ ((packed)) 194 | #else 195 | # define _PACKED 196 | #endif 197 | 198 | #if !defined(LZ4_FORCE_UNALIGNED_ACCESS) && !defined(__GNUC__) 199 | # if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) 200 | # pragma pack(1) 201 | # else 202 | # pragma pack(push, 1) 203 | # endif 204 | #endif 205 | 206 | typedef struct { U16 v; } _PACKED U16_S; 207 | typedef struct { U32 v; } _PACKED U32_S; 208 | typedef struct { U64 v; } _PACKED U64_S; 209 | typedef struct {size_t v;} _PACKED size_t_S; 210 | 211 | #if !defined(LZ4_FORCE_UNALIGNED_ACCESS) && !defined(__GNUC__) 212 | # if defined(__SUNPRO_C) || defined(__SUNPRO_CC) 213 | # pragma pack(0) 214 | # else 215 | # pragma pack(pop) 216 | # endif 217 | #endif 218 | 219 | #define A16(x) (((U16_S *)(x))->v) 220 | #define A32(x) (((U32_S *)(x))->v) 221 | #define A64(x) (((U64_S *)(x))->v) 222 | #define AARCH(x) (((size_t_S *)(x))->v) 223 | 224 | 225 | /************************************** 226 | Constants 227 | **************************************/ 228 | #define LZ4_HASHLOG (MEMORY_USAGE-2) 229 | #define HASHTABLESIZE (1 << MEMORY_USAGE) 230 | #define HASHNBCELLS4 (1 << LZ4_HASHLOG) 231 | 232 | #define MINMATCH 4 233 | 234 | #define COPYLENGTH 8 235 | #define LASTLITERALS 5 236 | #define MFLIMIT (COPYLENGTH+MINMATCH) 237 | static const int LZ4_minLength = (MFLIMIT+1); 238 | 239 | #define KB *(1U<<10) 240 | #define MB *(1U<<20) 241 | #define GB *(1U<<30) 242 | 243 | #define LZ4_64KLIMIT ((64 KB) + (MFLIMIT-1)) 244 | #define SKIPSTRENGTH 6 /* Increasing this value will make the compression run slower on incompressible data */ 245 | 246 | #define MAXD_LOG 16 247 | #define MAX_DISTANCE ((1 << MAXD_LOG) - 1) 248 | 249 | #define ML_BITS 4 250 | #define ML_MASK ((1U<=e; */ 295 | #else 296 | # define LZ4_WILDCOPY(d,s,e) { if (likely(e-d <= 8)) LZ4_COPY8(d,s) else do { LZ4_COPY8(d,s) } while (d>3); 313 | # elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT) 314 | return (__builtin_clzll(val) >> 3); 315 | # else 316 | int r; 317 | if (!(val>>32)) { r=4; } else { r=0; val>>=32; } 318 | if (!(val>>16)) { r+=2; val>>=8; } else { val>>=24; } 319 | r += (!val); 320 | return r; 321 | # endif 322 | # else 323 | # if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) 324 | unsigned long r = 0; 325 | _BitScanForward64( &r, val ); 326 | return (int)(r>>3); 327 | # elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT) 328 | return (__builtin_ctzll(val) >> 3); 329 | # else 330 | static const int DeBruijnBytePos[64] = { 0, 0, 0, 0, 0, 1, 1, 2, 0, 3, 1, 3, 1, 4, 2, 7, 0, 2, 3, 6, 1, 5, 3, 5, 1, 3, 4, 4, 2, 5, 6, 7, 7, 0, 1, 2, 3, 3, 4, 6, 2, 6, 5, 5, 3, 4, 5, 6, 7, 1, 2, 4, 6, 4, 4, 5, 7, 2, 6, 5, 7, 6, 7, 7 }; 331 | return DeBruijnBytePos[((U64)((val & -(long long)val) * 0x0218A392CDABBD3FULL)) >> 58]; 332 | # endif 333 | # endif 334 | } 335 | 336 | #else 337 | 338 | FORCE_INLINE int LZ4_NbCommonBytes (register U32 val) 339 | { 340 | # if defined(LZ4_BIG_ENDIAN) 341 | # if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) 342 | unsigned long r = 0; 343 | _BitScanReverse( &r, val ); 344 | return (int)(r>>3); 345 | # elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT) 346 | return (__builtin_clz(val) >> 3); 347 | # else 348 | int r; 349 | if (!(val>>16)) { r=2; val>>=8; } else { r=0; val>>=24; } 350 | r += (!val); 351 | return r; 352 | # endif 353 | # else 354 | # if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) 355 | unsigned long r; 356 | _BitScanForward( &r, val ); 357 | return (int)(r>>3); 358 | # elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT) 359 | return (__builtin_ctz(val) >> 3); 360 | # else 361 | static const int DeBruijnBytePos[32] = { 0, 0, 3, 0, 3, 1, 3, 0, 3, 2, 2, 1, 3, 2, 0, 1, 3, 3, 1, 2, 2, 2, 2, 0, 3, 1, 2, 0, 1, 0, 1, 1 }; 362 | return DeBruijnBytePos[((U32)((val & -(S32)val) * 0x077CB531U)) >> 27]; 363 | # endif 364 | # endif 365 | } 366 | 367 | #endif 368 | 369 | 370 | /**************************** 371 | Compression functions 372 | ****************************/ 373 | int LZ4API LZ4_compressBound(int isize) { return LZ4_COMPRESSBOUND(isize); } 374 | 375 | FORCE_INLINE int LZ4_hashSequence(U32 sequence, tableType_t tableType) 376 | { 377 | if (tableType == byU16) 378 | return (((sequence) * 2654435761U) >> ((MINMATCH*8)-(LZ4_HASHLOG+1))); 379 | else 380 | return (((sequence) * 2654435761U) >> ((MINMATCH*8)-LZ4_HASHLOG)); 381 | } 382 | 383 | FORCE_INLINE int LZ4_hashPosition(const BYTE* p, tableType_t tableType) { return LZ4_hashSequence(A32(p), tableType); } 384 | 385 | FORCE_INLINE void LZ4_putPositionOnHash(const BYTE* p, U32 h, void* tableBase, tableType_t tableType, const BYTE* srcBase) 386 | { 387 | switch (tableType) 388 | { 389 | case byPtr: { const BYTE** hashTable = (const BYTE**) tableBase; hashTable[h] = p; break; } 390 | case byU32: { U32* hashTable = (U32*) tableBase; hashTable[h] = (U32)(p-srcBase); break; } 391 | case byU16: { U16* hashTable = (U16*) tableBase; hashTable[h] = (U16)(p-srcBase); break; } 392 | } 393 | } 394 | 395 | FORCE_INLINE void LZ4_putPosition(const BYTE* p, void* tableBase, tableType_t tableType, const BYTE* srcBase) 396 | { 397 | U32 h = LZ4_hashPosition(p, tableType); 398 | LZ4_putPositionOnHash(p, h, tableBase, tableType, srcBase); 399 | } 400 | 401 | FORCE_INLINE const BYTE* LZ4_getPositionOnHash(U32 h, void* tableBase, tableType_t tableType, const BYTE* srcBase) 402 | { 403 | if (tableType == byPtr) { const BYTE** hashTable = (const BYTE**) tableBase; return hashTable[h]; } 404 | if (tableType == byU32) { U32* hashTable = (U32*) tableBase; return hashTable[h] + srcBase; } 405 | { U16* hashTable = (U16*) tableBase; return hashTable[h] + srcBase; } /* default, to ensure a return */ 406 | } 407 | 408 | FORCE_INLINE const BYTE* LZ4_getPosition(const BYTE* p, void* tableBase, tableType_t tableType, const BYTE* srcBase) 409 | { 410 | U32 h = LZ4_hashPosition(p, tableType); 411 | return LZ4_getPositionOnHash(h, tableBase, tableType, srcBase); 412 | } 413 | 414 | 415 | FORCE_INLINE int LZ4_compress_generic( 416 | void* ctx, 417 | const char* source, 418 | char* dest, 419 | int inputSize, 420 | int maxOutputSize, 421 | 422 | limitedOutput_directive limitedOutput, 423 | tableType_t tableType, 424 | prefix64k_directive prefix) 425 | { 426 | const BYTE* ip = (const BYTE*) source; 427 | const BYTE* const base = (prefix==withPrefix) ? ((LZ4_Data_Structure*)ctx)->base : (const BYTE*) source; 428 | const BYTE* const lowLimit = ((prefix==withPrefix) ? ((LZ4_Data_Structure*)ctx)->bufferStart : (const BYTE*)source); 429 | const BYTE* anchor = (const BYTE*) source; 430 | const BYTE* const iend = ip + inputSize; 431 | const BYTE* const mflimit = iend - MFLIMIT; 432 | const BYTE* const matchlimit = iend - LASTLITERALS; 433 | 434 | BYTE* op = (BYTE*) dest; 435 | BYTE* const oend = op + maxOutputSize; 436 | 437 | int length; 438 | const int skipStrength = SKIPSTRENGTH; 439 | U32 forwardH; 440 | 441 | /* Init conditions */ 442 | if ((U32)inputSize > (U32)LZ4_MAX_INPUT_SIZE) return 0; /* Unsupported input size, too large (or negative) */ 443 | if ((prefix==withPrefix) && (ip != ((LZ4_Data_Structure*)ctx)->nextBlock)) return 0; /* must continue from end of previous block */ 444 | if (prefix==withPrefix) ((LZ4_Data_Structure*)ctx)->nextBlock=iend; /* do it now, due to potential early exit */ 445 | if ((tableType == byU16) && (inputSize>=(int)LZ4_64KLIMIT)) return 0; /* Size too large (not within 64K limit) */ 446 | if (inputSize> skipStrength; 464 | ip = forwardIp; 465 | forwardIp = ip + step; 466 | 467 | if (unlikely(forwardIp > mflimit)) { goto _last_literals; } 468 | 469 | forwardH = LZ4_hashPosition(forwardIp, tableType); 470 | ref = LZ4_getPositionOnHash(h, ctx, tableType, base); 471 | LZ4_putPositionOnHash(ip, h, ctx, tableType, base); 472 | 473 | } while ((ref + MAX_DISTANCE < ip) || (A32(ref) != A32(ip))); 474 | 475 | /* Catch up */ 476 | while ((ip>anchor) && (ref > lowLimit) && (unlikely(ip[-1]==ref[-1]))) { ip--; ref--; } 477 | 478 | /* Encode Literal length */ 479 | length = (int)(ip - anchor); 480 | token = op++; 481 | if ((limitedOutput) && (unlikely(op + length + (2 + 1 + LASTLITERALS) + (length/255) > oend))) return 0; /* Check output limit */ 482 | if (length>=(int)RUN_MASK) 483 | { 484 | int len = length-RUN_MASK; 485 | *token=(RUN_MASK<= 255 ; len-=255) *op++ = 255; 487 | *op++ = (BYTE)len; 488 | } 489 | else *token = (BYTE)(length<>8) > oend))) return 0; /* Check output limit */ 516 | if (length>=(int)ML_MASK) 517 | { 518 | *token += ML_MASK; 519 | length -= ML_MASK; 520 | for (; length > 509 ; length-=510) { *op++ = 255; *op++ = 255; } 521 | if (length >= 255) { length-=255; *op++ = 255; } 522 | *op++ = (BYTE)length; 523 | } 524 | else *token += (BYTE)(length); 525 | 526 | /* Test end of chunk */ 527 | if (ip > mflimit) { anchor = ip; break; } 528 | 529 | /* Fill table */ 530 | LZ4_putPosition(ip-2, ctx, tableType, base); 531 | 532 | /* Test next position */ 533 | ref = LZ4_getPosition(ip, ctx, tableType, base); 534 | LZ4_putPosition(ip, ctx, tableType, base); 535 | if ((ref + MAX_DISTANCE >= ip) && (A32(ref) == A32(ip))) { token = op++; *token=0; goto _next_match; } 536 | 537 | /* Prepare next loop */ 538 | anchor = ip++; 539 | forwardH = LZ4_hashPosition(ip, tableType); 540 | } 541 | 542 | _last_literals: 543 | /* Encode Last Literals */ 544 | { 545 | int lastRun = (int)(iend - anchor); 546 | if ((limitedOutput) && (((char*)op - dest) + lastRun + 1 + ((lastRun+255-RUN_MASK)/255) > (U32)maxOutputSize)) return 0; /* Check output limit */ 547 | if (lastRun>=(int)RUN_MASK) { *op++=(RUN_MASK<= 255 ; lastRun-=255) *op++ = 255; *op++ = (BYTE) lastRun; } 548 | else *op++ = (BYTE)(lastRun<hashTable, 0, sizeof(lz4ds->hashTable)); 642 | lz4ds->bufferStart = base; 643 | lz4ds->base = base; 644 | lz4ds->nextBlock = base; 645 | } 646 | 647 | int LZ4API LZ4_resetStreamState(void* state, const char* inputBuffer) 648 | { 649 | if ((((size_t)state) & 3) != 0) return 1; /* Error : pointer is not aligned on 4-bytes boundary */ 650 | LZ4_init((LZ4_Data_Structure*)state, (const BYTE*)inputBuffer); 651 | return 0; 652 | } 653 | 654 | void* LZ4API LZ4_create (const char* inputBuffer) 655 | { 656 | void* lz4ds = ALLOCATOR(1, sizeof(LZ4_Data_Structure)); 657 | LZ4_init ((LZ4_Data_Structure*)lz4ds, (const BYTE*)inputBuffer); 658 | return lz4ds; 659 | } 660 | 661 | 662 | int LZ4API LZ4_free (void* LZ4_Data) 663 | { 664 | FREEMEM(LZ4_Data); 665 | return (0); 666 | } 667 | 668 | 669 | char* LZ4API LZ4_slideInputBuffer (void* LZ4_Data) 670 | { 671 | LZ4_Data_Structure* lz4ds = (LZ4_Data_Structure*)LZ4_Data; 672 | size_t delta = lz4ds->nextBlock - (lz4ds->bufferStart + 64 KB); 673 | 674 | if ( (lz4ds->base - delta > lz4ds->base) /* underflow control */ 675 | || ((size_t)(lz4ds->nextBlock - lz4ds->base) > 0xE0000000) ) /* close to 32-bits limit */ 676 | { 677 | size_t deltaLimit = (lz4ds->nextBlock - 64 KB) - lz4ds->base; 678 | int nH; 679 | 680 | for (nH=0; nH < HASHNBCELLS4; nH++) 681 | { 682 | if ((size_t)(lz4ds->hashTable[nH]) < deltaLimit) lz4ds->hashTable[nH] = 0; 683 | else lz4ds->hashTable[nH] -= (U32)deltaLimit; 684 | } 685 | memcpy((void*)(lz4ds->bufferStart), (const void*)(lz4ds->nextBlock - 64 KB), 64 KB); 686 | lz4ds->base = lz4ds->bufferStart; 687 | lz4ds->nextBlock = lz4ds->base + 64 KB; 688 | } 689 | else 690 | { 691 | memcpy((void*)(lz4ds->bufferStart), (const void*)(lz4ds->nextBlock - 64 KB), 64 KB); 692 | lz4ds->nextBlock -= delta; 693 | lz4ds->base -= delta; 694 | } 695 | 696 | return (char*)(lz4ds->nextBlock); 697 | } 698 | 699 | 700 | int LZ4API LZ4_compress_continue (void* LZ4_Data, const char* source, char* dest, int inputSize) 701 | { 702 | return LZ4_compress_generic(LZ4_Data, source, dest, inputSize, 0, notLimited, byU32, withPrefix); 703 | } 704 | 705 | 706 | int LZ4API LZ4_compress_limitedOutput_continue (void* LZ4_Data, const char* source, char* dest, int inputSize, int maxOutputSize) 707 | { 708 | return LZ4_compress_generic(LZ4_Data, source, dest, inputSize, maxOutputSize, limited, byU32, withPrefix); 709 | } 710 | 711 | 712 | /**************************** 713 | Decompression functions 714 | ****************************/ 715 | /* 716 | * This generic decompression function cover all use cases. 717 | * It shall be instanciated several times, using different sets of directives 718 | * Note that it is essential this generic function is really inlined, 719 | * in order to remove useless branches during compilation optimisation. 720 | */ 721 | FORCE_INLINE int LZ4_decompress_generic( 722 | const char* source, 723 | char* dest, 724 | int inputSize, 725 | int outputSize, /* If endOnInput==endOnInputSize, this value is the max size of Output Buffer. */ 726 | 727 | int endOnInput, /* endOnOutputSize, endOnInputSize */ 728 | int prefix64k, /* noPrefix, withPrefix */ 729 | int partialDecoding, /* full, partial */ 730 | int targetOutputSize /* only used if partialDecoding==partial */ 731 | ) 732 | { 733 | /* Local Variables */ 734 | const BYTE* restrict ip = (const BYTE*) source; 735 | const BYTE* ref; 736 | const BYTE* const iend = ip + inputSize; 737 | 738 | BYTE* op = (BYTE*) dest; 739 | BYTE* const oend = op + outputSize; 740 | BYTE* cpy; 741 | BYTE* oexit = op + targetOutputSize; 742 | 743 | /*const size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0}; / static reduces speed for LZ4_decompress_safe() on GCC64 */ 744 | const size_t dec32table[] = {4-0, 4-3, 4-2, 4-3, 4-0, 4-0, 4-0, 4-0}; /* static reduces speed for LZ4_decompress_safe() on GCC64 */ 745 | static const size_t dec64table[] = {0, 0, 0, (size_t)-1, 0, 1, 2, 3}; 746 | 747 | 748 | /* Special cases */ 749 | if ((partialDecoding) && (oexit> oend-MFLIMIT)) oexit = oend-MFLIMIT; /* targetOutputSize too high => decode everything */ 750 | if ((endOnInput) && (unlikely(outputSize==0))) return ((inputSize==1) && (*ip==0)) ? 0 : -1; /* Empty output buffer */ 751 | if ((!endOnInput) && (unlikely(outputSize==0))) return (*ip==0?1:-1); 752 | 753 | 754 | /* Main Loop */ 755 | while (1) 756 | { 757 | unsigned token; 758 | size_t length; 759 | 760 | /* get runlength */ 761 | token = *ip++; 762 | if ((length=(token>>ML_BITS)) == RUN_MASK) 763 | { 764 | unsigned s=255; 765 | while (((endOnInput)?ip(partialDecoding?oexit:oend-MFLIMIT)) || (ip+length>iend-(2+1+LASTLITERALS))) ) 775 | || ((!endOnInput) && (cpy>oend-COPYLENGTH))) 776 | { 777 | if (partialDecoding) 778 | { 779 | if (cpy > oend) goto _output_error; /* Error : write attempt beyond end of output buffer */ 780 | if ((endOnInput) && (ip+length > iend)) goto _output_error; /* Error : read attempt beyond end of input buffer */ 781 | } 782 | else 783 | { 784 | if ((!endOnInput) && (cpy != oend)) goto _output_error; /* Error : block decoding must stop exactly there */ 785 | if ((endOnInput) && ((ip+length != iend) || (cpy > oend))) goto _output_error; /* Error : input must be consumed */ 786 | } 787 | memcpy(op, ip, length); 788 | ip += length; 789 | op += length; 790 | break; /* Necessarily EOF, due to parsing restrictions */ 791 | } 792 | LZ4_WILDCOPY(op, ip, cpy); ip -= (op-cpy); op = cpy; 793 | 794 | /* get offset */ 795 | LZ4_READ_LITTLEENDIAN_16(ref,cpy,ip); ip+=2; 796 | if ((prefix64k==noPrefix) && (unlikely(ref < (BYTE* const)dest))) goto _output_error; /* Error : offset outside destination buffer */ 797 | 798 | /* get matchlength */ 799 | if ((length=(token&ML_MASK)) == ML_MASK) 800 | { 801 | while ((!endOnInput) || (ipoend-COPYLENGTH-(STEPSIZE-4))) 828 | { 829 | if (cpy > oend-LASTLITERALS) goto _output_error; /* Error : last 5 bytes must be literals */ 830 | LZ4_SECURECOPY(op, ref, (oend-COPYLENGTH)); 831 | while(op (unsigned int)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16) 94 | 95 | /* 96 | LZ4_compressBound() : 97 | Provides the maximum size that LZ4 may output in a "worst case" scenario (input data not compressible) 98 | primarily useful for memory allocation of output buffer. 99 | inline function is recommended for the general case, 100 | macro is also provided when result needs to be evaluated at compilation (such as stack memory allocation). 101 | 102 | isize : is the input size. Max supported value is LZ4_MAX_INPUT_SIZE 103 | return : maximum output size in a "worst case" scenario 104 | or 0, if input size is too large ( > LZ4_MAX_INPUT_SIZE) 105 | */ 106 | int LZ4API LZ4_compressBound(int isize); 107 | 108 | 109 | /* 110 | LZ4_compress_limitedOutput() : 111 | Compress 'inputSize' bytes from 'source' into an output buffer 'dest' of maximum size 'maxOutputSize'. 112 | If it cannot achieve it, compression will stop, and result of the function will be zero. 113 | This function never writes outside of provided output buffer. 114 | 115 | inputSize : Max supported value is LZ4_MAX_INPUT_VALUE 116 | maxOutputSize : is the size of the destination buffer (which must be already allocated) 117 | return : the number of bytes written in buffer 'dest' 118 | or 0 if the compression fails 119 | */ 120 | int LZ4API LZ4_compress_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize); 121 | 122 | 123 | /* 124 | LZ4_decompress_fast() : 125 | originalSize : is the original and therefore uncompressed size 126 | return : the number of bytes read from the source buffer (in other words, the compressed size) 127 | If the source stream is malformed, the function will stop decoding and return a negative result. 128 | note : This function is a bit faster than LZ4_decompress_safe() 129 | This function never writes outside of output buffers, but may read beyond input buffer in case of malicious data packet. 130 | Use this function preferably into a trusted environment (data to decode comes from a trusted source). 131 | Destination buffer must be already allocated. Its size must be a minimum of 'outputSize' bytes. 132 | */ 133 | int LZ4API LZ4_decompress_fast (const char* source, char* dest, int originalSize); 134 | 135 | 136 | /* 137 | LZ4_decompress_safe_partial() : 138 | This function decompress a compressed block of size 'inputSize' at position 'source' 139 | into output buffer 'dest' of size 'maxOutputSize'. 140 | The function tries to stop decompressing operation as soon as 'targetOutputSize' has been reached, 141 | reducing decompression time. 142 | return : the number of bytes decoded in the destination buffer (necessarily <= maxOutputSize) 143 | Note : this number can be < 'targetOutputSize' should the compressed block to decode be smaller. 144 | Always control how many bytes were decoded. 145 | If the source stream is detected malformed, the function will stop decoding and return a negative result. 146 | This function never writes outside of output buffer, and never reads outside of input buffer. It is therefore protected against malicious data packets 147 | */ 148 | int LZ4API LZ4_decompress_safe_partial (const char* source, char* dest, int inputSize, int targetOutputSize, int maxOutputSize); 149 | 150 | 151 | /* 152 | These functions are provided should you prefer to allocate memory for compression tables with your own allocation methods. 153 | To know how much memory must be allocated for the compression tables, use : 154 | int LZ4_sizeofState(); 155 | 156 | Note that tables must be aligned on 4-bytes boundaries, otherwise compression will fail (return code 0). 157 | 158 | The allocated memory can be provided to the compressions functions using 'void* state' parameter. 159 | LZ4_compress_withState() and LZ4_compress_limitedOutput_withState() are equivalent to previously described functions. 160 | They just use the externally allocated memory area instead of allocating their own (on stack, or on heap). 161 | */ 162 | int LZ4API LZ4_sizeofState(void); 163 | int LZ4API LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize); 164 | int LZ4API LZ4_compress_limitedOutput_withState (void* state, const char* source, char* dest, int inputSize, int maxOutputSize); 165 | 166 | 167 | /************************************** 168 | Streaming Functions 169 | **************************************/ 170 | void* LZ4API LZ4_create (const char* inputBuffer); 171 | int LZ4API LZ4_compress_continue (void* LZ4_Data, const char* source, char* dest, int inputSize); 172 | int LZ4API LZ4_compress_limitedOutput_continue (void* LZ4_Data, const char* source, char* dest, int inputSize, int maxOutputSize); 173 | char* LZ4API LZ4_slideInputBuffer (void* LZ4_Data); 174 | int LZ4API LZ4_free (void* LZ4_Data); 175 | 176 | /* 177 | These functions allow the compression of dependent blocks, where each block benefits from prior 64 KB within preceding blocks. 178 | In order to achieve this, it is necessary to start creating the LZ4 Data Structure, thanks to the function : 179 | 180 | void* LZ4_create (const char* inputBuffer); 181 | The result of the function is the (void*) pointer on the LZ4 Data Structure. 182 | This pointer will be needed in all other functions. 183 | If the pointer returned is NULL, then the allocation has failed, and compression must be aborted. 184 | The only parameter 'const char* inputBuffer' must, obviously, point at the beginning of input buffer. 185 | The input buffer must be already allocated, and size at least 192KB. 186 | 'inputBuffer' will also be the 'const char* source' of the first block. 187 | 188 | All blocks are expected to lay next to each other within the input buffer, starting from 'inputBuffer'. 189 | To compress each block, use either LZ4_compress_continue() or LZ4_compress_limitedOutput_continue(). 190 | Their behavior are identical to LZ4_compress() or LZ4_compress_limitedOutput(), 191 | but require the LZ4 Data Structure as their first argument, and check that each block starts right after the previous one. 192 | If next block does not begin immediately after the previous one, the compression will fail (return 0). 193 | 194 | When it's no longer possible to lay the next block after the previous one (not enough space left into input buffer), a call to : 195 | char* LZ4_slideInputBuffer(void* LZ4_Data); 196 | must be performed. It will typically copy the latest 64KB of input at the beginning of input buffer. 197 | Note that, for this function to work properly, minimum size of an input buffer must be 192KB. 198 | ==> The memory position where the next input data block must start is provided as the result of the function. 199 | 200 | Compression can then resume, using LZ4_compress_continue() or LZ4_compress_limitedOutput_continue(), as usual. 201 | 202 | When compression is completed, a call to LZ4_free() will release the memory used by the LZ4 Data Structure. 203 | */ 204 | 205 | 206 | int LZ4API LZ4_sizeofStreamState(void); 207 | int LZ4API LZ4_resetStreamState(void* state, const char* inputBuffer); 208 | 209 | /* 210 | These functions achieve the same result as : 211 | void* LZ4_create (const char* inputBuffer); 212 | 213 | They are provided here to allow the user program to allocate memory using its own routines. 214 | 215 | To know how much space must be allocated, use LZ4_sizeofStreamState(); 216 | Note also that space must be 4-bytes aligned. 217 | 218 | Once space is allocated, you must initialize it using : LZ4_resetStreamState(void* state, const char* inputBuffer); 219 | void* state is a pointer to the space allocated. 220 | It must be aligned on 4-bytes boundaries, and be large enough. 221 | The parameter 'const char* inputBuffer' must, obviously, point at the beginning of input buffer. 222 | The input buffer must be already allocated, and size at least 192KB. 223 | 'inputBuffer' will also be the 'const char* source' of the first block. 224 | 225 | The same space can be re-used multiple times, just by initializing it each time with LZ4_resetStreamState(). 226 | return value of LZ4_resetStreamState() must be 0 is OK. 227 | Any other value means there was an error (typically, pointer is not aligned on 4-bytes boundaries). 228 | */ 229 | 230 | 231 | int LZ4API LZ4_decompress_safe_withPrefix64k (const char* source, char* dest, int inputSize, int maxOutputSize); 232 | int LZ4API LZ4_decompress_fast_withPrefix64k (const char* source, char* dest, int outputSize); 233 | 234 | /* 235 | *_withPrefix64k() : 236 | These decoding functions work the same as their "normal name" versions, 237 | but can use up to 64KB of data in front of 'char* dest'. 238 | These functions are necessary to decode inter-dependant blocks. 239 | */ 240 | 241 | 242 | /************************************** 243 | Obsolete Functions 244 | **************************************/ 245 | /* 246 | These functions are deprecated and should no longer be used. 247 | They are provided here for compatibility with existing user programs. 248 | */ 249 | int LZ4API LZ4_uncompress (const char* source, char* dest, int outputSize); 250 | int LZ4API LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize); 251 | 252 | 253 | #if defined (__cplusplus) 254 | } 255 | #endif 256 | -------------------------------------------------------------------------------- /ShellCode/lz4压缩使用示例.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCode/lz4压缩使用示例.cpp -------------------------------------------------------------------------------- /ShellCode/mpafile: -------------------------------------------------------------------------------- 1 | ShellCode 2 | 3 | Timestamp is 6353c75a (Sat Oct 22 18:35:06 2022) 4 | 5 | Preferred load address is 0000000140000000 6 | 7 | Start Length Name Class 8 | 0001:00000000 000012c0H .text$mn CODE 9 | 0001:000012c0 00000036H .text$mn$00 CODE 10 | 0001:000012f6 00000036H .text$x CODE 11 | 0002:00000000 00000188H .idata$5 DATA 12 | 0002:00000188 00000028H .00cfg DATA 13 | 0002:000001b0 00000008H .CRT$XCA DATA 14 | 0002:000001b8 00000008H .CRT$XCAA DATA 15 | 0002:000001c0 00000008H .CRT$XCZ DATA 16 | 0002:000001c8 00000008H .CRT$XIA DATA 17 | 0002:000001d0 00000008H .CRT$XIAA DATA 18 | 0002:000001d8 00000008H .CRT$XIAC DATA 19 | 0002:000001e0 00000008H .CRT$XIZ DATA 20 | 0002:000001e8 00000008H .CRT$XPA DATA 21 | 0002:000001f0 00000008H .CRT$XPZ DATA 22 | 0002:000001f8 00000008H .CRT$XTA DATA 23 | 0002:00000200 00000010H .CRT$XTZ DATA 24 | 0002:00000208 00000000H .gehcont$y DATA 25 | 0002:00000208 00000000H .gfids$y DATA 26 | 0002:00000210 000001f0H .rdata DATA 27 | 0002:00000400 00000000H .rdata$CastGuardVftablesA DATA 28 | 0002:00000400 00000000H .rdata$CastGuardVftablesC DATA 29 | 0002:00000400 00000020H .rdata$voltmd DATA 30 | 0002:00000420 000002e0H .rdata$zzzdbg DATA 31 | 0002:00000700 00000008H .rtc$IAA DATA 32 | 0002:00000708 00000008H .rtc$IZZ DATA 33 | 0002:00000710 00000008H .rtc$TAA DATA 34 | 0002:00000718 00000008H .rtc$TZZ DATA 35 | 0002:00000720 00000124H .xdata DATA 36 | 0002:00000844 00000000H .edata DATA 37 | 0002:00000844 000000a0H .idata$2 DATA 38 | 0002:000008e4 00000014H .idata$3 DATA 39 | 0002:000008f8 00000188H .idata$4 DATA 40 | 0002:00000a80 0000041cH .idata$6 DATA 41 | 0003:00000000 00000040H .data DATA 42 | 0003:00000040 00000098H .bss DATA 43 | 0004:00000000 00000168H .pdata DATA 44 | 0005:00000000 00000060H .rsrc$01 DATA 45 | 0005:00000060 00000180H .rsrc$02 DATA 46 | 47 | Address Publics by Value Rva+Base Lib:Object 48 | 49 | 0000:00000000 __guard_longjmp_count 0000000000000000 50 | 0000:00000000 __hybrid_code_map 0000000000000000 51 | 0000:00000000 __arm64x_extra_rfe_table_size 0000000000000000 52 | 0000:00000000 __dynamic_value_reloc_table 0000000000000000 53 | 0000:00000000 __x64_code_ranges_to_entry_points 0000000000000000 54 | 0000:00000000 ___safe_se_handler_count 0000000000000000 55 | 0000:00000000 __hybrid_code_map_count 0000000000000000 56 | 0000:00000000 __guard_longjmp_table 0000000000000000 57 | 0000:00000000 __arm64x_extra_rfe_table 0000000000000000 58 | 0000:00000000 __hybrid_auxiliary_iat 0000000000000000 59 | 0000:00000000 __hybrid_auxiliary_iat_copy 0000000000000000 60 | 0000:00000000 __guard_fids_count 0000000000000000 61 | 0000:00000000 __guard_iat_table 0000000000000000 62 | 0000:00000000 __arm64x_native_entrypoint 0000000000000000 63 | 0000:00000000 __guard_eh_cont_table 0000000000000000 64 | 0000:00000000 __guard_eh_cont_count 0000000000000000 65 | 0000:00000000 ___safe_se_handler_table 0000000000000000 66 | 0000:00000000 __AbsoluteZero 0000000000000000 67 | 0000:00000000 __arm64x_redirection_metadata 0000000000000000 68 | 0000:00000000 __guard_iat_count 0000000000000000 69 | 0000:00000000 __enclave_config 0000000000000000 70 | 0000:00000000 __arm64x_redirection_metadata_count 0000000000000000 71 | 0000:00000000 __guard_check_icall_a64n_fptr 0000000000000000 72 | 0000:00000000 __guard_fids_table 0000000000000000 73 | 0000:00000000 __x64_code_ranges_to_entry_points_count 0000000000000000 74 | 0000:00000100 __guard_flags 0000000000000100 75 | 0000:00000000 __ImageBase 0000000140000000 76 | 0001:00000000 ?EntryPoint@@YAXXZ 0000000140001000 f ShellCode.obj 77 | 0001:000001b0 LZ4_decompress_generic 00000001400011b0 f MYLZ4.obj 78 | 0001:000003f4 B_memcpy 00000001400013f4 f MYLZ4.obj 79 | 0001:00000424 ?Hash_CmpString@@YA_NPEADH@Z 0000000140001424 f MY_API.obj 80 | 0001:00000444 ?GetFunAddrByHash@@YA_KHPEAUHINSTANCE__@@@Z 0000000140001444 f MY_API.obj 81 | 0001:000004dc ?RetX64RunExeAdr@@YAPEADPEADPEAUHINSTANCE__@@@Z 00000001400014dc f MY_API.obj 82 | 0001:0000071c main 000000014000171c f ShellCode.obj 83 | 0001:00000750 GetPc64 0000000140001750 f X64.obj 84 | 0001:00000762 ProcFunA 0000000140001762 X64.obj 85 | 0001:00000762 Debug_PEBBegingDebug 0000000140001762 f X64.obj 86 | 0001:00000772 GetTeb64 0000000140001772 f X64.obj 87 | 0001:0000077c GetPeb64 000000014000177c f X64.obj 88 | 0001:00000786 GetPebLdr64 0000000140001786 f X64.obj 89 | 0001:00000792 GetImageBase64 0000000140001792 f X64.obj 90 | 0001:000007a4 GetModuleBase64 00000001400017a4 f X64.obj 91 | 0001:000007bb Mymemcpy64 00000001400017bb f X64.obj 92 | 0001:000007d5 MySetMemZero64 00000001400017d5 f X64.obj 93 | 0001:00000a44 mainCRTStartup 0000000140001a44 f MSVCRT:exe_main.obj 94 | 0001:00000a58 __scrt_acquire_startup_lock 0000000140001a58 f MSVCRT:utility.obj 95 | 0001:00000a94 __scrt_initialize_crt 0000000140001a94 f MSVCRT:utility.obj 96 | 0001:00000ae0 __scrt_initialize_onexit_tables 0000000140001ae0 f MSVCRT:utility.obj 97 | 0001:00000b6c __scrt_is_nonwritable_in_current_image 0000000140001b6c f MSVCRT:utility.obj 98 | 0001:00000c04 __scrt_release_startup_lock 0000000140001c04 f MSVCRT:utility.obj 99 | 0001:00000c28 __scrt_uninitialize_crt 0000000140001c28 f MSVCRT:utility.obj 100 | 0001:00000c54 _onexit 0000000140001c54 f MSVCRT:utility.obj 101 | 0001:00000c90 atexit 0000000140001c90 f MSVCRT:utility.obj 102 | 0001:00000ca8 __security_init_cookie 0000000140001ca8 f MSVCRT:gs_support.obj 103 | 0001:00000d54 _matherr 0000000140001d54 f MSVCRT:matherr.obj 104 | 0001:00000d54 __scrt_exe_initialize_mta 0000000140001d54 f MSVCRT:utility_desktop.obj 105 | 0001:00000d54 _get_startup_commit_mode 0000000140001d54 f MSVCRT:commit_mode.obj 106 | 0001:00000d54 __scrt_initialize_winrt 0000000140001d54 f MSVCRT:utility_desktop.obj 107 | 0001:00000d54 _get_startup_thread_locale_mode 0000000140001d54 f MSVCRT:thread_locale.obj 108 | 0001:00000d54 __scrt_stub_for_initialize_mta 0000000140001d54 f MSVCRT:utility_desktop.obj 109 | 0001:00000d54 _get_startup_new_mode 0000000140001d54 f MSVCRT:new_mode.obj 110 | 0001:00000d58 _get_startup_argv_mode 0000000140001d58 f MSVCRT:argv_mode.obj 111 | 0001:00000d60 _get_startup_file_mode 0000000140001d60 f MSVCRT:file_mode.obj 112 | 0001:00000d68 ?__scrt_initialize_type_info@@YAXXZ 0000000140001d68 f MSVCRT:tncleanup.obj 113 | 0001:00000d78 __vcrt_uninitialize 0000000140001d78 f MSVCRT:ucrt_stubs.obj 114 | 0001:00000d78 __scrt_stub_for_acrt_initialize 0000000140001d78 f MSVCRT:ucrt_stubs.obj 115 | 0001:00000d78 __vcrt_initialize 0000000140001d78 f MSVCRT:ucrt_stubs.obj 116 | 0001:00000d78 __scrt_stub_for_acrt_uninitialize 0000000140001d78 f MSVCRT:ucrt_stubs.obj 117 | 0001:00000d78 __acrt_initialize 0000000140001d78 f MSVCRT:ucrt_stubs.obj 118 | 0001:00000d78 _should_initialize_environment 0000000140001d78 f MSVCRT:env_mode.obj 119 | 0001:00000d78 __acrt_uninitialize 0000000140001d78 f MSVCRT:ucrt_stubs.obj 120 | 0001:00000d7c _initialize_invalid_parameter_handler 0000000140001d7c f MSVCRT:invalid_parameter_handler.obj 121 | 0001:00000d7c _initialize_denormal_control 0000000140001d7c f MSVCRT:denormal_control.obj 122 | 0001:00000d7c _guard_check_icall_nop 0000000140001d7c f MSVCRT:guard_support.obj 123 | 0001:00000d80 __local_stdio_printf_options 0000000140001d80 f i MSVCRT:default_local_stdio_options.obj 124 | 0001:00000d88 __local_stdio_scanf_options 0000000140001d88 f i MSVCRT:default_local_stdio_options.obj 125 | 0001:00000d90 __scrt_initialize_default_local_stdio_options 0000000140001d90 f MSVCRT:default_local_stdio_options.obj 126 | 0001:00000dac __scrt_is_user_matherr_present 0000000140001dac f MSVCRT:matherr_detection.obj 127 | 0001:00000db8 __scrt_get_dyn_tls_init_callback 0000000140001db8 f MSVCRT:dyn_tls_init.obj 128 | 0001:00000dc0 __scrt_get_dyn_tls_dtor_callback 0000000140001dc0 f MSVCRT:dyn_tls_dtor.obj 129 | 0001:00000dc8 __crt_debugger_hook 0000000140001dc8 f MSVCRT:utility_desktop.obj 130 | 0001:00000dd0 __scrt_fastfail 0000000140001dd0 f MSVCRT:utility_desktop.obj 131 | 0001:00000f1c __scrt_initialize_mta 0000000140001f1c f MSVCRT:utility_desktop.obj 132 | 0001:00000f24 __scrt_is_managed_app 0000000140001f24 f MSVCRT:utility_desktop.obj 133 | 0001:00000f78 __scrt_set_unhandled_exception_filter 0000000140001f78 f MSVCRT:utility_desktop.obj 134 | 0001:00000f88 __scrt_unhandled_exception_filter 0000000140001f88 f MSVCRT:utility_desktop.obj 135 | 0001:00000fe4 _RTC_Initialize 0000000140001fe4 f MSVCRT:initsect.obj 136 | 0001:00001020 _RTC_Terminate 0000000140002020 f MSVCRT:initsect.obj 137 | 0001:0000105c __isa_available_init 000000014000205c f MSVCRT:cpu_disp.obj 138 | 0001:00001200 __scrt_is_ucrt_dll_in_use 0000000140002200 f MSVCRT:ucrt_detection.obj 139 | 0001:00001210 __C_specific_handler 0000000140002210 f vcruntime:VCRUNTIME140.dll 140 | 0001:00001216 __current_exception 0000000140002216 f vcruntime:VCRUNTIME140.dll 141 | 0001:0000121c __current_exception_context 000000014000221c f vcruntime:VCRUNTIME140.dll 142 | 0001:00001222 memset 0000000140002222 f vcruntime:VCRUNTIME140.dll 143 | 0001:00001228 _seh_filter_exe 0000000140002228 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 144 | 0001:0000122e _set_app_type 000000014000222e f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 145 | 0001:00001234 __setusermatherr 0000000140002234 f ucrt:api-ms-win-crt-math-l1-1-0.dll 146 | 0001:0000123a _configure_narrow_argv 000000014000223a f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 147 | 0001:00001240 _initialize_narrow_environment 0000000140002240 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 148 | 0001:00001246 _get_initial_narrow_environment 0000000140002246 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 149 | 0001:0000124c _initterm 000000014000224c f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 150 | 0001:00001252 _initterm_e 0000000140002252 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 151 | 0001:00001258 exit 0000000140002258 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 152 | 0001:0000125e _exit 000000014000225e f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 153 | 0001:00001264 _set_fmode 0000000140002264 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll 154 | 0001:0000126a __p___argc 000000014000226a f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 155 | 0001:00001270 __p___argv 0000000140002270 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 156 | 0001:00001276 _cexit 0000000140002276 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 157 | 0001:0000127c _c_exit 000000014000227c f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 158 | 0001:00001282 _register_thread_local_exe_atexit_callback 0000000140002282 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 159 | 0001:00001288 _configthreadlocale 0000000140002288 f ucrt:api-ms-win-crt-locale-l1-1-0.dll 160 | 0001:0000128e _set_new_mode 000000014000228e f ucrt:api-ms-win-crt-heap-l1-1-0.dll 161 | 0001:00001294 __p__commode 0000000140002294 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll 162 | 0001:0000129a _initialize_onexit_table 000000014000229a f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 163 | 0001:000012a0 _register_onexit_function 00000001400022a0 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 164 | 0001:000012a6 _crt_atexit 00000001400022a6 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 165 | 0001:000012ac terminate 00000001400022ac f ucrt:api-ms-win-crt-runtime-l1-1-0.dll 166 | 0001:000012d0 _guard_dispatch_icall_nop 00000001400022d0 f MSVCRT:guard_dispatch.obj 167 | 0001:000012f0 _guard_xfg_dispatch_icall_nop 00000001400022f0 f MSVCRT:guard_xfg_dispatch.obj 168 | 0002:00000000 __imp_RtlVirtualUnwind 0000000140003000 kernel32:KERNEL32.dll 169 | 0002:00000008 __imp_GetModuleHandleW 0000000140003008 kernel32:KERNEL32.dll 170 | 0002:00000010 __imp_IsProcessorFeaturePresent 0000000140003010 kernel32:KERNEL32.dll 171 | 0002:00000018 __imp_SetUnhandledExceptionFilter 0000000140003018 kernel32:KERNEL32.dll 172 | 0002:00000020 __imp_UnhandledExceptionFilter 0000000140003020 kernel32:KERNEL32.dll 173 | 0002:00000028 __imp_IsDebuggerPresent 0000000140003028 kernel32:KERNEL32.dll 174 | 0002:00000030 __imp_QueryPerformanceCounter 0000000140003030 kernel32:KERNEL32.dll 175 | 0002:00000038 __imp_RtlLookupFunctionEntry 0000000140003038 kernel32:KERNEL32.dll 176 | 0002:00000040 __imp_RtlCaptureContext 0000000140003040 kernel32:KERNEL32.dll 177 | 0002:00000048 __imp_InitializeSListHead 0000000140003048 kernel32:KERNEL32.dll 178 | 0002:00000050 __imp_GetSystemTimeAsFileTime 0000000140003050 kernel32:KERNEL32.dll 179 | 0002:00000058 __imp_GetCurrentThreadId 0000000140003058 kernel32:KERNEL32.dll 180 | 0002:00000060 __imp_GetCurrentProcessId 0000000140003060 kernel32:KERNEL32.dll 181 | 0002:00000068 \177KERNEL32_NULL_THUNK_DATA 0000000140003068 kernel32:KERNEL32.dll 182 | 0002:00000070 __imp_MessageBoxA 0000000140003070 user32:USER32.dll 183 | 0002:00000078 \177USER32_NULL_THUNK_DATA 0000000140003078 user32:USER32.dll 184 | 0002:00000080 __imp_memset 0000000140003080 vcruntime:VCRUNTIME140.dll 185 | 0002:00000088 __imp___current_exception_context 0000000140003088 vcruntime:VCRUNTIME140.dll 186 | 0002:00000090 __imp___C_specific_handler 0000000140003090 vcruntime:VCRUNTIME140.dll 187 | 0002:00000098 __imp___current_exception 0000000140003098 vcruntime:VCRUNTIME140.dll 188 | 0002:000000a0 \177VCRUNTIME140_NULL_THUNK_DATA 00000001400030a0 vcruntime:VCRUNTIME140.dll 189 | 0002:000000a8 __imp__set_new_mode 00000001400030a8 ucrt:api-ms-win-crt-heap-l1-1-0.dll 190 | 0002:000000b0 \177api-ms-win-crt-heap-l1-1-0_NULL_THUNK_DATA 00000001400030b0 ucrt:api-ms-win-crt-heap-l1-1-0.dll 191 | 0002:000000b8 __imp__configthreadlocale 00000001400030b8 ucrt:api-ms-win-crt-locale-l1-1-0.dll 192 | 0002:000000c0 \177api-ms-win-crt-locale-l1-1-0_NULL_THUNK_DATA 00000001400030c0 ucrt:api-ms-win-crt-locale-l1-1-0.dll 193 | 0002:000000c8 __imp___setusermatherr 00000001400030c8 ucrt:api-ms-win-crt-math-l1-1-0.dll 194 | 0002:000000d0 \177api-ms-win-crt-math-l1-1-0_NULL_THUNK_DATA 00000001400030d0 ucrt:api-ms-win-crt-math-l1-1-0.dll 195 | 0002:000000d8 __imp__register_onexit_function 00000001400030d8 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 196 | 0002:000000e0 __imp__crt_atexit 00000001400030e0 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 197 | 0002:000000e8 __imp__initialize_onexit_table 00000001400030e8 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 198 | 0002:000000f0 __imp_terminate 00000001400030f0 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 199 | 0002:000000f8 __imp__initterm_e 00000001400030f8 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 200 | 0002:00000100 __imp_exit 0000000140003100 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 201 | 0002:00000108 __imp__register_thread_local_exe_atexit_callback 0000000140003108 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 202 | 0002:00000110 __imp__c_exit 0000000140003110 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 203 | 0002:00000118 __imp__cexit 0000000140003118 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 204 | 0002:00000120 __imp__initterm 0000000140003120 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 205 | 0002:00000128 __imp__get_initial_narrow_environment 0000000140003128 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 206 | 0002:00000130 __imp__initialize_narrow_environment 0000000140003130 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 207 | 0002:00000138 __imp__configure_narrow_argv 0000000140003138 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 208 | 0002:00000140 __imp___p___argv 0000000140003140 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 209 | 0002:00000148 __imp__set_app_type 0000000140003148 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 210 | 0002:00000150 __imp__seh_filter_exe 0000000140003150 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 211 | 0002:00000158 __imp___p___argc 0000000140003158 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 212 | 0002:00000160 __imp__exit 0000000140003160 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 213 | 0002:00000168 \177api-ms-win-crt-runtime-l1-1-0_NULL_THUNK_DATA 0000000140003168 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 214 | 0002:00000170 __imp__set_fmode 0000000140003170 ucrt:api-ms-win-crt-stdio-l1-1-0.dll 215 | 0002:00000178 __imp___p__commode 0000000140003178 ucrt:api-ms-win-crt-stdio-l1-1-0.dll 216 | 0002:00000180 \177api-ms-win-crt-stdio-l1-1-0_NULL_THUNK_DATA 0000000140003180 ucrt:api-ms-win-crt-stdio-l1-1-0.dll 217 | 0002:00000188 __guard_check_icall_fptr 0000000140003188 MSVCRT:guard_support.obj 218 | 0002:00000190 __guard_xfg_check_icall_fptr 0000000140003190 MSVCRT:guard_support.obj 219 | 0002:00000198 __guard_dispatch_icall_fptr 0000000140003198 MSVCRT:guard_support.obj 220 | 0002:000001a0 __guard_xfg_dispatch_icall_fptr 00000001400031a0 MSVCRT:guard_support.obj 221 | 0002:000001a8 __guard_xfg_table_dispatch_icall_fptr 00000001400031a8 MSVCRT:guard_support.obj 222 | 0002:000001b0 __xc_a 00000001400031b0 MSVCRT:initializers.obj 223 | 0002:000001c0 __xc_z 00000001400031c0 MSVCRT:initializers.obj 224 | 0002:000001c8 __xi_a 00000001400031c8 MSVCRT:initializers.obj 225 | 0002:000001e0 __xi_z 00000001400031e0 MSVCRT:initializers.obj 226 | 0002:000001e8 __xp_a 00000001400031e8 MSVCRT:initializers.obj 227 | 0002:000001f0 __xp_z 00000001400031f0 MSVCRT:initializers.obj 228 | 0002:000001f8 __xt_a 00000001400031f8 MSVCRT:initializers.obj 229 | 0002:00000200 __xt_z 0000000140003200 MSVCRT:initializers.obj 230 | 0002:00000210 __xmm@ffffffffffffffffffffffffffffffff 0000000140003210 MSVCRT:utility.obj 231 | 0002:00000280 _load_config_used 0000000140003280 MSVCRT:loadcfg.obj 232 | 0002:00000400 __volatile_metadata 0000000140003400 233 | 0002:00000700 __rtc_iaa 0000000140003700 MSVCRT:initsect.obj 234 | 0002:00000708 __rtc_izz 0000000140003708 MSVCRT:initsect.obj 235 | 0002:00000710 __rtc_taa 0000000140003710 MSVCRT:initsect.obj 236 | 0002:00000718 __rtc_tzz 0000000140003718 MSVCRT:initsect.obj 237 | 0002:00000844 __IMPORT_DESCRIPTOR_USER32 0000000140003844 user32:USER32.dll 238 | 0002:00000858 __IMPORT_DESCRIPTOR_VCRUNTIME140 0000000140003858 vcruntime:VCRUNTIME140.dll 239 | 0002:0000086c __IMPORT_DESCRIPTOR_api-ms-win-crt-runtime-l1-1-0 000000014000386c ucrt:api-ms-win-crt-runtime-l1-1-0.dll 240 | 0002:00000880 __IMPORT_DESCRIPTOR_api-ms-win-crt-math-l1-1-0 0000000140003880 ucrt:api-ms-win-crt-math-l1-1-0.dll 241 | 0002:00000894 __IMPORT_DESCRIPTOR_api-ms-win-crt-stdio-l1-1-0 0000000140003894 ucrt:api-ms-win-crt-stdio-l1-1-0.dll 242 | 0002:000008a8 __IMPORT_DESCRIPTOR_api-ms-win-crt-locale-l1-1-0 00000001400038a8 ucrt:api-ms-win-crt-locale-l1-1-0.dll 243 | 0002:000008bc __IMPORT_DESCRIPTOR_api-ms-win-crt-heap-l1-1-0 00000001400038bc ucrt:api-ms-win-crt-heap-l1-1-0.dll 244 | 0002:000008d0 __IMPORT_DESCRIPTOR_KERNEL32 00000001400038d0 kernel32:KERNEL32.dll 245 | 0002:000008e4 __NULL_IMPORT_DESCRIPTOR 00000001400038e4 user32:USER32.dll 246 | 0003:00000000 __scrt_native_dllmain_reason 0000000140004000 MSVCRT:utility.obj 247 | 0003:00000004 __scrt_default_matherr 0000000140004004 MSVCRT:matherr.obj 248 | 0003:00000008 __isa_available 0000000140004008 MSVCRT:cpu_disp.obj 249 | 0003:0000000c __isa_enabled 000000014000400c MSVCRT:cpu_disp.obj 250 | 0003:00000010 __memcpy_nt_iters 0000000140004010 MSVCRT:cpu_disp.obj 251 | 0003:00000018 __memset_nt_iters 0000000140004018 MSVCRT:cpu_disp.obj 252 | 0003:00000020 __security_cookie_complement 0000000140004020 MSVCRT:gs_cookie.obj 253 | 0003:00000028 __security_cookie 0000000140004028 MSVCRT:gs_cookie.obj 254 | 0003:00000030 __scrt_ucrt_dll_is_in_use 0000000140004030 MSVCRT:ucrt_stubs.obj 255 | 0003:00000040 __scrt_current_native_startup_state 0000000140004040 MSVCRT:utility.obj 256 | 0003:00000048 __scrt_native_startup_lock 0000000140004048 MSVCRT:utility.obj 257 | 0003:00000090 ?__type_info_root_node@@3U__type_info_node@@A 0000000140004090 MSVCRT:tncleanup.obj 258 | 0003:000000a0 ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA 00000001400040a0 MSVCRT:default_local_stdio_options.obj 259 | 0003:000000a8 ?_OptionsStorage@?1??__local_stdio_scanf_options@@9@4_KA 00000001400040a8 MSVCRT:default_local_stdio_options.obj 260 | 0003:000000b0 __scrt_debugger_hook_flag 00000001400040b0 MSVCRT:utility_desktop.obj 261 | 0003:000000b8 __castguard_check_failure_os_handled_fptr 00000001400040b8 MSVCRT:guard_support.obj 262 | 0003:000000c0 __favor 00000001400040c0 MSVCRT:cpu_disp.obj 263 | 0003:000000c8 __dyn_tls_dtor_callback 00000001400040c8 264 | 0003:000000d0 __dyn_tls_init_callback 00000001400040d0 265 | 266 | entry point at 0001:00000a44 267 | 268 | Static symbols 269 | 270 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-heap-l1-1-0.dll 271 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-locale-l1-1-0.dll 272 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-math-l1-1-0.dll 273 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 274 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 275 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 276 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 277 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 278 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 279 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 280 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 281 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 282 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 283 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 284 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 285 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 286 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 287 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 288 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 289 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 290 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 291 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 292 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 293 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 294 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll 295 | 0000:ffff8000 .debug$S 0000000140000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll 296 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 297 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 298 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 299 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 300 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 301 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 302 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 303 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 304 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 305 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 306 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 307 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 308 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 309 | 0000:ffff8000 .debug$S 0000000140000000 kernel32:KERNEL32.dll 310 | 0000:ffff8000 .debug$S 0000000140000000 user32:USER32.dll 311 | 0000:ffff8000 .debug$S 0000000140000000 vcruntime:VCRUNTIME140.dll 312 | 0000:ffff8000 .debug$S 0000000140000000 vcruntime:VCRUNTIME140.dll 313 | 0000:ffff8000 .debug$S 0000000140000000 vcruntime:VCRUNTIME140.dll 314 | 0000:ffff8000 .debug$S 0000000140000000 vcruntime:VCRUNTIME140.dll 315 | 0000:ffff8000 .debug$S 0000000140000000 vcruntime:VCRUNTIME140.dll 316 | 0001:000007e4 ?pre_c_initialization@@YAHXZ 00000001400017e4 f MSVCRT:exe_main.obj 317 | 0001:0000089c ?post_pgo_initialization@@YAHXZ 000000014000189c f MSVCRT:exe_main.obj 318 | 0001:000008ac ?pre_cpp_initialization@@YAXXZ 00000001400018ac f MSVCRT:exe_main.obj 319 | 0001:000008c8 ?__scrt_common_main_seh@@YAHXZ 00000001400018c8 f MSVCRT:exe_main.obj 320 | 0001:000012c0 $$000000 00000001400022c0 MSVCRT:guard_dispatch.obj 321 | 0001:000012e0 $$000000 00000001400022e0 MSVCRT:guard_xfg_dispatch.obj 322 | 0001:000012f6 ?filt$0@?0??__scrt_common_main_seh@@YAHXZ@4HA 00000001400022f6 f MSVCRT:exe_main.obj 323 | 0001:00001314 __scrt_is_nonwritable_in_current_image$filt$0 0000000140002314 f MSVCRT:utility.obj 324 | 0002:000001b8 ?pre_cpp_initializer@@3P6AXXZEA 00000001400031b8 MSVCRT:exe_main.obj 325 | 0002:000001d0 ?pre_c_initializer@@3P6AHXZEA 00000001400031d0 MSVCRT:exe_main.obj 326 | 0002:000001d8 ?post_pgo_initializer@@3P6AHXZEA 00000001400031d8 MSVCRT:exe_main.obj 327 | 0002:00000220 ?_Fake_alloc@std@@3U_Fake_allocator@1@B 0000000140003220 MY_API.obj 328 | 0002:00000221 ?_Fake_alloc@std@@3U_Fake_allocator@1@B 0000000140003221 ShellCode.obj 329 | 0002:00000720 $unwind$?EntryPoint@@YAXXZ 0000000140003720 ShellCode.obj 330 | 0002:00000738 $unwind$LZ4_decompress_generic 0000000140003738 MYLZ4.obj 331 | 0002:00000758 $unwind$?GetFunAddrByHash@@YA_KHPEAUHINSTANCE__@@@Z 0000000140003758 MY_API.obj 332 | 0002:0000076c $unwind$?RetX64RunExeAdr@@YAPEADPEADPEAUHINSTANCE__@@@Z 000000014000376c MY_API.obj 333 | 0002:00000784 $unwind$main 0000000140003784 ShellCode.obj 334 | 0002:00000784 $unwind$__scrt_initialize_default_local_stdio_options 0000000140003784 MSVCRT:default_local_stdio_options.obj 335 | 0002:00000784 $unwind$?post_pgo_initialization@@YAHXZ 0000000140003784 MSVCRT:exe_main.obj 336 | 0002:00000784 $unwind$?pre_cpp_initialization@@YAXXZ 0000000140003784 MSVCRT:exe_main.obj 337 | 0002:00000784 $unwind$mainCRTStartup 0000000140003784 MSVCRT:exe_main.obj 338 | 0002:00000784 $unwind$__scrt_acquire_startup_lock 0000000140003784 MSVCRT:utility.obj 339 | 0002:00000784 $unwind$atexit 0000000140003784 MSVCRT:utility.obj 340 | 0002:00000784 $unwind$__scrt_is_managed_app 0000000140003784 MSVCRT:utility_desktop.obj 341 | 0002:0000078c $unwind$?pre_c_initialization@@YAHXZ 000000014000378c MSVCRT:exe_main.obj 342 | 0002:0000078c $unwind$__scrt_initialize_crt 000000014000378c MSVCRT:utility.obj 343 | 0002:0000078c $unwind$__scrt_initialize_onexit_tables 000000014000378c MSVCRT:utility.obj 344 | 0002:0000078c $unwind$__scrt_release_startup_lock 000000014000378c MSVCRT:utility.obj 345 | 0002:0000078c $unwind$__scrt_uninitialize_crt 000000014000378c MSVCRT:utility.obj 346 | 0002:0000078c $unwind$_onexit 000000014000378c MSVCRT:utility.obj 347 | 0002:00000794 $unwind$?__scrt_common_main_seh@@YAHXZ 0000000140003794 MSVCRT:exe_main.obj 348 | 0002:000007cc $unwind$?filt$0@?0??__scrt_common_main_seh@@YAHXZ@4HA 00000001400037cc MSVCRT:exe_main.obj 349 | 0002:000007d4 $unwind$__scrt_is_nonwritable_in_current_image 00000001400037d4 MSVCRT:utility.obj 350 | 0002:000007f4 $unwind$__scrt_is_nonwritable_in_current_image$filt$0 00000001400037f4 MSVCRT:utility.obj 351 | 0002:000007fc $unwind$__security_init_cookie 00000001400037fc MSVCRT:gs_support.obj 352 | 0002:00000808 $unwind$__scrt_fastfail 0000000140003808 MSVCRT:utility_desktop.obj 353 | 0002:00000818 $unwind$_RTC_Initialize 0000000140003818 MSVCRT:initsect.obj 354 | 0002:00000818 $unwind$_RTC_Terminate 0000000140003818 MSVCRT:initsect.obj 355 | 0002:00000818 $unwind$__scrt_unhandled_exception_filter 0000000140003818 MSVCRT:utility_desktop.obj 356 | 0002:00000824 $unwind$__isa_available_init 0000000140003824 MSVCRT:cpu_disp.obj 357 | 0002:00000838 $xdatasym 0000000140003838 MSVCRT:guard_dispatch.obj 358 | 0002:00000840 $xdatasym 0000000140003840 MSVCRT:guard_xfg_dispatch.obj 359 | 0002:00000a8e .idata$6 0000000140003a8e user32:USER32.dll 360 | 0002:00000af0 .idata$6 0000000140003af0 vcruntime:VCRUNTIME140.dll 361 | 0002:00000cb4 .idata$6 0000000140003cb4 ucrt:api-ms-win-crt-runtime-l1-1-0.dll 362 | 0002:00000cd6 .idata$6 0000000140003cd6 ucrt:api-ms-win-crt-math-l1-1-0.dll 363 | 0002:00000cf6 .idata$6 0000000140003cf6 ucrt:api-ms-win-crt-stdio-l1-1-0.dll 364 | 0002:00000d16 .idata$6 0000000140003d16 ucrt:api-ms-win-crt-locale-l1-1-0.dll 365 | 0002:00000d38 .idata$6 0000000140003d38 ucrt:api-ms-win-crt-heap-l1-1-0.dll 366 | 0002:00000e8e .idata$6 0000000140003e8e kernel32:KERNEL32.dll 367 | 0003:00000050 ?is_initialized_as_dll@@3_NA 0000000140004050 MSVCRT:utility.obj 368 | 0003:00000051 ?module_local_atexit_table_initialized@@3_NA 0000000140004051 MSVCRT:utility.obj 369 | 0003:00000058 ?module_local_atexit_table@@3U_onexit_table_t@@A 0000000140004058 MSVCRT:utility.obj 370 | 0003:00000070 ?module_local_at_quick_exit_table@@3U_onexit_table_t@@A 0000000140004070 MSVCRT:utility.obj 371 | 0005:00000060 $R000000 0000000140006060 * linker generated manifest res * 372 | -------------------------------------------------------------------------------- /ShellCode/x64/Debug/ShellCodeBuild.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCode/x64/Debug/ShellCodeBuild.exe -------------------------------------------------------------------------------- /ShellCode/x64/Debug/ShellCodeBuild.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCode/x64/Debug/ShellCodeBuild.pdb -------------------------------------------------------------------------------- /ShellCodeBuild/1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/1.bin -------------------------------------------------------------------------------- /ShellCodeBuild/C_ToShell.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/C_ToShell.cpp -------------------------------------------------------------------------------- /ShellCodeBuild/C_ToShell.h: -------------------------------------------------------------------------------- 1 | 2 | #define _CRT_SECURE_NO_WARNINGS 3 | #include 4 | #include 5 | #include "lz4.h" 6 | #include "PE_TOOL.h" 7 | using namespace std; 8 | DWORD TO_SHELL(string SrcFile, string OutFile); -------------------------------------------------------------------------------- /ShellCodeBuild/Debug/ShellCodeBuild.exe.recipe: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | E:\DIY\ShellCode\Debug\ShellCodeBuild.exe 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ShellCodeBuild/Debug/ShellCodeBuild.vcxproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/Debug/ShellCodeBuild.vcxproj.FileListAbsolute.txt -------------------------------------------------------------------------------- /ShellCodeBuild/PE_TOOL.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/PE_TOOL.cpp -------------------------------------------------------------------------------- /ShellCodeBuild/PE_TOOL.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/PE_TOOL.h -------------------------------------------------------------------------------- /ShellCodeBuild/ShellCodeBuild.cpp: -------------------------------------------------------------------------------- 1 | // ShellCodeBuild.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 2 | // 3 | 4 | #include 5 | #include 6 | #include "ShellLoader.h" 7 | #include "C_ToShell.h" 8 | 9 | //压缩的信息返回出去 10 | typedef struct COMPRESSINFO 11 | { 12 | //预估压缩后的字节数 【压缩后的字节数】 13 | DWORD Retcompress_size; 14 | //文件原来的大小 15 | DWORD SrcFile_size; 16 | //返回的指针 17 | char* pRetNewBuffer; 18 | 19 | }CompressInfo, * pCompressInfo; 20 | 21 | 22 | int main() 23 | { 24 | TO_SHELL("ServerX64.exe", "1.bin"); 25 | 26 | std::cout << "Hello World!\n"; 27 | } 28 | -------------------------------------------------------------------------------- /ShellCodeBuild/ShellCodeBuild.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {73afd484-e5a8-4f89-a097-a61e9228a075} 25 | ShellCodeBuild 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | false 78 | 79 | 80 | true 81 | 82 | 83 | false 84 | 85 | 86 | 87 | Level3 88 | true 89 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 90 | true 91 | 92 | 93 | Console 94 | true 95 | 96 | 97 | 98 | 99 | Level3 100 | true 101 | true 102 | true 103 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 104 | true 105 | 106 | 107 | Console 108 | true 109 | true 110 | true 111 | 112 | 113 | 114 | 115 | Level3 116 | true 117 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 118 | true 119 | 120 | 121 | Console 122 | true 123 | 124 | 125 | 126 | 127 | Level3 128 | true 129 | true 130 | true 131 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 132 | true 133 | 134 | 135 | Console 136 | true 137 | true 138 | true 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /ShellCodeBuild/ShellCodeBuild.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 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 | -------------------------------------------------------------------------------- /ShellCodeBuild/ShellCodeBuild.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ShellCodeBuild/ShellLoader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | BYTE ShellCodeLoader[] = { 3 | 0x55, 0x8B, 0xEC, 0x83, 0xE4, 0xF8, 0x83, 0xEC, 0x54, 0x53, 0x56, 0x57, 0xE8, 0x63, 0x06, 0x00, 4 | 0x00, 0x33, 0xDB, 0x89, 0x44, 0x24, 0x2C, 0xC7, 0x44, 0x24, 0x18, 0x32, 0x32, 0x32, 0x32, 0xC7, 5 | 0x44, 0x24, 0x14, 0x33, 0x33, 0x33, 0x33, 0xC7, 0x44, 0x24, 0x10, 0x34, 0x34, 0x34, 0x34, 0xC7, 6 | 0x44, 0x24, 0x44, 0x75, 0x73, 0x65, 0x72, 0xC7, 0x44, 0x24, 0x48, 0x33, 0x32, 0x2E, 0x64, 0x66, 7 | 0xC7, 0x44, 0x24, 0x4C, 0x6C, 0x6C, 0x88, 0x5C, 0x24, 0x4E, 0xC7, 0x44, 0x24, 0x50, 0x6B, 0x65, 8 | 0x72, 0x6E, 0xC7, 0x44, 0x24, 0x54, 0x65, 0x6C, 0x33, 0x32, 0xC7, 0x44, 0x24, 0x58, 0x2E, 0x64, 9 | 0x6C, 0x6C, 0x88, 0x5C, 0x24, 0x5C, 0xC7, 0x44, 0x24, 0x38, 0x6E, 0x74, 0x64, 0x6C, 0xC7, 0x44, 10 | 0x24, 0x3C, 0x6C, 0x2E, 0x64, 0x6C, 0x66, 0xC7, 0x44, 0x24, 0x40, 0x6C, 0x00, 0xE8, 0xFB, 0x05, 11 | 0x00, 0x00, 0xE8, 0x0D, 0x06, 0x00, 0x00, 0x8B, 0xD0, 0xB9, 0x87, 0x32, 0xD8, 0xC0, 0xE8, 0x1C, 12 | 0x03, 0x00, 0x00, 0x53, 0x8B, 0xF0, 0x8D, 0x44, 0x24, 0x54, 0x53, 0x50, 0xFF, 0xD6, 0x6A, 0x00, 13 | 0x8B, 0xD8, 0x8D, 0x44, 0x24, 0x3C, 0x6A, 0x00, 0x50, 0xFF, 0xD6, 0x6A, 0x00, 0x8B, 0xF8, 0x8D, 14 | 0x44, 0x24, 0x48, 0x6A, 0x00, 0x50, 0xFF, 0xD6, 0x8B, 0xD3, 0xB9, 0x67, 0x59, 0xDE, 0x1E, 0xE8, 15 | 0xEB, 0x02, 0x00, 0x00, 0x8B, 0xD3, 0x89, 0x44, 0x24, 0x28, 0xB9, 0xBB, 0xF8, 0x29, 0x27, 0xE8, 16 | 0xDB, 0x02, 0x00, 0x00, 0x8B, 0xD3, 0x89, 0x44, 0x24, 0x30, 0xB9, 0xCA, 0xAF, 0x16, 0x22, 0xE8, 17 | 0xCB, 0x02, 0x00, 0x00, 0x8B, 0xD7, 0xB9, 0xD7, 0x6E, 0x8F, 0x81, 0x8B, 0xD8, 0xE8, 0xBD, 0x02, 18 | 0x00, 0x00, 0x8B, 0xF0, 0x33, 0xFF, 0x6A, 0x04, 0x8D, 0x44, 0x24, 0x14, 0x89, 0x7C, 0x24, 0x28, 19 | 0x50, 0x8D, 0x44, 0x24, 0x2C, 0x89, 0x7C, 0x24, 0x28, 0x50, 0x89, 0x7C, 0x24, 0x28, 0xFF, 0xD6, 20 | 0x83, 0xC4, 0x0C, 0x8D, 0x44, 0x24, 0x14, 0x6A, 0x04, 0x50, 0x8D, 0x44, 0x24, 0x28, 0x50, 0xFF, 21 | 0xD6, 0x83, 0xC4, 0x0C, 0x8D, 0x44, 0x24, 0x18, 0x6A, 0x04, 0x50, 0x8D, 0x44, 0x24, 0x24, 0x50, 22 | 0xFF, 0xD6, 0x83, 0xC4, 0x0C, 0x6A, 0x40, 0x68, 0x00, 0x10, 0x00, 0x00, 0xFF, 0x74, 0x24, 0x24, 23 | 0x57, 0xFF, 0x54, 0x24, 0x38, 0x8B, 0x4C, 0x24, 0x24, 0x83, 0xEC, 0x10, 0x03, 0x4C, 0x24, 0x3C, 24 | 0x8B, 0xF0, 0x8B, 0xD6, 0xFF, 0x74, 0x24, 0x2C, 0xFF, 0x74, 0x24, 0x34, 0xE8, 0x3B, 0x00, 0x00, 25 | 0x00, 0x83, 0xC4, 0x18, 0x8B, 0xCE, 0xE8, 0xDE, 0x02, 0x00, 0x00, 0x57, 0x57, 0x57, 0x50, 0x57, 26 | 0x57, 0xFF, 0x54, 0x24, 0x48, 0x6A, 0xFF, 0x50, 0xFF, 0xD3, 0x5F, 0x5E, 0x5B, 0x8B, 0xE5, 0x5D, 27 | 0xC3, 0x56, 0x33, 0xF6, 0xEB, 0x09, 0xC1, 0xCE, 0x07, 0x0F, 0xBE, 0xC0, 0x03, 0xF0, 0x41, 0x8A, 28 | 0x01, 0x84, 0xC0, 0x75, 0xF1, 0x3B, 0xD6, 0x5E, 0x0F, 0x94, 0xC0, 0xC3, 0x55, 0x8B, 0xEC, 0x83, 29 | 0xEC, 0x34, 0x53, 0x56, 0x57, 0x8B, 0x7D, 0x08, 0x8B, 0xC2, 0x89, 0x4D, 0xF4, 0x8B, 0xF1, 0x8B, 30 | 0xD8, 0x89, 0x45, 0xFC, 0x8B, 0x45, 0x0C, 0x8D, 0x14, 0x39, 0xC7, 0x45, 0xD0, 0x01, 0x00, 0x00, 31 | 0x00, 0x8B, 0xCB, 0x89, 0x55, 0x08, 0x03, 0xC8, 0xC7, 0x45, 0xD4, 0x02, 0x00, 0x00, 0x00, 0x89, 32 | 0x4D, 0x0C, 0xC7, 0x45, 0xD8, 0x01, 0x00, 0x00, 0x00, 0x6A, 0x04, 0x59, 0x89, 0x4D, 0xCC, 0x89, 33 | 0x4D, 0xDC, 0x89, 0x4D, 0xE0, 0x89, 0x4D, 0xE4, 0x89, 0x4D, 0xE8, 0x8B, 0xCE, 0x85, 0xC0, 0x75, 34 | 0x19, 0x83, 0xFF, 0x01, 0x75, 0x0C, 0x80, 0x39, 0x00, 0x75, 0x07, 0x33, 0xC0, 0xE9, 0xF4, 0x00, 35 | 0x00, 0x00, 0x83, 0xC8, 0xFF, 0xE9, 0xEC, 0x00, 0x00, 0x00, 0x8B, 0x4D, 0x0C, 0x83, 0xC1, 0xF4, 36 | 0x89, 0x4D, 0xF0, 0x0F, 0xB6, 0x3E, 0x46, 0x89, 0x7D, 0xEC, 0xC1, 0xEF, 0x04, 0x83, 0xFF, 0x0F, 37 | 0x75, 0x18, 0xB8, 0xFF, 0x00, 0x00, 0x00, 0xEB, 0x0D, 0x3D, 0xFF, 0x00, 0x00, 0x00, 0x75, 0x0A, 38 | 0x0F, 0xB6, 0x06, 0x46, 0x03, 0xF8, 0x3B, 0xF2, 0x72, 0xEF, 0x8D, 0x0C, 0x1F, 0x8D, 0x14, 0x37, 39 | 0x3B, 0x4D, 0xF0, 0x0F, 0x87, 0xF7, 0x00, 0x00, 0x00, 0x8B, 0x45, 0x08, 0x83, 0xC0, 0xF8, 0x3B, 40 | 0xD0, 0x0F, 0x87, 0xE9, 0x00, 0x00, 0x00, 0x8B, 0x06, 0x89, 0x03, 0x8B, 0x46, 0x04, 0x83, 0xC6, 41 | 0x08, 0x89, 0x43, 0x04, 0x83, 0xC3, 0x08, 0x3B, 0xD9, 0x72, 0xEC, 0x8B, 0xC1, 0x8B, 0xD1, 0x2B, 42 | 0xC3, 0x03, 0xF0, 0x0F, 0xB7, 0x06, 0x83, 0xC6, 0x02, 0x2B, 0xD0, 0x89, 0x45, 0xF8, 0x3B, 0x55, 43 | 0xFC, 0x72, 0x6D, 0x8B, 0x5D, 0xEC, 0x83, 0xE3, 0x0F, 0x83, 0xFB, 0x0F, 0x75, 0x1A, 0x8B, 0x7D, 44 | 0x08, 0x83, 0xC7, 0xFA, 0x3B, 0xF7, 0x73, 0x0D, 0x0F, 0xB6, 0x06, 0x46, 0x03, 0xD8, 0x3D, 0xFF, 45 | 0x00, 0x00, 0x00, 0x74, 0xEF, 0x8B, 0x45, 0xF8, 0x83, 0xF8, 0x04, 0x73, 0x26, 0x8A, 0x02, 0x88, 46 | 0x01, 0x8A, 0x42, 0x01, 0x88, 0x41, 0x01, 0x8A, 0x42, 0x02, 0x88, 0x41, 0x02, 0x8A, 0x42, 0x03, 47 | 0x88, 0x41, 0x03, 0x8B, 0x45, 0xF8, 0x03, 0x54, 0x85, 0xCC, 0x83, 0xC1, 0x04, 0x8B, 0x02, 0x89, 48 | 0x01, 0xEB, 0x0A, 0x8B, 0x02, 0x83, 0xC2, 0x04, 0x89, 0x01, 0x83, 0xC1, 0x04, 0x8B, 0x45, 0x0C, 49 | 0x03, 0xD9, 0x8D, 0x78, 0xF8, 0x3B, 0xDF, 0x76, 0x3E, 0x83, 0xC0, 0xFB, 0x3B, 0xD8, 0x76, 0x1B, 50 | 0x8B, 0x45, 0xF4, 0x2B, 0xC6, 0x48, 0x5F, 0x5E, 0x5B, 0xC9, 0xC3, 0x8B, 0x02, 0x89, 0x01, 0x8B, 51 | 0x42, 0x04, 0x89, 0x41, 0x04, 0x83, 0xC1, 0x08, 0x83, 0xC2, 0x08, 0x3B, 0xCF, 0x72, 0xEC, 0x3B, 52 | 0xCB, 0x73, 0x0C, 0x2B, 0xD1, 0x8A, 0x04, 0x0A, 0x88, 0x01, 0x41, 0x3B, 0xCB, 0x72, 0xF6, 0x8B, 53 | 0x55, 0x08, 0xE9, 0xEC, 0xFE, 0xFF, 0xFF, 0x6A, 0x04, 0x5F, 0x8B, 0x02, 0x03, 0xD7, 0x89, 0x01, 54 | 0x03, 0xCF, 0x8B, 0x02, 0x03, 0xD7, 0x89, 0x01, 0x03, 0xCF, 0x3B, 0xCB, 0x72, 0xEC, 0xEB, 0xDF, 55 | 0x3B, 0x55, 0x08, 0x75, 0xAB, 0x3B, 0x4D, 0x0C, 0x77, 0xA6, 0x57, 0x8B, 0xD6, 0x8B, 0xCB, 0xE8, 56 | 0x0B, 0x00, 0x00, 0x00, 0x83, 0xC4, 0x04, 0x2B, 0x7D, 0xFC, 0x8D, 0x04, 0x3B, 0xEB, 0x97, 0x55, 57 | 0x8B, 0xEC, 0x85, 0xC9, 0x74, 0x23, 0x85, 0xD2, 0x74, 0x1F, 0x56, 0x8B, 0x75, 0x08, 0x85, 0xF6, 58 | 0x74, 0x12, 0x57, 0x8D, 0x3C, 0x31, 0x2B, 0xD1, 0x4F, 0x8A, 0x04, 0x3A, 0x88, 0x07, 0x83, 0xEE, 59 | 0x01, 0x75, 0xF5, 0x5F, 0x8B, 0xC1, 0x5E, 0x5D, 0xC3, 0x33, 0xC0, 0x5D, 0xC3, 0x8B, 0x41, 0x3C, 60 | 0x0F, 0xB7, 0x44, 0x08, 0x04, 0xB9, 0x64, 0x86, 0x00, 0x00, 0x66, 0x3B, 0xC1, 0x74, 0x0D, 0xB9, 61 | 0x00, 0x02, 0x00, 0x00, 0x66, 0x3B, 0xC1, 0x74, 0x03, 0x32, 0xC0, 0xC3, 0xB0, 0x01, 0xC3, 0x55, 62 | 0x8B, 0xEC, 0x83, 0xEC, 0x18, 0x53, 0x8B, 0xDA, 0x89, 0x4D, 0xFC, 0x56, 0x57, 0x8B, 0xCB, 0x8B, 63 | 0x7B, 0x3C, 0x03, 0xFB, 0xE8, 0xC4, 0xFF, 0xFF, 0xFF, 0x8D, 0x77, 0x78, 0x81, 0xC7, 0x88, 0x00, 64 | 0x00, 0x00, 0x3C, 0x01, 0x0F, 0x45, 0xFE, 0x33, 0xF6, 0x8B, 0x07, 0x03, 0xC3, 0x8B, 0x48, 0x1C, 65 | 0x8B, 0x50, 0x24, 0x03, 0xCB, 0x8B, 0x78, 0x18, 0x03, 0xD3, 0x89, 0x4D, 0xEC, 0x8B, 0x48, 0x20, 66 | 0x03, 0xCB, 0x89, 0x55, 0xF4, 0x89, 0x4D, 0xF8, 0x85, 0xFF, 0x74, 0x20, 0x8B, 0x55, 0xFC, 0x8B, 67 | 0x0C, 0xB1, 0x03, 0xCB, 0xE8, 0x78, 0xFD, 0xFF, 0xFF, 0x84, 0xC0, 0x75, 0x24, 0x8D, 0x47, 0xFF, 68 | 0x3B, 0xF0, 0x74, 0x17, 0x8B, 0x4D, 0xF8, 0x46, 0x3B, 0xF7, 0x72, 0xE3, 0x8B, 0x75, 0xE8, 0x8B, 69 | 0x4D, 0xEC, 0x8B, 0xC6, 0x8B, 0xD1, 0x5F, 0x5E, 0x5B, 0xC9, 0xC3, 0x33, 0xC0, 0x33, 0xD2, 0xEB, 70 | 0xF5, 0x8B, 0x45, 0xF4, 0x33, 0xC9, 0x0F, 0xB7, 0x04, 0x70, 0x8B, 0x75, 0xEC, 0x8B, 0x34, 0x86, 71 | 0x8B, 0xC3, 0x99, 0x03, 0xF0, 0x13, 0xCA, 0xEB, 0xD9, 0x55, 0x8B, 0xEC, 0x83, 0xEC, 0x4C, 0x8B, 72 | 0x55, 0xDC, 0x33, 0xC0, 0x53, 0x56, 0x89, 0x4D, 0xFC, 0xB9, 0x87, 0x32, 0xD8, 0xC0, 0x57, 0xC7, 73 | 0x45, 0xC4, 0x75, 0x73, 0x65, 0x72, 0xC7, 0x45, 0xC8, 0x33, 0x32, 0x2E, 0x64, 0x66, 0xC7, 0x45, 74 | 0xCC, 0x6C, 0x6C, 0x88, 0x45, 0xCE, 0xC7, 0x45, 0xB4, 0x6B, 0x65, 0x72, 0x6E, 0xC7, 0x45, 0xB8, 75 | 0x65, 0x6C, 0x33, 0x32, 0xC7, 0x45, 0xBC, 0x2E, 0x64, 0x6C, 0x6C, 0x88, 0x45, 0xC0, 0xC7, 0x45, 76 | 0xD0, 0x6E, 0x74, 0x64, 0x6C, 0xC7, 0x45, 0xD4, 0x6C, 0x2E, 0x64, 0x6C, 0x66, 0xC7, 0x45, 0xD8, 77 | 0x6C, 0x00, 0xE8, 0x08, 0xFF, 0xFF, 0xFF, 0x33, 0xF6, 0x8B, 0xD8, 0x56, 0x56, 0x8D, 0x45, 0xB4, 78 | 0x89, 0x5D, 0xE4, 0x50, 0xFF, 0xD3, 0x56, 0x8B, 0xF8, 0x8D, 0x45, 0xD0, 0x56, 0x50, 0xFF, 0xD3, 79 | 0x6A, 0x00, 0x8B, 0xF0, 0x8D, 0x45, 0xC4, 0x6A, 0x00, 0x50, 0xFF, 0xD3, 0x8B, 0xD7, 0xB9, 0x67, 80 | 0x59, 0xDE, 0x1E, 0xE8, 0xD7, 0xFE, 0xFF, 0xFF, 0x8B, 0xD7, 0xB9, 0x85, 0xDF, 0xAF, 0xBB, 0x8B, 81 | 0xD8, 0xE8, 0xC9, 0xFE, 0xFF, 0xFF, 0x8B, 0xD6, 0x89, 0x45, 0xEC, 0xB9, 0xD7, 0x6E, 0x8F, 0x81, 82 | 0xE8, 0xBA, 0xFE, 0xFF, 0xFF, 0x89, 0x45, 0xF0, 0x8B, 0x45, 0xFC, 0x6A, 0x40, 0x8B, 0x78, 0x3C, 83 | 0x03, 0xF8, 0x89, 0x7D, 0xF8, 0x0F, 0xB7, 0x47, 0x14, 0x03, 0xC7, 0x89, 0x45, 0xE8, 0x0F, 0xB7, 84 | 0x47, 0x06, 0x89, 0x45, 0xF4, 0xB8, 0x00, 0x30, 0x00, 0x00, 0x50, 0xFF, 0x77, 0x50, 0x89, 0x45, 85 | 0xE0, 0x6A, 0x00, 0xFF, 0xD3, 0x8B, 0xF0, 0x89, 0x75, 0xDC, 0x85, 0xF6, 0x0F, 0x84, 0x19, 0x01, 86 | 0x00, 0x00, 0xFF, 0x77, 0x54, 0xFF, 0x75, 0xFC, 0x56, 0xFF, 0x55, 0xF0, 0x83, 0xC4, 0x0C, 0x83, 87 | 0x7D, 0xF4, 0x00, 0x76, 0x29, 0x8B, 0x5D, 0xE8, 0x8B, 0x7D, 0xF4, 0x83, 0xC3, 0x2C, 0xFF, 0x73, 88 | 0xFC, 0x8B, 0x03, 0x03, 0x45, 0xFC, 0x50, 0x8B, 0x43, 0xF8, 0x03, 0xC6, 0x50, 0xFF, 0x55, 0xF0, 89 | 0x83, 0xC4, 0x0C, 0x8D, 0x5B, 0x28, 0x83, 0xEF, 0x01, 0x75, 0xE3, 0x8B, 0x7D, 0xF8, 0x8B, 0xBF, 90 | 0x80, 0x00, 0x00, 0x00, 0x03, 0xFE, 0x89, 0x7D, 0xF0, 0x8B, 0x5F, 0x10, 0x8B, 0x4F, 0x0C, 0x03, 91 | 0xDE, 0x03, 0xCE, 0x83, 0x3B, 0x00, 0x74, 0x3C, 0x6A, 0x00, 0x6A, 0x00, 0x51, 0xFF, 0x55, 0xE4, 92 | 0x89, 0x45, 0xE8, 0x85, 0xC0, 0x0F, 0x84, 0xB0, 0x00, 0x00, 0x00, 0x8B, 0x0B, 0x8B, 0xF8, 0x85, 93 | 0xC9, 0x78, 0x08, 0x8D, 0x46, 0x02, 0x03, 0xC1, 0x50, 0xEB, 0x07, 0x81, 0xE1, 0xFF, 0xFF, 0xFF, 94 | 0x7F, 0x51, 0x57, 0xFF, 0x55, 0xEC, 0x89, 0x03, 0x83, 0xC3, 0x04, 0x8B, 0x0B, 0x85, 0xC9, 0x75, 95 | 0xE0, 0x8B, 0x7D, 0xF0, 0x83, 0xC7, 0x14, 0x89, 0x7D, 0xF0, 0x83, 0x7F, 0x0C, 0x00, 0x75, 0xA9, 96 | 0x8B, 0x55, 0xF8, 0x8B, 0xC6, 0x33, 0xDB, 0x2B, 0x42, 0x34, 0x89, 0x45, 0xE4, 0x8B, 0x82, 0xA0, 97 | 0x00, 0x00, 0x00, 0x85, 0xC0, 0x74, 0x64, 0x8D, 0x0C, 0x30, 0x8B, 0x82, 0xA4, 0x00, 0x00, 0x00, 98 | 0x89, 0x45, 0xEC, 0x85, 0xC0, 0x7E, 0x4D, 0x8B, 0x55, 0xE4, 0x8B, 0x01, 0x85, 0xC0, 0x74, 0x41, 99 | 0x03, 0xC6, 0x89, 0x45, 0xE8, 0x8B, 0x41, 0x04, 0x6A, 0x00, 0x8D, 0x78, 0xF8, 0xD1, 0xEF, 0x89, 100 | 0x7D, 0xE4, 0x5F, 0x74, 0x23, 0x8B, 0x75, 0xE4, 0x0F, 0xB7, 0x44, 0x79, 0x08, 0x66, 0x3B, 0x45, 101 | 0xE0, 0x72, 0x0A, 0x25, 0xFF, 0x0F, 0x00, 0x00, 0x03, 0x45, 0xE8, 0x01, 0x10, 0x47, 0x3B, 0xFE, 102 | 0x7C, 0xE6, 0x8B, 0x41, 0x04, 0x8B, 0x75, 0xDC, 0x03, 0xD8, 0x03, 0xC8, 0x3B, 0x5D, 0xEC, 0x7C, 103 | 0xB9, 0x8B, 0x55, 0xF8, 0x8B, 0x42, 0x28, 0x03, 0xC6, 0xEB, 0x02, 0x33, 0xC0, 0x5F, 0x5E, 0x5B, 104 | 0xC9, 0xC3, 0x57, 0x33, 0xFF, 0x57, 0x57, 0x57, 0x57, 0xFF, 0x15, 0x34, 0x30, 0x1B, 0x00, 0xE8, 105 | 0x9C, 0xF9, 0xFF, 0xFF, 0x57, 0x57, 0x57, 0x57, 0xFF, 0x15, 0x34, 0x30, 0x1B, 0x00, 0x33, 0xC0, 106 | 0x5F, 0xC3, 0xCC, 0xCC, 0x8B, 0x04, 0x24, 0x25, 0x00, 0xF0, 0xFF, 0xFF, 0xC3, 0x64, 0xA1, 0x30, 107 | 0x00, 0x00, 0x00, 0x8B, 0x40, 0x08, 0xC3, 0x56, 0x64, 0x8B, 0x35, 0x30, 0x00, 0x00, 0x00, 0x8B, 108 | 0x76, 0x0C, 0x5E, 0xC3, 0x56, 0x64, 0x8B, 0x35, 0x30, 0x00, 0x00, 0x00, 0x8B, 0x76, 0x0C, 0x8B, 109 | 0x76, 0x1C, 0x8B, 0x36, 0x8B, 0x76, 0x08, 0x8B, 0xC6, 0x5E, 0xC3, 0x55, 0x8B, 0xEC, 0x83, 0xEC, 110 | 0x50, 0x8B, 0x4D, 0x10, 0x8B, 0x75, 0x0C, 0x8B, 0x7D, 0x08, 0xF3, 0xA4, 0x83, 0xC4, 0x50, 0x8B, 111 | 0xE5, 0x5D, 0xC3, 0x55, 0x8B, 0xEC, 0x83, 0xEC, 0x50, 0x8B, 0x7D, 0x08, 0x33, 0xC0, 0x8B, 0x4D, 112 | 0x0C, 0xFC, 0xF3, 0xAA, 0x83, 0xC4, 0x50, 0x8B, 0xE5, 0x5D, 0xC3, 0x56, 0x6A, 0x01, 0xE8, 0x7C, 113 | 0x0B, 0x00, 0x00, 0xE8, 0x34, 0x05, 0x00, 0x00, 0x50, 0xE8, 0xA7, 0x0B, 0x00, 0x00, 0xE8, 0x22, 114 | 0x05, 0x00, 0x00, 0x8B, 0xF0, 0xE8, 0xCB, 0x0B, 0x00, 0x00, 0x6A, 0x01, 0x89, 0x30, 0xE8, 0xD8, 115 | 0x02, 0x00, 0x00, 0x83, 0xC4, 0x0C, 0x5E, 0x84, 0xC0, 0x74, 0x73, 0xDB, 0xE2, 0xE8, 0x51, 0x07, 116 | 0x00, 0x00, 0x68, 0x8F, 0x1E, 0x1B, 0x00, 0xE8, 0x4C, 0x04, 0x00, 0x00, 0xE8, 0xF7, 0x04, 0x00, 117 | 0x00, 0x50, 0xE8, 0x44, 0x0B, 0x00, 0x00, 0x59, 0x59, 0x85, 0xC0, 0x75, 0x51, 0xE8, 0xF0, 0x04, 118 | 0x00, 0x00, 0xE8, 0x47, 0x05, 0x00, 0x00, 0x85, 0xC0, 0x74, 0x0B, 0x68, 0x15, 0x1C, 0x1B, 0x00, 119 | 0xE8, 0x20, 0x0B, 0x00, 0x00, 0x59, 0xE8, 0x07, 0x05, 0x00, 0x00, 0xE8, 0x02, 0x05, 0x00, 0x00, 120 | 0xE8, 0xDC, 0x04, 0x00, 0x00, 0xE8, 0xBB, 0x04, 0x00, 0x00, 0x50, 0xE8, 0x59, 0x0B, 0x00, 0x00, 121 | 0x59, 0xE8, 0xC8, 0x04, 0x00, 0x00, 0x84, 0xC0, 0x74, 0x05, 0xE8, 0x02, 0x0B, 0x00, 0x00, 0xE8, 122 | 0xA1, 0x04, 0x00, 0x00, 0xE8, 0x38, 0x06, 0x00, 0x00, 0x85, 0xC0, 0x75, 0x01, 0xC3, 0x6A, 0x07, 123 | 0xE8, 0x11, 0x05, 0x00, 0x00, 0xCC, 0xE8, 0xD6, 0x04, 0x00, 0x00, 0x33, 0xC0, 0xC3, 0xE8, 0x66, 124 | 0x06, 0x00, 0x00, 0xE8, 0x7D, 0x04, 0x00, 0x00, 0x50, 0xE8, 0x21, 0x0B, 0x00, 0x00, 0x59, 0xC3 125 | }; -------------------------------------------------------------------------------- /ShellCodeBuild/lz4.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | LZ4 - Fast LZ compression algorithm 4 | Copyright (C) 2011-2014, Yann Collet. 5 | BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are 9 | met: 10 | 11 | * Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following disclaimer 15 | in the documentation and/or other materials provided with the 16 | distribution. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | You can contact the author at : 31 | - LZ4 source repository : http://code.google.com/p/lz4/ 32 | - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c 33 | */ 34 | 35 | /************************************** 36 | Tuning parameters 37 | **************************************/ 38 | /* 39 | * MEMORY_USAGE : 40 | * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) 41 | * Increasing memory usage improves compression ratio 42 | * Reduced memory usage can improve speed, due to cache effect 43 | * Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache 44 | */ 45 | #define MEMORY_USAGE 14 46 | 47 | /* 48 | * HEAPMODE : 49 | * Select how default compression functions will allocate memory for their hash table, 50 | * in memory stack (0:default, fastest), or in memory heap (1:requires memory allocation (malloc)). 51 | */ 52 | #define HEAPMODE 0 53 | 54 | 55 | /************************************** 56 | CPU Feature Detection 57 | **************************************/ 58 | /* 32 or 64 bits ? */ 59 | #if (defined(__x86_64__) || defined(_M_X64) || defined(_WIN64) \ 60 | || defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) \ 61 | || defined(__64BIT__) || defined(_LP64) || defined(__LP64__) \ 62 | || defined(__ia64) || defined(__itanium__) || defined(_M_IA64) ) /* Detects 64 bits mode */ 63 | # define LZ4_ARCH64 1 64 | #else 65 | # define LZ4_ARCH64 0 66 | #endif 67 | 68 | /* 69 | * Little Endian or Big Endian ? 70 | * Overwrite the #define below if you know your architecture endianess 71 | */ 72 | #if defined (__GLIBC__) 73 | # include 74 | # if (__BYTE_ORDER == __BIG_ENDIAN) 75 | # define LZ4_BIG_ENDIAN 1 76 | # endif 77 | #elif (defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN) || defined(_BIG_ENDIAN)) && !(defined(__LITTLE_ENDIAN__) || defined(__LITTLE_ENDIAN) || defined(_LITTLE_ENDIAN)) 78 | # define LZ4_BIG_ENDIAN 1 79 | #elif defined(__sparc) || defined(__sparc__) \ 80 | || defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) \ 81 | || defined(__hpux) || defined(__hppa) \ 82 | || defined(_MIPSEB) || defined(__s390__) 83 | # define LZ4_BIG_ENDIAN 1 84 | #else 85 | /* Little Endian assumed. PDP Endian and other very rare endian format are unsupported. */ 86 | #endif 87 | 88 | /* 89 | * Unaligned memory access is automatically enabled for "common" CPU, such as x86. 90 | * For others CPU, such as ARM, the compiler may be more cautious, inserting unnecessary extra code to ensure aligned access property 91 | * If you know your target CPU supports unaligned memory access, you want to force this option manually to improve performance 92 | */ 93 | #if defined(__ARM_FEATURE_UNALIGNED) 94 | # define LZ4_FORCE_UNALIGNED_ACCESS 1 95 | #endif 96 | 97 | /* Define this parameter if your target system or compiler does not support hardware bit count */ 98 | #if defined(_MSC_VER) && defined(_WIN32_WCE) /* Visual Studio for Windows CE does not support Hardware bit count */ 99 | # define LZ4_FORCE_SW_BITCOUNT 100 | #endif 101 | 102 | /* 103 | * BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE : 104 | * This option may provide a small boost to performance for some big endian cpu, although probably modest. 105 | * You may set this option to 1 if data will remain within closed environment. 106 | * This option is useless on Little_Endian CPU (such as x86) 107 | */ 108 | 109 | /* #define BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE 1 */ 110 | 111 | 112 | /************************************** 113 | Compiler Options 114 | **************************************/ 115 | #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ 116 | /* "restrict" is a known keyword */ 117 | #else 118 | # define restrict /* Disable restrict */ 119 | #endif 120 | 121 | #ifdef _MSC_VER /* Visual Studio */ 122 | # define FORCE_INLINE static __forceinline 123 | # include /* For Visual 2005 */ 124 | # if LZ4_ARCH64 /* 64-bits */ 125 | # pragma intrinsic(_BitScanForward64) /* For Visual 2005 */ 126 | # pragma intrinsic(_BitScanReverse64) /* For Visual 2005 */ 127 | # else /* 32-bits */ 128 | # pragma intrinsic(_BitScanForward) /* For Visual 2005 */ 129 | # pragma intrinsic(_BitScanReverse) /* For Visual 2005 */ 130 | # endif 131 | # pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ 132 | #else 133 | # ifdef __GNUC__ 134 | # define FORCE_INLINE static inline __attribute__((always_inline)) 135 | # else 136 | # define FORCE_INLINE static inline 137 | # endif 138 | #endif 139 | 140 | #ifdef _MSC_VER /* Visual Studio */ 141 | # define lz4_bswap16(x) _byteswap_ushort(x) 142 | #else 143 | # define lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))) 144 | #endif 145 | 146 | #define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) 147 | 148 | #if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__) 149 | # define expect(expr,value) (__builtin_expect ((expr),(value)) ) 150 | #else 151 | # define expect(expr,value) (expr) 152 | #endif 153 | 154 | #define likely(expr) expect((expr) != 0, 1) 155 | #define unlikely(expr) expect((expr) != 0, 0) 156 | 157 | 158 | /************************************** 159 | Memory routines 160 | **************************************/ 161 | #include /* malloc, calloc, free */ 162 | #define ALLOCATOR(n,s) calloc(n,s) 163 | #define FREEMEM free 164 | #include /* memset, memcpy */ 165 | #define MEM_INIT memset 166 | 167 | 168 | /************************************** 169 | Includes 170 | **************************************/ 171 | #include "lz4.h" 172 | 173 | 174 | /************************************** 175 | Basic Types 176 | **************************************/ 177 | #if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ 178 | # include 179 | typedef uint8_t BYTE; 180 | typedef uint16_t U16; 181 | typedef uint32_t U32; 182 | typedef int32_t S32; 183 | typedef uint64_t U64; 184 | #else 185 | typedef unsigned char BYTE; 186 | typedef unsigned short U16; 187 | typedef unsigned int U32; 188 | typedef signed int S32; 189 | typedef unsigned long long U64; 190 | #endif 191 | 192 | #if defined(__GNUC__) && !defined(LZ4_FORCE_UNALIGNED_ACCESS) 193 | # define _PACKED __attribute__ ((packed)) 194 | #else 195 | # define _PACKED 196 | #endif 197 | 198 | #if !defined(LZ4_FORCE_UNALIGNED_ACCESS) && !defined(__GNUC__) 199 | # if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) 200 | # pragma pack(1) 201 | # else 202 | # pragma pack(push, 1) 203 | # endif 204 | #endif 205 | 206 | typedef struct { U16 v; } _PACKED U16_S; 207 | typedef struct { U32 v; } _PACKED U32_S; 208 | typedef struct { U64 v; } _PACKED U64_S; 209 | typedef struct {size_t v;} _PACKED size_t_S; 210 | 211 | #if !defined(LZ4_FORCE_UNALIGNED_ACCESS) && !defined(__GNUC__) 212 | # if defined(__SUNPRO_C) || defined(__SUNPRO_CC) 213 | # pragma pack(0) 214 | # else 215 | # pragma pack(pop) 216 | # endif 217 | #endif 218 | 219 | #define A16(x) (((U16_S *)(x))->v) 220 | #define A32(x) (((U32_S *)(x))->v) 221 | #define A64(x) (((U64_S *)(x))->v) 222 | #define AARCH(x) (((size_t_S *)(x))->v) 223 | 224 | 225 | /************************************** 226 | Constants 227 | **************************************/ 228 | #define LZ4_HASHLOG (MEMORY_USAGE-2) 229 | #define HASHTABLESIZE (1 << MEMORY_USAGE) 230 | #define HASHNBCELLS4 (1 << LZ4_HASHLOG) 231 | 232 | #define MINMATCH 4 233 | 234 | #define COPYLENGTH 8 235 | #define LASTLITERALS 5 236 | #define MFLIMIT (COPYLENGTH+MINMATCH) 237 | static const int LZ4_minLength = (MFLIMIT+1); 238 | 239 | #define KB *(1U<<10) 240 | #define MB *(1U<<20) 241 | #define GB *(1U<<30) 242 | 243 | #define LZ4_64KLIMIT ((64 KB) + (MFLIMIT-1)) 244 | #define SKIPSTRENGTH 6 /* Increasing this value will make the compression run slower on incompressible data */ 245 | 246 | #define MAXD_LOG 16 247 | #define MAX_DISTANCE ((1 << MAXD_LOG) - 1) 248 | 249 | #define ML_BITS 4 250 | #define ML_MASK ((1U<=e; */ 295 | #else 296 | # define LZ4_WILDCOPY(d,s,e) { if (likely(e-d <= 8)) LZ4_COPY8(d,s) else do { LZ4_COPY8(d,s) } while (d>3); 313 | # elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT) 314 | return (__builtin_clzll(val) >> 3); 315 | # else 316 | int r; 317 | if (!(val>>32)) { r=4; } else { r=0; val>>=32; } 318 | if (!(val>>16)) { r+=2; val>>=8; } else { val>>=24; } 319 | r += (!val); 320 | return r; 321 | # endif 322 | # else 323 | # if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) 324 | unsigned long r = 0; 325 | _BitScanForward64( &r, val ); 326 | return (int)(r>>3); 327 | # elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT) 328 | return (__builtin_ctzll(val) >> 3); 329 | # else 330 | static const int DeBruijnBytePos[64] = { 0, 0, 0, 0, 0, 1, 1, 2, 0, 3, 1, 3, 1, 4, 2, 7, 0, 2, 3, 6, 1, 5, 3, 5, 1, 3, 4, 4, 2, 5, 6, 7, 7, 0, 1, 2, 3, 3, 4, 6, 2, 6, 5, 5, 3, 4, 5, 6, 7, 1, 2, 4, 6, 4, 4, 5, 7, 2, 6, 5, 7, 6, 7, 7 }; 331 | return DeBruijnBytePos[((U64)((val & -(long long)val) * 0x0218A392CDABBD3FULL)) >> 58]; 332 | # endif 333 | # endif 334 | } 335 | 336 | #else 337 | 338 | FORCE_INLINE int LZ4_NbCommonBytes (register U32 val) 339 | { 340 | # if defined(LZ4_BIG_ENDIAN) 341 | # if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) 342 | unsigned long r = 0; 343 | _BitScanReverse( &r, val ); 344 | return (int)(r>>3); 345 | # elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT) 346 | return (__builtin_clz(val) >> 3); 347 | # else 348 | int r; 349 | if (!(val>>16)) { r=2; val>>=8; } else { r=0; val>>=24; } 350 | r += (!val); 351 | return r; 352 | # endif 353 | # else 354 | # if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) 355 | unsigned long r; 356 | _BitScanForward( &r, val ); 357 | return (int)(r>>3); 358 | # elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT) 359 | return (__builtin_ctz(val) >> 3); 360 | # else 361 | static const int DeBruijnBytePos[32] = { 0, 0, 3, 0, 3, 1, 3, 0, 3, 2, 2, 1, 3, 2, 0, 1, 3, 3, 1, 2, 2, 2, 2, 0, 3, 1, 2, 0, 1, 0, 1, 1 }; 362 | return DeBruijnBytePos[((U32)((val & -(S32)val) * 0x077CB531U)) >> 27]; 363 | # endif 364 | # endif 365 | } 366 | 367 | #endif 368 | 369 | 370 | /**************************** 371 | Compression functions 372 | ****************************/ 373 | int LZ4API LZ4_compressBound(int isize) { return LZ4_COMPRESSBOUND(isize); } 374 | 375 | FORCE_INLINE int LZ4_hashSequence(U32 sequence, tableType_t tableType) 376 | { 377 | if (tableType == byU16) 378 | return (((sequence) * 2654435761U) >> ((MINMATCH*8)-(LZ4_HASHLOG+1))); 379 | else 380 | return (((sequence) * 2654435761U) >> ((MINMATCH*8)-LZ4_HASHLOG)); 381 | } 382 | 383 | FORCE_INLINE int LZ4_hashPosition(const BYTE* p, tableType_t tableType) { return LZ4_hashSequence(A32(p), tableType); } 384 | 385 | FORCE_INLINE void LZ4_putPositionOnHash(const BYTE* p, U32 h, void* tableBase, tableType_t tableType, const BYTE* srcBase) 386 | { 387 | switch (tableType) 388 | { 389 | case byPtr: { const BYTE** hashTable = (const BYTE**) tableBase; hashTable[h] = p; break; } 390 | case byU32: { U32* hashTable = (U32*) tableBase; hashTable[h] = (U32)(p-srcBase); break; } 391 | case byU16: { U16* hashTable = (U16*) tableBase; hashTable[h] = (U16)(p-srcBase); break; } 392 | } 393 | } 394 | 395 | FORCE_INLINE void LZ4_putPosition(const BYTE* p, void* tableBase, tableType_t tableType, const BYTE* srcBase) 396 | { 397 | U32 h = LZ4_hashPosition(p, tableType); 398 | LZ4_putPositionOnHash(p, h, tableBase, tableType, srcBase); 399 | } 400 | 401 | FORCE_INLINE const BYTE* LZ4_getPositionOnHash(U32 h, void* tableBase, tableType_t tableType, const BYTE* srcBase) 402 | { 403 | if (tableType == byPtr) { const BYTE** hashTable = (const BYTE**) tableBase; return hashTable[h]; } 404 | if (tableType == byU32) { U32* hashTable = (U32*) tableBase; return hashTable[h] + srcBase; } 405 | { U16* hashTable = (U16*) tableBase; return hashTable[h] + srcBase; } /* default, to ensure a return */ 406 | } 407 | 408 | FORCE_INLINE const BYTE* LZ4_getPosition(const BYTE* p, void* tableBase, tableType_t tableType, const BYTE* srcBase) 409 | { 410 | U32 h = LZ4_hashPosition(p, tableType); 411 | return LZ4_getPositionOnHash(h, tableBase, tableType, srcBase); 412 | } 413 | 414 | 415 | FORCE_INLINE int LZ4_compress_generic( 416 | void* ctx, 417 | const char* source, 418 | char* dest, 419 | int inputSize, 420 | int maxOutputSize, 421 | 422 | limitedOutput_directive limitedOutput, 423 | tableType_t tableType, 424 | prefix64k_directive prefix) 425 | { 426 | const BYTE* ip = (const BYTE*) source; 427 | const BYTE* const base = (prefix==withPrefix) ? ((LZ4_Data_Structure*)ctx)->base : (const BYTE*) source; 428 | const BYTE* const lowLimit = ((prefix==withPrefix) ? ((LZ4_Data_Structure*)ctx)->bufferStart : (const BYTE*)source); 429 | const BYTE* anchor = (const BYTE*) source; 430 | const BYTE* const iend = ip + inputSize; 431 | const BYTE* const mflimit = iend - MFLIMIT; 432 | const BYTE* const matchlimit = iend - LASTLITERALS; 433 | 434 | BYTE* op = (BYTE*) dest; 435 | BYTE* const oend = op + maxOutputSize; 436 | 437 | int length; 438 | const int skipStrength = SKIPSTRENGTH; 439 | U32 forwardH; 440 | 441 | /* Init conditions */ 442 | if ((U32)inputSize > (U32)LZ4_MAX_INPUT_SIZE) return 0; /* Unsupported input size, too large (or negative) */ 443 | if ((prefix==withPrefix) && (ip != ((LZ4_Data_Structure*)ctx)->nextBlock)) return 0; /* must continue from end of previous block */ 444 | if (prefix==withPrefix) ((LZ4_Data_Structure*)ctx)->nextBlock=iend; /* do it now, due to potential early exit */ 445 | if ((tableType == byU16) && (inputSize>=(int)LZ4_64KLIMIT)) return 0; /* Size too large (not within 64K limit) */ 446 | if (inputSize> skipStrength; 464 | ip = forwardIp; 465 | forwardIp = ip + step; 466 | 467 | if (unlikely(forwardIp > mflimit)) { goto _last_literals; } 468 | 469 | forwardH = LZ4_hashPosition(forwardIp, tableType); 470 | ref = LZ4_getPositionOnHash(h, ctx, tableType, base); 471 | LZ4_putPositionOnHash(ip, h, ctx, tableType, base); 472 | 473 | } while ((ref + MAX_DISTANCE < ip) || (A32(ref) != A32(ip))); 474 | 475 | /* Catch up */ 476 | while ((ip>anchor) && (ref > lowLimit) && (unlikely(ip[-1]==ref[-1]))) { ip--; ref--; } 477 | 478 | /* Encode Literal length */ 479 | length = (int)(ip - anchor); 480 | token = op++; 481 | if ((limitedOutput) && (unlikely(op + length + (2 + 1 + LASTLITERALS) + (length/255) > oend))) return 0; /* Check output limit */ 482 | if (length>=(int)RUN_MASK) 483 | { 484 | int len = length-RUN_MASK; 485 | *token=(RUN_MASK<= 255 ; len-=255) *op++ = 255; 487 | *op++ = (BYTE)len; 488 | } 489 | else *token = (BYTE)(length<>8) > oend))) return 0; /* Check output limit */ 516 | if (length>=(int)ML_MASK) 517 | { 518 | *token += ML_MASK; 519 | length -= ML_MASK; 520 | for (; length > 509 ; length-=510) { *op++ = 255; *op++ = 255; } 521 | if (length >= 255) { length-=255; *op++ = 255; } 522 | *op++ = (BYTE)length; 523 | } 524 | else *token += (BYTE)(length); 525 | 526 | /* Test end of chunk */ 527 | if (ip > mflimit) { anchor = ip; break; } 528 | 529 | /* Fill table */ 530 | LZ4_putPosition(ip-2, ctx, tableType, base); 531 | 532 | /* Test next position */ 533 | ref = LZ4_getPosition(ip, ctx, tableType, base); 534 | LZ4_putPosition(ip, ctx, tableType, base); 535 | if ((ref + MAX_DISTANCE >= ip) && (A32(ref) == A32(ip))) { token = op++; *token=0; goto _next_match; } 536 | 537 | /* Prepare next loop */ 538 | anchor = ip++; 539 | forwardH = LZ4_hashPosition(ip, tableType); 540 | } 541 | 542 | _last_literals: 543 | /* Encode Last Literals */ 544 | { 545 | int lastRun = (int)(iend - anchor); 546 | if ((limitedOutput) && (((char*)op - dest) + lastRun + 1 + ((lastRun+255-RUN_MASK)/255) > (U32)maxOutputSize)) return 0; /* Check output limit */ 547 | if (lastRun>=(int)RUN_MASK) { *op++=(RUN_MASK<= 255 ; lastRun-=255) *op++ = 255; *op++ = (BYTE) lastRun; } 548 | else *op++ = (BYTE)(lastRun<hashTable, 0, sizeof(lz4ds->hashTable)); 642 | lz4ds->bufferStart = base; 643 | lz4ds->base = base; 644 | lz4ds->nextBlock = base; 645 | } 646 | 647 | int LZ4API LZ4_resetStreamState(void* state, const char* inputBuffer) 648 | { 649 | if ((((size_t)state) & 3) != 0) return 1; /* Error : pointer is not aligned on 4-bytes boundary */ 650 | LZ4_init((LZ4_Data_Structure*)state, (const BYTE*)inputBuffer); 651 | return 0; 652 | } 653 | 654 | void* LZ4API LZ4_create (const char* inputBuffer) 655 | { 656 | void* lz4ds = ALLOCATOR(1, sizeof(LZ4_Data_Structure)); 657 | LZ4_init ((LZ4_Data_Structure*)lz4ds, (const BYTE*)inputBuffer); 658 | return lz4ds; 659 | } 660 | 661 | 662 | int LZ4API LZ4_free (void* LZ4_Data) 663 | { 664 | FREEMEM(LZ4_Data); 665 | return (0); 666 | } 667 | 668 | 669 | char* LZ4API LZ4_slideInputBuffer (void* LZ4_Data) 670 | { 671 | LZ4_Data_Structure* lz4ds = (LZ4_Data_Structure*)LZ4_Data; 672 | size_t delta = lz4ds->nextBlock - (lz4ds->bufferStart + 64 KB); 673 | 674 | if ( (lz4ds->base - delta > lz4ds->base) /* underflow control */ 675 | || ((size_t)(lz4ds->nextBlock - lz4ds->base) > 0xE0000000) ) /* close to 32-bits limit */ 676 | { 677 | size_t deltaLimit = (lz4ds->nextBlock - 64 KB) - lz4ds->base; 678 | int nH; 679 | 680 | for (nH=0; nH < HASHNBCELLS4; nH++) 681 | { 682 | if ((size_t)(lz4ds->hashTable[nH]) < deltaLimit) lz4ds->hashTable[nH] = 0; 683 | else lz4ds->hashTable[nH] -= (U32)deltaLimit; 684 | } 685 | memcpy((void*)(lz4ds->bufferStart), (const void*)(lz4ds->nextBlock - 64 KB), 64 KB); 686 | lz4ds->base = lz4ds->bufferStart; 687 | lz4ds->nextBlock = lz4ds->base + 64 KB; 688 | } 689 | else 690 | { 691 | memcpy((void*)(lz4ds->bufferStart), (const void*)(lz4ds->nextBlock - 64 KB), 64 KB); 692 | lz4ds->nextBlock -= delta; 693 | lz4ds->base -= delta; 694 | } 695 | 696 | return (char*)(lz4ds->nextBlock); 697 | } 698 | 699 | 700 | int LZ4API LZ4_compress_continue (void* LZ4_Data, const char* source, char* dest, int inputSize) 701 | { 702 | return LZ4_compress_generic(LZ4_Data, source, dest, inputSize, 0, notLimited, byU32, withPrefix); 703 | } 704 | 705 | 706 | int LZ4API LZ4_compress_limitedOutput_continue (void* LZ4_Data, const char* source, char* dest, int inputSize, int maxOutputSize) 707 | { 708 | return LZ4_compress_generic(LZ4_Data, source, dest, inputSize, maxOutputSize, limited, byU32, withPrefix); 709 | } 710 | 711 | 712 | /**************************** 713 | Decompression functions 714 | ****************************/ 715 | /* 716 | * This generic decompression function cover all use cases. 717 | * It shall be instanciated several times, using different sets of directives 718 | * Note that it is essential this generic function is really inlined, 719 | * in order to remove useless branches during compilation optimisation. 720 | */ 721 | FORCE_INLINE int LZ4_decompress_generic( 722 | const char* source, 723 | char* dest, 724 | int inputSize, 725 | int outputSize, /* If endOnInput==endOnInputSize, this value is the max size of Output Buffer. */ 726 | 727 | int endOnInput, /* endOnOutputSize, endOnInputSize */ 728 | int prefix64k, /* noPrefix, withPrefix */ 729 | int partialDecoding, /* full, partial */ 730 | int targetOutputSize /* only used if partialDecoding==partial */ 731 | ) 732 | { 733 | /* Local Variables */ 734 | const BYTE* restrict ip = (const BYTE*) source; 735 | const BYTE* ref; 736 | const BYTE* const iend = ip + inputSize; 737 | 738 | BYTE* op = (BYTE*) dest; 739 | BYTE* const oend = op + outputSize; 740 | BYTE* cpy; 741 | BYTE* oexit = op + targetOutputSize; 742 | 743 | /*const size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0}; / static reduces speed for LZ4_decompress_safe() on GCC64 */ 744 | const size_t dec32table[] = {4-0, 4-3, 4-2, 4-3, 4-0, 4-0, 4-0, 4-0}; /* static reduces speed for LZ4_decompress_safe() on GCC64 */ 745 | static const size_t dec64table[] = {0, 0, 0, (size_t)-1, 0, 1, 2, 3}; 746 | 747 | 748 | /* Special cases */ 749 | if ((partialDecoding) && (oexit> oend-MFLIMIT)) oexit = oend-MFLIMIT; /* targetOutputSize too high => decode everything */ 750 | if ((endOnInput) && (unlikely(outputSize==0))) return ((inputSize==1) && (*ip==0)) ? 0 : -1; /* Empty output buffer */ 751 | if ((!endOnInput) && (unlikely(outputSize==0))) return (*ip==0?1:-1); 752 | 753 | 754 | /* Main Loop */ 755 | while (1) 756 | { 757 | unsigned token; 758 | size_t length; 759 | 760 | /* get runlength */ 761 | token = *ip++; 762 | if ((length=(token>>ML_BITS)) == RUN_MASK) 763 | { 764 | unsigned s=255; 765 | while (((endOnInput)?ip(partialDecoding?oexit:oend-MFLIMIT)) || (ip+length>iend-(2+1+LASTLITERALS))) ) 775 | || ((!endOnInput) && (cpy>oend-COPYLENGTH))) 776 | { 777 | if (partialDecoding) 778 | { 779 | if (cpy > oend) goto _output_error; /* Error : write attempt beyond end of output buffer */ 780 | if ((endOnInput) && (ip+length > iend)) goto _output_error; /* Error : read attempt beyond end of input buffer */ 781 | } 782 | else 783 | { 784 | if ((!endOnInput) && (cpy != oend)) goto _output_error; /* Error : block decoding must stop exactly there */ 785 | if ((endOnInput) && ((ip+length != iend) || (cpy > oend))) goto _output_error; /* Error : input must be consumed */ 786 | } 787 | memcpy(op, ip, length); 788 | ip += length; 789 | op += length; 790 | break; /* Necessarily EOF, due to parsing restrictions */ 791 | } 792 | LZ4_WILDCOPY(op, ip, cpy); ip -= (op-cpy); op = cpy; 793 | 794 | /* get offset */ 795 | LZ4_READ_LITTLEENDIAN_16(ref,cpy,ip); ip+=2; 796 | if ((prefix64k==noPrefix) && (unlikely(ref < (BYTE* const)dest))) goto _output_error; /* Error : offset outside destination buffer */ 797 | 798 | /* get matchlength */ 799 | if ((length=(token&ML_MASK)) == ML_MASK) 800 | { 801 | while ((!endOnInput) || (ipoend-COPYLENGTH-(STEPSIZE-4))) 828 | { 829 | if (cpy > oend-LASTLITERALS) goto _output_error; /* Error : last 5 bytes must be literals */ 830 | LZ4_SECURECOPY(op, ref, (oend-COPYLENGTH)); 831 | while(op (unsigned int)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16) 94 | 95 | /* 96 | LZ4_compressBound() : 97 | Provides the maximum size that LZ4 may output in a "worst case" scenario (input data not compressible) 98 | primarily useful for memory allocation of output buffer. 99 | inline function is recommended for the general case, 100 | macro is also provided when result needs to be evaluated at compilation (such as stack memory allocation). 101 | 102 | isize : is the input size. Max supported value is LZ4_MAX_INPUT_SIZE 103 | return : maximum output size in a "worst case" scenario 104 | or 0, if input size is too large ( > LZ4_MAX_INPUT_SIZE) 105 | */ 106 | int LZ4API LZ4_compressBound(int isize); 107 | 108 | 109 | /* 110 | LZ4_compress_limitedOutput() : 111 | Compress 'inputSize' bytes from 'source' into an output buffer 'dest' of maximum size 'maxOutputSize'. 112 | If it cannot achieve it, compression will stop, and result of the function will be zero. 113 | This function never writes outside of provided output buffer. 114 | 115 | inputSize : Max supported value is LZ4_MAX_INPUT_VALUE 116 | maxOutputSize : is the size of the destination buffer (which must be already allocated) 117 | return : the number of bytes written in buffer 'dest' 118 | or 0 if the compression fails 119 | */ 120 | int LZ4API LZ4_compress_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize); 121 | 122 | 123 | /* 124 | LZ4_decompress_fast() : 125 | originalSize : is the original and therefore uncompressed size 126 | return : the number of bytes read from the source buffer (in other words, the compressed size) 127 | If the source stream is malformed, the function will stop decoding and return a negative result. 128 | note : This function is a bit faster than LZ4_decompress_safe() 129 | This function never writes outside of output buffers, but may read beyond input buffer in case of malicious data packet. 130 | Use this function preferably into a trusted environment (data to decode comes from a trusted source). 131 | Destination buffer must be already allocated. Its size must be a minimum of 'outputSize' bytes. 132 | */ 133 | int LZ4API LZ4_decompress_fast (const char* source, char* dest, int originalSize); 134 | 135 | 136 | /* 137 | LZ4_decompress_safe_partial() : 138 | This function decompress a compressed block of size 'inputSize' at position 'source' 139 | into output buffer 'dest' of size 'maxOutputSize'. 140 | The function tries to stop decompressing operation as soon as 'targetOutputSize' has been reached, 141 | reducing decompression time. 142 | return : the number of bytes decoded in the destination buffer (necessarily <= maxOutputSize) 143 | Note : this number can be < 'targetOutputSize' should the compressed block to decode be smaller. 144 | Always control how many bytes were decoded. 145 | If the source stream is detected malformed, the function will stop decoding and return a negative result. 146 | This function never writes outside of output buffer, and never reads outside of input buffer. It is therefore protected against malicious data packets 147 | */ 148 | int LZ4API LZ4_decompress_safe_partial (const char* source, char* dest, int inputSize, int targetOutputSize, int maxOutputSize); 149 | 150 | 151 | /* 152 | These functions are provided should you prefer to allocate memory for compression tables with your own allocation methods. 153 | To know how much memory must be allocated for the compression tables, use : 154 | int LZ4_sizeofState(); 155 | 156 | Note that tables must be aligned on 4-bytes boundaries, otherwise compression will fail (return code 0). 157 | 158 | The allocated memory can be provided to the compressions functions using 'void* state' parameter. 159 | LZ4_compress_withState() and LZ4_compress_limitedOutput_withState() are equivalent to previously described functions. 160 | They just use the externally allocated memory area instead of allocating their own (on stack, or on heap). 161 | */ 162 | int LZ4API LZ4_sizeofState(void); 163 | int LZ4API LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize); 164 | int LZ4API LZ4_compress_limitedOutput_withState (void* state, const char* source, char* dest, int inputSize, int maxOutputSize); 165 | 166 | 167 | /************************************** 168 | Streaming Functions 169 | **************************************/ 170 | void* LZ4API LZ4_create (const char* inputBuffer); 171 | int LZ4API LZ4_compress_continue (void* LZ4_Data, const char* source, char* dest, int inputSize); 172 | int LZ4API LZ4_compress_limitedOutput_continue (void* LZ4_Data, const char* source, char* dest, int inputSize, int maxOutputSize); 173 | char* LZ4API LZ4_slideInputBuffer (void* LZ4_Data); 174 | int LZ4API LZ4_free (void* LZ4_Data); 175 | 176 | /* 177 | These functions allow the compression of dependent blocks, where each block benefits from prior 64 KB within preceding blocks. 178 | In order to achieve this, it is necessary to start creating the LZ4 Data Structure, thanks to the function : 179 | 180 | void* LZ4_create (const char* inputBuffer); 181 | The result of the function is the (void*) pointer on the LZ4 Data Structure. 182 | This pointer will be needed in all other functions. 183 | If the pointer returned is NULL, then the allocation has failed, and compression must be aborted. 184 | The only parameter 'const char* inputBuffer' must, obviously, point at the beginning of input buffer. 185 | The input buffer must be already allocated, and size at least 192KB. 186 | 'inputBuffer' will also be the 'const char* source' of the first block. 187 | 188 | All blocks are expected to lay next to each other within the input buffer, starting from 'inputBuffer'. 189 | To compress each block, use either LZ4_compress_continue() or LZ4_compress_limitedOutput_continue(). 190 | Their behavior are identical to LZ4_compress() or LZ4_compress_limitedOutput(), 191 | but require the LZ4 Data Structure as their first argument, and check that each block starts right after the previous one. 192 | If next block does not begin immediately after the previous one, the compression will fail (return 0). 193 | 194 | When it's no longer possible to lay the next block after the previous one (not enough space left into input buffer), a call to : 195 | char* LZ4_slideInputBuffer(void* LZ4_Data); 196 | must be performed. It will typically copy the latest 64KB of input at the beginning of input buffer. 197 | Note that, for this function to work properly, minimum size of an input buffer must be 192KB. 198 | ==> The memory position where the next input data block must start is provided as the result of the function. 199 | 200 | Compression can then resume, using LZ4_compress_continue() or LZ4_compress_limitedOutput_continue(), as usual. 201 | 202 | When compression is completed, a call to LZ4_free() will release the memory used by the LZ4 Data Structure. 203 | */ 204 | 205 | 206 | int LZ4API LZ4_sizeofStreamState(void); 207 | int LZ4API LZ4_resetStreamState(void* state, const char* inputBuffer); 208 | 209 | /* 210 | These functions achieve the same result as : 211 | void* LZ4_create (const char* inputBuffer); 212 | 213 | They are provided here to allow the user program to allocate memory using its own routines. 214 | 215 | To know how much space must be allocated, use LZ4_sizeofStreamState(); 216 | Note also that space must be 4-bytes aligned. 217 | 218 | Once space is allocated, you must initialize it using : LZ4_resetStreamState(void* state, const char* inputBuffer); 219 | void* state is a pointer to the space allocated. 220 | It must be aligned on 4-bytes boundaries, and be large enough. 221 | The parameter 'const char* inputBuffer' must, obviously, point at the beginning of input buffer. 222 | The input buffer must be already allocated, and size at least 192KB. 223 | 'inputBuffer' will also be the 'const char* source' of the first block. 224 | 225 | The same space can be re-used multiple times, just by initializing it each time with LZ4_resetStreamState(). 226 | return value of LZ4_resetStreamState() must be 0 is OK. 227 | Any other value means there was an error (typically, pointer is not aligned on 4-bytes boundaries). 228 | */ 229 | 230 | 231 | int LZ4API LZ4_decompress_safe_withPrefix64k (const char* source, char* dest, int inputSize, int maxOutputSize); 232 | int LZ4API LZ4_decompress_fast_withPrefix64k (const char* source, char* dest, int outputSize); 233 | 234 | /* 235 | *_withPrefix64k() : 236 | These decoding functions work the same as their "normal name" versions, 237 | but can use up to 64KB of data in front of 'char* dest'. 238 | These functions are necessary to decode inter-dependant blocks. 239 | */ 240 | 241 | 242 | /************************************** 243 | Obsolete Functions 244 | **************************************/ 245 | /* 246 | These functions are deprecated and should no longer be used. 247 | They are provided here for compatibility with existing user programs. 248 | */ 249 | int LZ4API LZ4_uncompress (const char* source, char* dest, int outputSize); 250 | int LZ4API LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize); 251 | 252 | 253 | #if defined (__cplusplus) 254 | } 255 | #endif 256 | -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/C_ToShell.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/C_ToShell.obj -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/PE_TOOL.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/PE_TOOL.obj -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/ShellCodeBuild.exe.recipe: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | E:\DIY\ShellCode\x64\Debug\ShellCodeBuild.exe 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/ShellCodeBuild.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/ShellCodeBuild.ilk -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/ShellCodeBuild.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/ShellCodeBuild.obj -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/ShellCodeBuild.lastbuildstate: -------------------------------------------------------------------------------- 1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionMFC=14.29.30136:VCServicingVersionATL=14.29.30136:VCServicingVersionCrtHeaders=14.29.30136:VCServicingVersionCompilers=14.29.30136:TargetPlatformVersion=10.0.19041.0: 2 | Debug|x64|E:\DIY\ShellCode\| 3 | -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/ShellCodeBuild.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/ShellCodeBuild.vcxproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/ShellCodeBuild.vcxproj.FileListAbsolute.txt -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/lz4.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/lz4.obj -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/vc142.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/vc142.idb -------------------------------------------------------------------------------- /ShellCodeBuild/x64/Debug/vc142.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irohaneABC/ShellCodeBuildandloadexe/836a8a4afed64e3306cc6a92a69ec6147e5b5e3f/ShellCodeBuild/x64/Debug/vc142.pdb --------------------------------------------------------------------------------