void autoupdater::start( bool gameClient )

/*
*
*
*/
#include "autoupdater.hpp"
#include "offsets.hpp"
#include "game_classes.hpp"

#include <Windows.h>
#include <vector>
#include <cinttypes>
#include <string>
#include <thread>
#include <chrono>

uint8_t* find_signature( const wchar_t* szModule, const char* szSignature )
{
	try {

		auto module = GetModuleHandle( szModule );
		static auto pattern_to_byte = [ ]( const char* pattern )
		{
			auto bytes = std::vector<int>{};
			auto start = const_cast< char* >( pattern );
			auto end = const_cast< char* >( pattern ) + strlen( pattern );

			for ( auto current = start; current < end; ++current )
			{
				if ( *current == '?' )
				{
					++current;
					if ( *current == '?' )
						++current;
					bytes.push_back( -1 );
				} else
				{
					bytes.push_back( strtoul( current, &current, 16 ) );
				}
			}
			return bytes;
		};

		auto dosHeader = ( PIMAGE_DOS_HEADER ) module;
		auto ntHeaders = ( PIMAGE_NT_HEADERS ) ( ( uint8_t* ) module + dosHeader->e_lfanew );
		auto textSection = IMAGE_FIRST_SECTION( ntHeaders );

		auto sizeOfImage = textSection->SizeOfRawData;
		auto patternBytes = pattern_to_byte( szSignature );
		auto scanBytes = reinterpret_cast< uint8_t* >( module ) + textSection->VirtualAddress;

		auto s = patternBytes.size( );
		auto d = patternBytes.data( );

		auto mbi = MEMORY_BASIC_INFORMATION{ 0 };
		uint8_t* next_check_address = 0;

		for ( auto i = 0ul; i < sizeOfImage - s; ++i )
		{
			bool found = true;
			for ( auto j = 0ul; j < s; ++j )
			{
				auto current_address = scanBytes + i + j;
				if ( current_address >= next_check_address )
				{
					if ( !VirtualQuery( reinterpret_cast< void* >( current_address ), &mbi, sizeof( mbi ) ) )
						break;

					if ( mbi.Protect == PAGE_NOACCESS )
					{
						i += ( ( std::uintptr_t( mbi.BaseAddress ) + mbi.RegionSize ) - ( std::uintptr_t( scanBytes ) + i ) );
						i--;
						found = false;
						break;
					} else
					{
						next_check_address = reinterpret_cast< uint8_t* >( mbi.BaseAddress ) + mbi.RegionSize;
					}
				}

				if ( scanBytes[ i + j ] != d[ j ] && d[ j ] != -1 )
				{
					found = false;
					break;
				}
			}
			if ( found )
			{
				return &scanBytes[ i ];
			}
		}
		return nullptr;

	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("find_signature error: %s", e.what());
#endif
	}
}

class offset_signature
{
public:
	std::vector<std::string> sigs;
	bool sub_base;
	bool read;
	int32_t additional;
	uint32_t* offset;
};

// Single GameClient Signature to game not crashe.
std::vector<offset_signature> gameClientSig = {
	{
		{
			"A1 ? ? ? ? 68 ? ? ? ? 8B 70 08",
			"A1 ? ? ? ? 83 C4 04 C6 40 36 15",
			"8B 35 ? ? ? ? 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C7 44 24 ? ? ? ? ? 89 44 24 18",
			"8B 0D ? ? ? ? FF B0 ? ? ? ? E8 ? ? ? ? A1"
		},
		true,
		true,
		0,
		&offsets::global::GameClient
	}
};

std::vector<offset_signature> sigs = {
	{
		{
			"8B 0D ? ? ? ? 8B F8 81 C1 ? ? ? ? 57",
			"A1 ? ? ? ? 85 C0 74 18 84 C9",
			"8B 0D ? ? ? ? 8D 54 24 14 8B 3D"
		},
		true,
		true,
		0,
		&offsets::global::Player
	},
	{
		{
			"8B 0D ? ? ? ? 50 8D 44 24 18",
			"8B 35 ? ? ? ? C7 44 24 ? ? ? ? ? C7 44 24 ? ? ? ? ? E8",
			"8B 0D ? ? ? ? 53 FF 37",
			"B9 ? ? ? ? E8 ? ? ? ? 8D 88"
		},
		true,
		true,
		0,
		&offsets::global::ManagerTemplate_AIHero_
	},
	{
		{
			"89 1D ? ? ? ? 57 8D 4B 04"
		},
		true,
		true,
		0,
		&offsets::global::ChampionManager
	},
	{
		{
			"A1 ? ? ? ? 53 55 8B 6C 24 1C",
			"A1 ? ? ? ? F3 0F 10 40 ? F3 0F 11 44 24",
			"B9 ? ? ? ? E8 ? ? ? ? 8B 0D ? ? ? ? 3B C1 7F 1F 83 E9 01 89 0D ? ? ? ? 79 14 A1 ? ? ? ? 2B 05 ? ? ? ? C1 F8 02 48 A3 ? ? ? ? 8B 87"
		},
		true,
		true,
		0,
		&offsets::global::ManagerTemplate_AIMinionClient_
	},
	{
		{
			"3B 05 ? ? ? ? 75 72"
		},
		true,
		true,
		0,
		&offsets::global::Riot__g_window
	},
	{
		{
			"8D 8E ? ? ? ? FF 74 24 4C"
		},
		false,
		true,
		0,
		&offsets::AIBaseCommon::CharacterDataStack
	},
	{
		{
			"80 BE ? ? ? ? ? 75 50 0F 31 33 C9 66 C7 86 ? ? ? ? ? ? 89 44 24 18 33 FF"
		},
		false,
		true,
		0,
		&offsets::AIBaseCommon::SkinId
	},
	{
		{
			"8B 86 ? ? ? ? 89 4C 24 08",
			"8B B7 ? ? ? ? FF 70 14",
			"8B AE ? ? ? ? 85 FF 74 46"
		},
		false,
		true,
		0,
		&offsets::MaterialRegistry::D3DDevice
	},
	{
		{
			"8B 8E ? ? ? ? 52 57",
			"8B 8E ? ? ? ? FF B6 ? ? ? ? 51"
		},
		false,
		true,
		0,
		&offsets::MaterialRegistry::SwapChain
	},
	{
		{
			"8A 87 ? ? ? ? 88 4C 24 17"
		},
		false,
		true,
		-1,
		&offsets::AIMinionClient::IsLaneMinion
	},
	{
		{
			"83 EC 50 53 55 56 57 8B F9 8B 47 04"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterDataStack__Push
	},
	{
		{
			"83 EC 1C 56 57 8D 44 24 20"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterDataStack__Update
	},
	{
		{
			"A1 ? ? ? ? 85 C0 75 0B 8B 0D ? ? ? ? 8B 01 FF 60 14",
			"E8 ? ? ? ? 8B 80 ? ? ? ? 89 46 68"
		},
		true,
		false,
		0,
		&offsets::functions::Riot__Renderer__MaterialRegistry__GetSingletonPtr
	},
	{
		{
			"E8 ? ? ? ? 8B 0D ? ? ? ? 83 C4 04 8B F0 6A 0B",
			"83 EC 0C 56 8B 74 24 14 56 E8 ? ? ? ? 83 C4 04 89 74 24 04 89 44 24 08 A8 01",
		},
		true,
		false,
		0,
		&offsets::functions::translateString_UNSAFE_DONOTUSE
	},
	{
		{
			"E8 ? ? ? ? 8B F8 3B F7 0F 84",
			"E8 ? ? ? ? 8B F0 85 F6 74 33 8B 06",
			"E8 ? ? ? ? 85 C0 74 3A 8B CE",
			"E8 ? ? ? ? 39 44 24 1C 5F"
		},
		true,
		false,
		0,
		&offsets::functions::GetGoldRedirectTarget
	},
	{
		{
			"81 EC ? ? ? ? A1 ? ? ? ? 33 C4 89 84 24 ? ? ? ? 56 8B B4 24 ? ? ? ? 8B C6",
			"E8 ? ? ? ? 8B 54 24 30 83 C4 08 89 44 24 10"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterData__GetCharacterPackage
	},
	{
		{
			"C7 44 24 1C ? ? ? ? 8D 44 24 1C 8B CE 50 8D 44 24 10"
		},
		false,
		true,
		0,
		&SummonerEmoteUserComponent::rtti
	},
	{
		{
			"81 EC ? ? ? ? A1 ? ? ? ? 33 C4 89 84 24 ? ? ? ? 56 FF B4 24 ? ? ? ? 8D 44 24 14",
			"E8 ? ? ? ? 83 C4 04 85 C0 74 65 57"
		},
		true,
		false,
		0,
		&offsets::functions::SummonerEmoteUserComponent__GetSummonerEmoteData
	},
	{
		{
			"83 EC 08 56 57 FF 74 24 14"
		},
		true,
		false,
		0,
		&offsets::functions::SummonerEmoteUserComponent__SetEmoteIdForSlot
	}
};

{
	try{
		auto base = std::uintptr_t( GetModuleHandle( nullptr ) );

		//Invalid all

		auto signatureToSearch = (gameClient ? gameClientSig : sigs);

		for ( auto& sig : signatureToSearch )
			*sig.offset = 0;

		while ( true )
		{
			auto missing_offset = false;
			for ( auto& sig : signatureToSearch )
			{

				if ( *sig.offset != 0 )
					continue;

				for ( auto& pattern : sig.sigs )
				{
					auto address = find_signature( nullptr, pattern.c_str( ) );

					if ( !address )
					{
	#ifdef DEBUG
						printf( "Signature failed: %s\n", pattern.c_str( ) );
	#endif
						continue;
					}
					if ( sig.read )
						address = *reinterpret_cast< uint8_t** >( address + ( pattern.find_first_of( "?" ) / 3 ) );
					else if ( address[ 0 ] == 0xE8 )
						address = address + *reinterpret_cast< uint32_t* >( address + 1 ) + 5;

					if ( sig.sub_base )
						address -= base;

					address += sig.additional;

					*sig.offset = reinterpret_cast< uint32_t >( address );
					break;
				}

				if ( !*sig.offset )
				{
					missing_offset = true;
					break;
				}
			}

			if ( !missing_offset )
				break;

			using namespace std::chrono_literals;
			std::this_thread::sleep_for( 2s );
		}
	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("start_signature error: %s", e.what());
#endif
	}
}


/*
*
*
*/
#include "autoupdater.hpp"
#include "offsets.hpp"
#include "game_classes.hpp"

#include <Windows.h>
#include <vector>
#include <cinttypes>
#include <string>
#include <thread>
#include <chrono>

uint8_t* find_signature( const wchar_t* szModule, const char* szSignature )

	try {

		auto module = GetModuleHandle( szModule );
		static auto pattern_to_byte = [ ]( const char* pattern )
		{
			auto bytes = std::vector<int>{};
			auto start = const_cast< char* >( pattern );
			auto end = const_cast< char* >( pattern ) + strlen( pattern );

			for ( auto current = start; current < end; ++current )
			{
				if ( *current == '?' )
				{
					++current;
					if ( *current == '?' )
						++current;
					bytes.push_back( -1 );
				} else
				{
					bytes.push_back( strtoul( current, &current, 16 ) );
				}
			}
			return bytes;
		};

		auto dosHeader = ( PIMAGE_DOS_HEADER ) module;
		auto ntHeaders = ( PIMAGE_NT_HEADERS ) ( ( uint8_t* ) module + dosHeader->e_lfanew );
		auto textSection = IMAGE_FIRST_SECTION( ntHeaders );

		auto sizeOfImage = textSection->SizeOfRawData;
		auto patternBytes = pattern_to_byte( szSignature );
		auto scanBytes = reinterpret_cast< uint8_t* >( module ) + textSection->VirtualAddress;

		auto s = patternBytes.size( );
		auto d = patternBytes.data( );

		auto mbi = MEMORY_BASIC_INFORMATION{ 0 };
		uint8_t* next_check_address = 0;

		for ( auto i = 0ul; i < sizeOfImage - s; ++i )
		{
			bool found = true;
			for ( auto j = 0ul; j < s; ++j )
			{
				auto current_address = scanBytes + i + j;
				if ( current_address >= next_check_address )
				{
					if ( !VirtualQuery( reinterpret_cast< void* >( current_address ), &mbi, sizeof( mbi ) ) )
						break;

					if ( mbi.Protect == PAGE_NOACCESS )
					{
						i += ( ( std::uintptr_t( mbi.BaseAddress ) + mbi.RegionSize ) - ( std::uintptr_t( scanBytes ) + i ) );
						i--;
						found = false;
						break;
					} else
					{
						next_check_address = reinterpret_cast< uint8_t* >( mbi.BaseAddress ) + mbi.RegionSize;
					}
				}

				if ( scanBytes[ i + j ] != d[ j ] && d[ j ] != -1 )
				{
					found = false;
					break;
				}
			}
			if ( found )
			{
				return &scanBytes[ i ];
			}
		}
		return nullptr;

	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("find_signature error: %s", e.what());
#endif
	}
}

class offset_signature
{
public:
	std::vector<std::string> sigs;
	bool sub_base;
	bool read;
	int32_t additional;
	uint32_t* offset;
};

// Single GameClient Signature to game not crashe.
std::vector<offset_signature> gameClientSig = {
	{
		{
			"A1 ? ? ? ? 68 ? ? ? ? 8B 70 08",
			"A1 ? ? ? ? 83 C4 04 C6 40 36 15",
			"8B 35 ? ? ? ? 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C7 44 24 ? ? ? ? ? 89 44 24 18",
			"8B 0D ? ? ? ? FF B0 ? ? ? ? E8 ? ? ? ? A1"
		},
		true,
		true,
		0,
		&offsets::global::GameClient
	}
};

std::vector<offset_signature> sigs = {
	{
		{
			"8B 0D ? ? ? ? 8B F8 81 C1 ? ? ? ? 57",
			"A1 ? ? ? ? 85 C0 74 18 84 C9",
			"8B 0D ? ? ? ? 8D 54 24 14 8B 3D"
		},
		true,
		true,
		0,
		&offsets::global::Player
	},
	{
		{
			"8B 0D ? ? ? ? 50 8D 44 24 18",
			"8B 35 ? ? ? ? C7 44 24 ? ? ? ? ? C7 44 24 ? ? ? ? ? E8",
			"8B 0D ? ? ? ? 53 FF 37",
			"B9 ? ? ? ? E8 ? ? ? ? 8D 88"
		},
		true,
		true,
		0,
		&offsets::global::ManagerTemplate_AIHero_
	},
	{
		{
			"89 1D ? ? ? ? 57 8D 4B 04"
		},
		true,
		true,
		0,
		&offsets::global::ChampionManager
	},
	{
		{
			"A1 ? ? ? ? 53 55 8B 6C 24 1C",
			"A1 ? ? ? ? F3 0F 10 40 ? F3 0F 11 44 24",
			"B9 ? ? ? ? E8 ? ? ? ? 8B 0D ? ? ? ? 3B C1 7F 1F 83 E9 01 89 0D ? ? ? ? 79 14 A1 ? ? ? ? 2B 05 ? ? ? ? C1 F8 02 48 A3 ? ? ? ? 8B 87"
		},
		true,
		true,
		0,
		&offsets::global::ManagerTemplate_AIMinionClient_
	},
	{
		{
			"3B 05 ? ? ? ? 75 72"
		},
		true,
		true,
		0,
		&offsets::global::Riot__g_window
	},
	{
		{
			"8D 8E ? ? ? ? FF 74 24 4C"
		},
		false,
		true,
		0,
		&offsets::AIBaseCommon::CharacterDataStack
	},
	{
		{
			"80 BE ? ? ? ? ? 75 50 0F 31 33 C9 66 C7 86 ? ? ? ? ? ? 89 44 24 18 33 FF"
		},
		false,
		true,
		0,
		&offsets::AIBaseCommon::SkinId
	},
	{
		{
			"8B 86 ? ? ? ? 89 4C 24 08",
			"8B B7 ? ? ? ? FF 70 14",
			"8B AE ? ? ? ? 85 FF 74 46"
		},
		false,
		true,
		0,
		&offsets::MaterialRegistry::D3DDevice
	},
	{
		{
			"8B 8E ? ? ? ? 52 57",
			"8B 8E ? ? ? ? FF B6 ? ? ? ? 51"
		},
		false,
		true,
		0,
		&offsets::MaterialRegistry::SwapChain
	},
	{
		{
			"8A 87 ? ? ? ? 88 4C 24 17"
		},
		false,
		true,
		-1,
		&offsets::AIMinionClient::IsLaneMinion
	},
	{
		{
			"83 EC 50 53 55 56 57 8B F9 8B 47 04"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterDataStack__Push
	},
	{
		{
			"83 EC 1C 56 57 8D 44 24 20"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterDataStack__Update
	},
	{
		{
			"A1 ? ? ? ? 85 C0 75 0B 8B 0D ? ? ? ? 8B 01 FF 60 14",
			"E8 ? ? ? ? 8B 80 ? ? ? ? 89 46 68"
		},
		true,
		false,
		0,
		&offsets::functions::Riot__Renderer__MaterialRegistry__GetSingletonPtr
	},
	{
		{
			"E8 ? ? ? ? 8B 0D ? ? ? ? 83 C4 04 8B F0 6A 0B",
			"83 EC 0C 56 8B 74 24 14 56 E8 ? ? ? ? 83 C4 04 89 74 24 04 89 44 24 08 A8 01",
		},
		true,
		false,
		0,
		&offsets::functions::translateString_UNSAFE_DONOTUSE
	},
	{
		{
			"E8 ? ? ? ? 8B F8 3B F7 0F 84",
			"E8 ? ? ? ? 8B F0 85 F6 74 33 8B 06",
			"E8 ? ? ? ? 85 C0 74 3A 8B CE",
			"E8 ? ? ? ? 39 44 24 1C 5F"
		},
		true,
		false,
		0,
		&offsets::functions::GetGoldRedirectTarget
	},
	{
		{
			"81 EC ? ? ? ? A1 ? ? ? ? 33 C4 89 84 24 ? ? ? ? 56 8B B4 24 ? ? ? ? 8B C6",
			"E8 ? ? ? ? 8B 54 24 30 83 C4 08 89 44 24 10"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterData__GetCharacterPackage
	},
	{
		{
			"C7 44 24 1C ? ? ? ? 8D 44 24 1C 8B CE 50 8D 44 24 10"
		},
		false,
		true,
		0,
		&SummonerEmoteUserComponent::rtti
	},
	{
		{
			"81 EC ? ? ? ? A1 ? ? ? ? 33 C4 89 84 24 ? ? ? ? 56 FF B4 24 ? ? ? ? 8D 44 24 14",
			"E8 ? ? ? ? 83 C4 04 85 C0 74 65 57"
		},
		true,
		false,
		0,
		&offsets::functions::SummonerEmoteUserComponent__GetSummonerEmoteData
	},
	{
		{
			"83 EC 08 56 57 FF 74 24 14"
		},
		true,
		false,
		0,
		&offsets::functions::SummonerEmoteUserComponent__SetEmoteIdForSlot
	}
};

void autoupdater::start( bool gameClient )
{
	try{
		auto base = std::uintptr_t( GetModuleHandle( nullptr ) );

		//Invalid all

		auto signatureToSearch = (gameClient ? gameClientSig : sigs);

		for ( auto& sig : signatureToSearch )
			*sig.offset = 0;

		while ( true )
		{
			auto missing_offset = false;
			for ( auto& sig : signatureToSearch )
			{

				if ( *sig.offset != 0 )
					continue;

				for ( auto& pattern : sig.sigs )
				{
					auto address = find_signature( nullptr, pattern.c_str( ) );

					if ( !address )
					{
	#ifdef DEBUG
						printf( "Signature failed: %s\n", pattern.c_str( ) );
	#endif
						continue;
					}
					if ( sig.read )
						address = *reinterpret_cast< uint8_t** >( address + ( pattern.find_first_of( "?" ) / 3 ) );
					else if ( address[ 0 ] == 0xE8 )
						address = address + *reinterpret_cast< uint32_t* >( address + 1 ) + 5;

					if ( sig.sub_base )
						address -= base;

					address += sig.additional;

					*sig.offset = reinterpret_cast< uint32_t >( address );
					break;
				}

				if ( !*sig.offset )
				{
					missing_offset = true;
					break;
				}
			}

			if ( !missing_offset )
				break;

			using namespace std::chrono_literals;
			std::this_thread::sleep_for( 2s );
		}
	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("start_signature error: %s", e.what());
#endif
	}
}


try {

		auto module = GetModuleHandle( szModule );
		static auto pattern_to_byte = [ ]( const char* pattern )
		{
			auto bytes = std::vector<int>{};
			auto start = const_cast< char* >( pattern );
			auto end = const_cast< char* >( pattern ) + strlen( pattern );

			for ( auto current = start; current < end; ++current )
			{
				if ( *current == '?' )
				{
					++current;
					if ( *current == '?' )
						++current;
					bytes.push_back( -1 );
				} else
				{
					bytes.push_back( strtoul( current, &current, 16 ) );
				}
			}
			return bytes;
		};

		auto dosHeader = ( PIMAGE_DOS_HEADER ) module;
		auto ntHeaders = ( PIMAGE_NT_HEADERS ) ( ( uint8_t* ) module + dosHeader->e_lfanew );
		auto textSection = IMAGE_FIRST_SECTION( ntHeaders );

		auto sizeOfImage = textSection->SizeOfRawData;
		auto patternBytes = pattern_to_byte( szSignature );
		auto scanBytes = reinterpret_cast< uint8_t* >( module ) + textSection->VirtualAddress;

		auto s = patternBytes.size( );
		auto d = patternBytes.data( );

		auto mbi = MEMORY_BASIC_INFORMATION{ 0 };
		uint8_t* next_check_address = 0;

		for ( auto i = 0ul; i < sizeOfImage - s; ++i )
		{
			bool found = true;
			for ( auto j = 0ul; j < s; ++j )
			{
				auto current_address = scanBytes + i + j;
				if ( current_address >= next_check_address )
				{
					if ( !VirtualQuery( reinterpret_cast< void* >( current_address ), &mbi, sizeof( mbi ) ) )
						break;

					if ( mbi.Protect == PAGE_NOACCESS )
					{
						i += ( ( std::uintptr_t( mbi.BaseAddress ) + mbi.RegionSize ) - ( std::uintptr_t( scanBytes ) + i ) );
						i--;
						found = false;
						break;
					} else
					{
						next_check_address = reinterpret_cast< uint8_t* >( mbi.BaseAddress ) + mbi.RegionSize;
					}
				}

				if ( scanBytes[ i + j ] != d[ j ] && d[ j ] != -1 )
				{
					found = false;
					break;
				}
			}
			if ( found )
			{
				return &scanBytes[ i ];
			}
		}
		return nullptr;

	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("find_signature error: %s", e.what());
#endif
	}

/*
*
*
*/
#include "autoupdater.hpp"
#include "offsets.hpp"
#include "game_classes.hpp"

#include <Windows.h>
#include <vector>
#include <cinttypes>
#include <string>
#include <thread>
#include <chrono>

uint8_t* find_signature( const wchar_t* szModule, const char* szSignature )
{


/*
*
*
*/
#include "autoupdater.hpp"
#include "offsets.hpp"
#include "game_classes.hpp"

#include <Windows.h>
#include <vector>
#include <cinttypes>
#include <string>
#include <thread>
#include <chrono>

uint8_t* find_signature( const wchar_t* szModule, const char* szSignature )
{
	try {

		auto module = GetModuleHandle( szModule );
		static auto pattern_to_byte = [ ]( const char* pattern )
		{
			auto bytes = std::vector<int>{};
			auto start = const_cast< char* >( pattern );
			auto end = const_cast< char* >( pattern ) + strlen( pattern );

			for ( auto current = start; current < end; ++current )
			{
				if ( *current == '?' )
				{
					++current;
					if ( *current == '?' )
						++current;
					bytes.push_back( -1 );
				} else
				{
					bytes.push_back( strtoul( current, &current, 16 ) );
				}
			}
			return bytes;
		};

		auto dosHeader = ( PIMAGE_DOS_HEADER ) module;
		auto ntHeaders = ( PIMAGE_NT_HEADERS ) ( ( uint8_t* ) module + dosHeader->e_lfanew );
		auto textSection = IMAGE_FIRST_SECTION( ntHeaders );

		auto sizeOfImage = textSection->SizeOfRawData;
		auto patternBytes = pattern_to_byte( szSignature );
		auto scanBytes = reinterpret_cast< uint8_t* >( module ) + textSection->VirtualAddress;

		auto s = patternBytes.size( );
		auto d = patternBytes.data( );

		auto mbi = MEMORY_BASIC_INFORMATION{ 0 };
		uint8_t* next_check_address = 0;

		for ( auto i = 0ul; i < sizeOfImage - s; ++i )
		{
			bool found = true;
			for ( auto j = 0ul; j < s; ++j )
			{
				auto current_address = scanBytes + i + j;
				if ( current_address >= next_check_address )
				{
					if ( !VirtualQuery( reinterpret_cast< void* >( current_address ), &mbi, sizeof( mbi ) ) )
						break;

					if ( mbi.Protect == PAGE_NOACCESS )
					{
						i += ( ( std::uintptr_t( mbi.BaseAddress ) + mbi.RegionSize ) - ( std::uintptr_t( scanBytes ) + i ) );
						i--;
						found = false;
						break;
					} else
					{
						next_check_address = reinterpret_cast< uint8_t* >( mbi.BaseAddress ) + mbi.RegionSize;
					}
				}

				if ( scanBytes[ i + j ] != d[ j ] && d[ j ] != -1 )
				{
					found = false;
					break;
				}
			}
			if ( found )
			{
				return &scanBytes[ i ];
			}
		}
		return nullptr;

	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("find_signature error: %s", e.what());
#endif
	}


if ( !*sig.offset )
				{
					missing_offset = true;
					break;
				}

/*
*
*
*/
#include "autoupdater.hpp"
#include "offsets.hpp"
#include "game_classes.hpp"

#include <Windows.h>
#include <vector>
#include <cinttypes>
#include <string>
#include <thread>
#include <chrono>

uint8_t* find_signature( const wchar_t* szModule, const char* szSignature )
{
	try {

		auto module = GetModuleHandle( szModule );
		static auto pattern_to_byte = [ ]( const char* pattern )
		{
			auto bytes = std::vector<int>{};
			auto start = const_cast< char* >( pattern );
			auto end = const_cast< char* >( pattern ) + strlen( pattern );

			for ( auto current = start; current < end; ++current )
			{
				if ( *current == '?' )
				{
					++current;
					if ( *current == '?' )
						++current;
					bytes.push_back( -1 );
				} else
				{
					bytes.push_back( strtoul( current, &current, 16 ) );
				}
			}
			return bytes;
		};

		auto dosHeader = ( PIMAGE_DOS_HEADER ) module;
		auto ntHeaders = ( PIMAGE_NT_HEADERS ) ( ( uint8_t* ) module + dosHeader->e_lfanew );
		auto textSection = IMAGE_FIRST_SECTION( ntHeaders );

		auto sizeOfImage = textSection->SizeOfRawData;
		auto patternBytes = pattern_to_byte( szSignature );
		auto scanBytes = reinterpret_cast< uint8_t* >( module ) + textSection->VirtualAddress;

		auto s = patternBytes.size( );
		auto d = patternBytes.data( );

		auto mbi = MEMORY_BASIC_INFORMATION{ 0 };
		uint8_t* next_check_address = 0;

		for ( auto i = 0ul; i < sizeOfImage - s; ++i )
		{
			bool found = true;
			for ( auto j = 0ul; j < s; ++j )
			{
				auto current_address = scanBytes + i + j;
				if ( current_address >= next_check_address )
				{
					if ( !VirtualQuery( reinterpret_cast< void* >( current_address ), &mbi, sizeof( mbi ) ) )
						break;

					if ( mbi.Protect == PAGE_NOACCESS )
					{
						i += ( ( std::uintptr_t( mbi.BaseAddress ) + mbi.RegionSize ) - ( std::uintptr_t( scanBytes ) + i ) );
						i--;
						found = false;
						break;
					} else
					{
						next_check_address = reinterpret_cast< uint8_t* >( mbi.BaseAddress ) + mbi.RegionSize;
					}
				}

				if ( scanBytes[ i + j ] != d[ j ] && d[ j ] != -1 )
				{
					found = false;
					break;
				}
			}
			if ( found )
			{
				return &scanBytes[ i ];
			}
		}
		return nullptr;

	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("find_signature error: %s", e.what());
#endif
	}
}

class offset_signature
{
public:
	std::vector<std::string> sigs;
	bool sub_base;
	bool read;
	int32_t additional;
	uint32_t* offset;
};

// Single GameClient Signature to game not crashe.
std::vector<offset_signature> gameClientSig = {
	{
		{
			"A1 ? ? ? ? 68 ? ? ? ? 8B 70 08",
			"A1 ? ? ? ? 83 C4 04 C6 40 36 15",
			"8B 35 ? ? ? ? 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C7 44 24 ? ? ? ? ? 89 44 24 18",
			"8B 0D ? ? ? ? FF B0 ? ? ? ? E8 ? ? ? ? A1"
		},
		true,
		true,
		0,
		&offsets::global::GameClient
	}
};

std::vector<offset_signature> sigs = {
	{
		{
			"8B 0D ? ? ? ? 8B F8 81 C1 ? ? ? ? 57",
			"A1 ? ? ? ? 85 C0 74 18 84 C9",
			"8B 0D ? ? ? ? 8D 54 24 14 8B 3D"
		},
		true,
		true,
		0,
		&offsets::global::Player
	},
	{
		{
			"8B 0D ? ? ? ? 50 8D 44 24 18",
			"8B 35 ? ? ? ? C7 44 24 ? ? ? ? ? C7 44 24 ? ? ? ? ? E8",
			"8B 0D ? ? ? ? 53 FF 37",
			"B9 ? ? ? ? E8 ? ? ? ? 8D 88"
		},
		true,
		true,
		0,
		&offsets::global::ManagerTemplate_AIHero_
	},
	{
		{
			"89 1D ? ? ? ? 57 8D 4B 04"
		},
		true,
		true,
		0,
		&offsets::global::ChampionManager
	},
	{
		{
			"A1 ? ? ? ? 53 55 8B 6C 24 1C",
			"A1 ? ? ? ? F3 0F 10 40 ? F3 0F 11 44 24",
			"B9 ? ? ? ? E8 ? ? ? ? 8B 0D ? ? ? ? 3B C1 7F 1F 83 E9 01 89 0D ? ? ? ? 79 14 A1 ? ? ? ? 2B 05 ? ? ? ? C1 F8 02 48 A3 ? ? ? ? 8B 87"
		},
		true,
		true,
		0,
		&offsets::global::ManagerTemplate_AIMinionClient_
	},
	{
		{
			"3B 05 ? ? ? ? 75 72"
		},
		true,
		true,
		0,
		&offsets::global::Riot__g_window
	},
	{
		{
			"8D 8E ? ? ? ? FF 74 24 4C"
		},
		false,
		true,
		0,
		&offsets::AIBaseCommon::CharacterDataStack
	},
	{
		{
			"80 BE ? ? ? ? ? 75 50 0F 31 33 C9 66 C7 86 ? ? ? ? ? ? 89 44 24 18 33 FF"
		},
		false,
		true,
		0,
		&offsets::AIBaseCommon::SkinId
	},
	{
		{
			"8B 86 ? ? ? ? 89 4C 24 08",
			"8B B7 ? ? ? ? FF 70 14",
			"8B AE ? ? ? ? 85 FF 74 46"
		},
		false,
		true,
		0,
		&offsets::MaterialRegistry::D3DDevice
	},
	{
		{
			"8B 8E ? ? ? ? 52 57",
			"8B 8E ? ? ? ? FF B6 ? ? ? ? 51"
		},
		false,
		true,
		0,
		&offsets::MaterialRegistry::SwapChain
	},
	{
		{
			"8A 87 ? ? ? ? 88 4C 24 17"
		},
		false,
		true,
		-1,
		&offsets::AIMinionClient::IsLaneMinion
	},
	{
		{
			"83 EC 50 53 55 56 57 8B F9 8B 47 04"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterDataStack__Push
	},
	{
		{
			"83 EC 1C 56 57 8D 44 24 20"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterDataStack__Update
	},
	{
		{
			"A1 ? ? ? ? 85 C0 75 0B 8B 0D ? ? ? ? 8B 01 FF 60 14",
			"E8 ? ? ? ? 8B 80 ? ? ? ? 89 46 68"
		},
		true,
		false,
		0,
		&offsets::functions::Riot__Renderer__MaterialRegistry__GetSingletonPtr
	},
	{
		{
			"E8 ? ? ? ? 8B 0D ? ? ? ? 83 C4 04 8B F0 6A 0B",
			"83 EC 0C 56 8B 74 24 14 56 E8 ? ? ? ? 83 C4 04 89 74 24 04 89 44 24 08 A8 01",
		},
		true,
		false,
		0,
		&offsets::functions::translateString_UNSAFE_DONOTUSE
	},
	{
		{
			"E8 ? ? ? ? 8B F8 3B F7 0F 84",
			"E8 ? ? ? ? 8B F0 85 F6 74 33 8B 06",
			"E8 ? ? ? ? 85 C0 74 3A 8B CE",
			"E8 ? ? ? ? 39 44 24 1C 5F"
		},
		true,
		false,
		0,
		&offsets::functions::GetGoldRedirectTarget
	},
	{
		{
			"81 EC ? ? ? ? A1 ? ? ? ? 33 C4 89 84 24 ? ? ? ? 56 8B B4 24 ? ? ? ? 8B C6",
			"E8 ? ? ? ? 8B 54 24 30 83 C4 08 89 44 24 10"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterData__GetCharacterPackage
	},
	{
		{
			"C7 44 24 1C ? ? ? ? 8D 44 24 1C 8B CE 50 8D 44 24 10"
		},
		false,
		true,
		0,
		&SummonerEmoteUserComponent::rtti
	},
	{
		{
			"81 EC ? ? ? ? A1 ? ? ? ? 33 C4 89 84 24 ? ? ? ? 56 FF B4 24 ? ? ? ? 8D 44 24 14",
			"E8 ? ? ? ? 83 C4 04 85 C0 74 65 57"
		},
		true,
		false,
		0,
		&offsets::functions::SummonerEmoteUserComponent__GetSummonerEmoteData
	},
	{
		{
			"83 EC 08 56 57 FF 74 24 14"
		},
		true,
		false,
		0,
		&offsets::functions::SummonerEmoteUserComponent__SetEmoteIdForSlot
	}
};

void autoupdater::start( bool gameClient )
{
	try{
		auto base = std::uintptr_t( GetModuleHandle( nullptr ) );

		//Invalid all

		auto signatureToSearch = (gameClient ? gameClientSig : sigs);

		for ( auto& sig : signatureToSearch )
			*sig.offset = 0;

		while ( true )
		{
			auto missing_offset = false;
			for ( auto& sig : signatureToSearch )
			{

				if ( *sig.offset != 0 )
					continue;

				for ( auto& pattern : sig.sigs )
				{
					auto address = find_signature( nullptr, pattern.c_str( ) );

					if ( !address )
					{
	#ifdef DEBUG
						printf( "Signature failed: %s\n", pattern.c_str( ) );
	#endif
						continue;
					}
					if ( sig.read )
						address = *reinterpret_cast< uint8_t** >( address + ( pattern.find_first_of( "?" ) / 3 ) );
					else if ( address[ 0 ] == 0xE8 )
						address = address + *reinterpret_cast< uint32_t* >( address + 1 ) + 5;

					if ( sig.sub_base )
						address -= base;

					address += sig.additional;

					*sig.offset = reinterpret_cast< uint32_t >( address );
					break;
				}

			}

			if ( !missing_offset )
				break;

			using namespace std::chrono_literals;
			std::this_thread::sleep_for( 2s );
		}
	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("start_signature error: %s", e.what());
#endif
	}
}


for ( auto current = start; current < end; ++current )
			{
				if ( *current == '?' )
				{
					++current;
					if ( *current == '?' )
						++current;
					bytes.push_back( -1 );
				} else
				{
					bytes.push_back( strtoul( current, &current, 16 ) );
				}
			}

/*
*
*
*/
#include "autoupdater.hpp"
#include "offsets.hpp"
#include "game_classes.hpp"

#include <Windows.h>
#include <vector>
#include <cinttypes>
#include <string>
#include <thread>
#include <chrono>

uint8_t* find_signature( const wchar_t* szModule, const char* szSignature )
{
	try {

		auto module = GetModuleHandle( szModule );
		static auto pattern_to_byte = [ ]( const char* pattern )
		{
			auto bytes = std::vector<int>{};
			auto start = const_cast< char* >( pattern );
			auto end = const_cast< char* >( pattern ) + strlen( pattern );

			return bytes;
		};

		auto dosHeader = ( PIMAGE_DOS_HEADER ) module;
		auto ntHeaders = ( PIMAGE_NT_HEADERS ) ( ( uint8_t* ) module + dosHeader->e_lfanew );
		auto textSection = IMAGE_FIRST_SECTION( ntHeaders );

		auto sizeOfImage = textSection->SizeOfRawData;
		auto patternBytes = pattern_to_byte( szSignature );
		auto scanBytes = reinterpret_cast< uint8_t* >( module ) + textSection->VirtualAddress;

		auto s = patternBytes.size( );
		auto d = patternBytes.data( );

		auto mbi = MEMORY_BASIC_INFORMATION{ 0 };
		uint8_t* next_check_address = 0;

		for ( auto i = 0ul; i < sizeOfImage - s; ++i )
		{
			bool found = true;
			for ( auto j = 0ul; j < s; ++j )
			{
				auto current_address = scanBytes + i + j;
				if ( current_address >= next_check_address )
				{
					if ( !VirtualQuery( reinterpret_cast< void* >( current_address ), &mbi, sizeof( mbi ) ) )
						break;

					if ( mbi.Protect == PAGE_NOACCESS )
					{
						i += ( ( std::uintptr_t( mbi.BaseAddress ) + mbi.RegionSize ) - ( std::uintptr_t( scanBytes ) + i ) );
						i--;
						found = false;
						break;
					} else
					{
						next_check_address = reinterpret_cast< uint8_t* >( mbi.BaseAddress ) + mbi.RegionSize;
					}
				}

				if ( scanBytes[ i + j ] != d[ j ] && d[ j ] != -1 )
				{
					found = false;
					break;
				}
			}
			if ( found )
			{
				return &scanBytes[ i ];
			}
		}
		return nullptr;

	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("find_signature error: %s", e.what());
#endif
	}
}

class offset_signature
{
public:
	std::vector<std::string> sigs;
	bool sub_base;
	bool read;
	int32_t additional;
	uint32_t* offset;
};

// Single GameClient Signature to game not crashe.
std::vector<offset_signature> gameClientSig = {
	{
		{
			"A1 ? ? ? ? 68 ? ? ? ? 8B 70 08",
			"A1 ? ? ? ? 83 C4 04 C6 40 36 15",
			"8B 35 ? ? ? ? 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C7 44 24 ? ? ? ? ? 89 44 24 18",
			"8B 0D ? ? ? ? FF B0 ? ? ? ? E8 ? ? ? ? A1"
		},
		true,
		true,
		0,
		&offsets::global::GameClient
	}
};

std::vector<offset_signature> sigs = {
	{
		{
			"8B 0D ? ? ? ? 8B F8 81 C1 ? ? ? ? 57",
			"A1 ? ? ? ? 85 C0 74 18 84 C9",
			"8B 0D ? ? ? ? 8D 54 24 14 8B 3D"
		},
		true,
		true,
		0,
		&offsets::global::Player
	},
	{
		{
			"8B 0D ? ? ? ? 50 8D 44 24 18",
			"8B 35 ? ? ? ? C7 44 24 ? ? ? ? ? C7 44 24 ? ? ? ? ? E8",
			"8B 0D ? ? ? ? 53 FF 37",
			"B9 ? ? ? ? E8 ? ? ? ? 8D 88"
		},
		true,
		true,
		0,
		&offsets::global::ManagerTemplate_AIHero_
	},
	{
		{
			"89 1D ? ? ? ? 57 8D 4B 04"
		},
		true,
		true,
		0,
		&offsets::global::ChampionManager
	},
	{
		{
			"A1 ? ? ? ? 53 55 8B 6C 24 1C",
			"A1 ? ? ? ? F3 0F 10 40 ? F3 0F 11 44 24",
			"B9 ? ? ? ? E8 ? ? ? ? 8B 0D ? ? ? ? 3B C1 7F 1F 83 E9 01 89 0D ? ? ? ? 79 14 A1 ? ? ? ? 2B 05 ? ? ? ? C1 F8 02 48 A3 ? ? ? ? 8B 87"
		},
		true,
		true,
		0,
		&offsets::global::ManagerTemplate_AIMinionClient_
	},
	{
		{
			"3B 05 ? ? ? ? 75 72"
		},
		true,
		true,
		0,
		&offsets::global::Riot__g_window
	},
	{
		{
			"8D 8E ? ? ? ? FF 74 24 4C"
		},
		false,
		true,
		0,
		&offsets::AIBaseCommon::CharacterDataStack
	},
	{
		{
			"80 BE ? ? ? ? ? 75 50 0F 31 33 C9 66 C7 86 ? ? ? ? ? ? 89 44 24 18 33 FF"
		},
		false,
		true,
		0,
		&offsets::AIBaseCommon::SkinId
	},
	{
		{
			"8B 86 ? ? ? ? 89 4C 24 08",
			"8B B7 ? ? ? ? FF 70 14",
			"8B AE ? ? ? ? 85 FF 74 46"
		},
		false,
		true,
		0,
		&offsets::MaterialRegistry::D3DDevice
	},
	{
		{
			"8B 8E ? ? ? ? 52 57",
			"8B 8E ? ? ? ? FF B6 ? ? ? ? 51"
		},
		false,
		true,
		0,
		&offsets::MaterialRegistry::SwapChain
	},
	{
		{
			"8A 87 ? ? ? ? 88 4C 24 17"
		},
		false,
		true,
		-1,
		&offsets::AIMinionClient::IsLaneMinion
	},
	{
		{
			"83 EC 50 53 55 56 57 8B F9 8B 47 04"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterDataStack__Push
	},
	{
		{
			"83 EC 1C 56 57 8D 44 24 20"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterDataStack__Update
	},
	{
		{
			"A1 ? ? ? ? 85 C0 75 0B 8B 0D ? ? ? ? 8B 01 FF 60 14",
			"E8 ? ? ? ? 8B 80 ? ? ? ? 89 46 68"
		},
		true,
		false,
		0,
		&offsets::functions::Riot__Renderer__MaterialRegistry__GetSingletonPtr
	},
	{
		{
			"E8 ? ? ? ? 8B 0D ? ? ? ? 83 C4 04 8B F0 6A 0B",
			"83 EC 0C 56 8B 74 24 14 56 E8 ? ? ? ? 83 C4 04 89 74 24 04 89 44 24 08 A8 01",
		},
		true,
		false,
		0,
		&offsets::functions::translateString_UNSAFE_DONOTUSE
	},
	{
		{
			"E8 ? ? ? ? 8B F8 3B F7 0F 84",
			"E8 ? ? ? ? 8B F0 85 F6 74 33 8B 06",
			"E8 ? ? ? ? 85 C0 74 3A 8B CE",
			"E8 ? ? ? ? 39 44 24 1C 5F"
		},
		true,
		false,
		0,
		&offsets::functions::GetGoldRedirectTarget
	},
	{
		{
			"81 EC ? ? ? ? A1 ? ? ? ? 33 C4 89 84 24 ? ? ? ? 56 8B B4 24 ? ? ? ? 8B C6",
			"E8 ? ? ? ? 8B 54 24 30 83 C4 08 89 44 24 10"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterData__GetCharacterPackage
	},
	{
		{
			"C7 44 24 1C ? ? ? ? 8D 44 24 1C 8B CE 50 8D 44 24 10"
		},
		false,
		true,
		0,
		&SummonerEmoteUserComponent::rtti
	},
	{
		{
			"81 EC ? ? ? ? A1 ? ? ? ? 33 C4 89 84 24 ? ? ? ? 56 FF B4 24 ? ? ? ? 8D 44 24 14",
			"E8 ? ? ? ? 83 C4 04 85 C0 74 65 57"
		},
		true,
		false,
		0,
		&offsets::functions::SummonerEmoteUserComponent__GetSummonerEmoteData
	},
	{
		{
			"83 EC 08 56 57 FF 74 24 14"
		},
		true,
		false,
		0,
		&offsets::functions::SummonerEmoteUserComponent__SetEmoteIdForSlot
	}
};

void autoupdater::start( bool gameClient )
{
	try{
		auto base = std::uintptr_t( GetModuleHandle( nullptr ) );

		//Invalid all

		auto signatureToSearch = (gameClient ? gameClientSig : sigs);

		for ( auto& sig : signatureToSearch )
			*sig.offset = 0;

		while ( true )
		{
			auto missing_offset = false;
			for ( auto& sig : signatureToSearch )
			{

				if ( *sig.offset != 0 )
					continue;

				for ( auto& pattern : sig.sigs )
				{
					auto address = find_signature( nullptr, pattern.c_str( ) );

					if ( !address )
					{
	#ifdef DEBUG
						printf( "Signature failed: %s\n", pattern.c_str( ) );
	#endif
						continue;
					}
					if ( sig.read )
						address = *reinterpret_cast< uint8_t** >( address + ( pattern.find_first_of( "?" ) / 3 ) );
					else if ( address[ 0 ] == 0xE8 )
						address = address + *reinterpret_cast< uint32_t* >( address + 1 ) + 5;

					if ( sig.sub_base )
						address -= base;

					address += sig.additional;

					*sig.offset = reinterpret_cast< uint32_t >( address );
					break;
				}

				if ( !*sig.offset )
				{
					missing_offset = true;
					break;
				}
			}

			if ( !missing_offset )
				break;

			using namespace std::chrono_literals;
			std::this_thread::sleep_for( 2s );
		}
	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("start_signature error: %s", e.what());
#endif
	}
}


/*
*
*
*/
#include "autoupdater.hpp"
#include "offsets.hpp"
#include "game_classes.hpp"

#include <Windows.h>
#include <vector>
#include <cinttypes>
#include <string>
#include <thread>
#include <chrono>

uint8_t* find_signature( const wchar_t* szModule, const char* szSignature )
{
	try {

		auto module = GetModuleHandle( szModule );
		static auto pattern_to_byte = [ ]( const char* pattern )
		{
			auto bytes = std::vector<int>{};
			auto start = const_cast< char* >( pattern );
			auto end = const_cast< char* >( pattern ) + strlen( pattern );

			for ( auto current = start; current < end; ++current )
			{
				if ( *current == '?' )
				{
					++current;
					if ( *current == '?' )
						++current;
					bytes.push_back( -1 );
				} else
				{
					bytes.push_back( strtoul( current, &current, 16 ) );
				}
			}
			return bytes;
		};

		auto dosHeader = ( PIMAGE_DOS_HEADER ) module;
		auto ntHeaders = ( PIMAGE_NT_HEADERS ) ( ( uint8_t* ) module + dosHeader->e_lfanew );
		auto textSection = IMAGE_FIRST_SECTION( ntHeaders );

		auto sizeOfImage = textSection->SizeOfRawData;
		auto patternBytes = pattern_to_byte( szSignature );
		auto scanBytes = reinterpret_cast< uint8_t* >( module ) + textSection->VirtualAddress;

		auto s = patternBytes.size( );
		auto d = patternBytes.data( );

		auto mbi = MEMORY_BASIC_INFORMATION{ 0 };
		uint8_t* next_check_address = 0;

		for ( auto i = 0ul; i < sizeOfImage - s; ++i )
		{
			bool found = true;
			for ( auto j = 0ul; j < s; ++j )
			{
				auto current_address = scanBytes + i + j;
				if ( current_address >= next_check_address )
				{
					if ( !VirtualQuery( reinterpret_cast< void* >( current_address ), &mbi, sizeof( mbi ) ) )
						break;

					if ( mbi.Protect == PAGE_NOACCESS )
					{
						i += ( ( std::uintptr_t( mbi.BaseAddress ) + mbi.RegionSize ) - ( std::uintptr_t( scanBytes ) + i ) );
						i--;
						found = false;
						break;
					} else
					{
						next_check_address = reinterpret_cast< uint8_t* >( mbi.BaseAddress ) + mbi.RegionSize;
					}
				}

				if ( scanBytes[ i + j ] != d[ j ] && d[ j ] != -1 )
				{
					found = false;
					break;
				}
			}
			if ( found )
			{
				return &scanBytes[ i ];
			}
		}
		return nullptr;

	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("find_signature error: %s", e.what());
#endif
	}
}

class offset_signature
{
public:
	std::vector<std::string> sigs;
	bool sub_base;
	bool read;
	int32_t additional;
	uint32_t* offset;
};

// Single GameClient Signature to game not crashe.
std::vector<offset_signature> gameClientSig = {
	{
		{
			"A1 ? ? ? ? 68 ? ? ? ? 8B 70 08",
			"A1 ? ? ? ? 83 C4 04 C6 40 36 15",
			"8B 35 ? ? ? ? 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C7 44 24 ? ? ? ? ? 89 44 24 18",
			"8B 0D ? ? ? ? FF B0 ? ? ? ? E8 ? ? ? ? A1"
		},
		true,
		true,
		0,
		&offsets::global::GameClient
	}
};

std::vector<offset_signature> sigs = {
	{
		{
			"8B 0D ? ? ? ? 8B F8 81 C1 ? ? ? ? 57",
			"A1 ? ? ? ? 85 C0 74 18 84 C9",
			"8B 0D ? ? ? ? 8D 54 24 14 8B 3D"
		},
		true,
		true,
		0,
		&offsets::global::Player
	},
	{
		{
			"8B 0D ? ? ? ? 50 8D 44 24 18",
			"8B 35 ? ? ? ? C7 44 24 ? ? ? ? ? C7 44 24 ? ? ? ? ? E8",
			"8B 0D ? ? ? ? 53 FF 37",
			"B9 ? ? ? ? E8 ? ? ? ? 8D 88"
		},
		true,
		true,
		0,
		&offsets::global::ManagerTemplate_AIHero_
	},
	{
		{
			"89 1D ? ? ? ? 57 8D 4B 04"
		},
		true,
		true,
		0,
		&offsets::global::ChampionManager
	},
	{
		{
			"A1 ? ? ? ? 53 55 8B 6C 24 1C",
			"A1 ? ? ? ? F3 0F 10 40 ? F3 0F 11 44 24",
			"B9 ? ? ? ? E8 ? ? ? ? 8B 0D ? ? ? ? 3B C1 7F 1F 83 E9 01 89 0D ? ? ? ? 79 14 A1 ? ? ? ? 2B 05 ? ? ? ? C1 F8 02 48 A3 ? ? ? ? 8B 87"
		},
		true,
		true,
		0,
		&offsets::global::ManagerTemplate_AIMinionClient_
	},
	{
		{
			"3B 05 ? ? ? ? 75 72"
		},
		true,
		true,
		0,
		&offsets::global::Riot__g_window
	},
	{
		{
			"8D 8E ? ? ? ? FF 74 24 4C"
		},
		false,
		true,
		0,
		&offsets::AIBaseCommon::CharacterDataStack
	},
	{
		{
			"80 BE ? ? ? ? ? 75 50 0F 31 33 C9 66 C7 86 ? ? ? ? ? ? 89 44 24 18 33 FF"
		},
		false,
		true,
		0,
		&offsets::AIBaseCommon::SkinId
	},
	{
		{
			"8B 86 ? ? ? ? 89 4C 24 08",
			"8B B7 ? ? ? ? FF 70 14",
			"8B AE ? ? ? ? 85 FF 74 46"
		},
		false,
		true,
		0,
		&offsets::MaterialRegistry::D3DDevice
	},
	{
		{
			"8B 8E ? ? ? ? 52 57",
			"8B 8E ? ? ? ? FF B6 ? ? ? ? 51"
		},
		false,
		true,
		0,
		&offsets::MaterialRegistry::SwapChain
	},
	{
		{
			"8A 87 ? ? ? ? 88 4C 24 17"
		},
		false,
		true,
		-1,
		&offsets::AIMinionClient::IsLaneMinion
	},
	{
		{
			"83 EC 50 53 55 56 57 8B F9 8B 47 04"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterDataStack__Push
	},
	{
		{
			"83 EC 1C 56 57 8D 44 24 20"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterDataStack__Update
	},
	{
		{
			"A1 ? ? ? ? 85 C0 75 0B 8B 0D ? ? ? ? 8B 01 FF 60 14",
			"E8 ? ? ? ? 8B 80 ? ? ? ? 89 46 68"
		},
		true,
		false,
		0,
		&offsets::functions::Riot__Renderer__MaterialRegistry__GetSingletonPtr
	},
	{
		{
			"E8 ? ? ? ? 8B 0D ? ? ? ? 83 C4 04 8B F0 6A 0B",
			"83 EC 0C 56 8B 74 24 14 56 E8 ? ? ? ? 83 C4 04 89 74 24 04 89 44 24 08 A8 01",
		},
		true,
		false,
		0,
		&offsets::functions::translateString_UNSAFE_DONOTUSE
	},
	{
		{
			"E8 ? ? ? ? 8B F8 3B F7 0F 84",
			"E8 ? ? ? ? 8B F0 85 F6 74 33 8B 06",
			"E8 ? ? ? ? 85 C0 74 3A 8B CE",
			"E8 ? ? ? ? 39 44 24 1C 5F"
		},
		true,
		false,
		0,
		&offsets::functions::GetGoldRedirectTarget
	},
	{
		{
			"81 EC ? ? ? ? A1 ? ? ? ? 33 C4 89 84 24 ? ? ? ? 56 8B B4 24 ? ? ? ? 8B C6",
			"E8 ? ? ? ? 8B 54 24 30 83 C4 08 89 44 24 10"
		},
		true,
		false,
		0,
		&offsets::functions::CharacterData__GetCharacterPackage
	},
	{
		{
			"C7 44 24 1C ? ? ? ? 8D 44 24 1C 8B CE 50 8D 44 24 10"
		},
		false,
		true,
		0,
		&SummonerEmoteUserComponent::rtti
	},
	{
		{
			"81 EC ? ? ? ? A1 ? ? ? ? 33 C4 89 84 24 ? ? ? ? 56 FF B4 24 ? ? ? ? 8D 44 24 14",
			"E8 ? ? ? ? 83 C4 04 85 C0 74 65 57"
		},
		true,
		false,
		0,
		&offsets::functions::SummonerEmoteUserComponent__GetSummonerEmoteData
	},
	{
		{
			"83 EC 08 56 57 FF 74 24 14"
		},
		true,
		false,
		0,
		&offsets::functions::SummonerEmoteUserComponent__SetEmoteIdForSlot
	}
};

void autoupdater::start( bool gameClient )
{
	try{
		auto base = std::uintptr_t( GetModuleHandle( nullptr ) );

		//Invalid all

		auto signatureToSearch = (gameClient ? gameClientSig : sigs);

		for ( auto& sig : signatureToSearch )
			*sig.offset = 0;

		while ( true )
		{
			auto missing_offset = false;
			for ( auto& sig : signatureToSearch )
			{

				if ( *sig.offset != 0 )
					continue;

				for ( auto& pattern : sig.sigs )
				{
					auto address = find_signature( nullptr, pattern.c_str( ) );

					if ( !address )
					{
	#ifdef DEBUG
						printf( "Signature failed: %s\n", pattern.c_str( ) );
	#endif
						continue;
					}
					if ( sig.read )
						address = *reinterpret_cast< uint8_t** >( address + ( pattern.find_first_of( "?" ) / 3 ) );
					else if ( address[ 0 ] == 0xE8 )
						address = address + *reinterpret_cast< uint32_t* >( address + 1 ) + 5;

					if ( sig.sub_base )
						address -= base;

					address += sig.additional;

					*sig.offset = reinterpret_cast< uint32_t >( address );
					break;
				}

				if ( !*sig.offset )
				{
					missing_offset = true;
					break;
				}
			}

			if ( !missing_offset )
				break;

			using namespace std::

chrono_literals;
			std::this_thread::sleep_for( 2s );
		}
	}
	catch (std::exception& e) {
#ifdef DEBUG
		printf("start_signature error: %s", e.what());
#endif
	}
}


/**
 */

#include <aws/lightsail/model/HeaderEnum.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace Lightsail
  {
    namespace Model
    {
      namespace HeaderEnumMapper
      {

        static const int Accept_HASH = HashingUtils::HashString("Accept");
        static const int Accept_Charset_HASH = HashingUtils::HashString("Accept-Charset");
        static const int Accept_Datetime_HASH = HashingUtils::HashString("Accept-Datetime");
        static const int Accept_Encoding_HASH = HashingUtils::HashString("Accept-Encoding");
        static const int Accept_Language_HASH = HashingUtils::HashString("Accept-Language");
        static const int Authorization_HASH = HashingUtils::HashString("Authorization");
        static const int CloudFront_Forwarded_Proto_HASH = HashingUtils::HashString("CloudFront-Forwarded-Proto");
        static const int CloudFront_Is_Desktop_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Desktop-Viewer");
        static const int CloudFront_Is_Mobile_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Mobile-Viewer");
        static const int CloudFront_Is_SmartTV_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-SmartTV-Viewer");
        static const int CloudFront_Is_Tablet_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Tablet-Viewer");
        static const int CloudFront_Viewer_Country_HASH = HashingUtils::HashString("CloudFront-Viewer-Country");
        static const int Host_HASH = HashingUtils::HashString("Host");
        static const int Origin_HASH = HashingUtils::HashString("Origin");
        static const int Referer_HASH = HashingUtils::HashString("Referer");

        HeaderEnum GetHeaderEnumForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == Accept_HASH)
          {
            return HeaderEnum::Accept;
          }
          else if (hashCode == Accept_Charset_HASH)
          {
            return HeaderEnum::Accept_Charset;
          }
          else if (hashCode == Accept_Datetime_HASH)
          {
            return HeaderEnum::Accept_Datetime;
          }
          else if (hashCode == Accept_Encoding_HASH)
          {
            return HeaderEnum::Accept_Encoding;
          }
          else if (hashCode == Accept_Language_HASH)
          {
            return HeaderEnum::Accept_Language;
          }
          else if (hashCode == Authorization_HASH)
          {
            return HeaderEnum::Authorization;
          }
          else if (hashCode == CloudFront_Forwarded_Proto_HASH)
          {
            return HeaderEnum::CloudFront_Forwarded_Proto;
          }
          else if (hashCode == CloudFront_Is_Desktop_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Desktop_Viewer;
          }
          else if (hashCode == CloudFront_Is_Mobile_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Mobile_Viewer;
          }
          else if (hashCode == CloudFront_Is_SmartTV_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_SmartTV_Viewer;
          }
          else if (hashCode == CloudFront_Is_Tablet_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Tablet_Viewer;
          }
          else if (hashCode == CloudFront_Viewer_Country_HASH)
          {
            return HeaderEnum::CloudFront_Viewer_Country;
          }
          else if (hashCode == Host_HASH)
          {
            return HeaderEnum::Host;
          }
          else if (hashCode == Origin_HASH)
          {
            return HeaderEnum::Origin;
          }
          else if (hashCode == Referer_HASH)
          {
            return HeaderEnum::Referer;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<HeaderEnum>(hashCode);
          }

          return HeaderEnum::NOT_SET;
        }

{
          switch(enumValue)
          {
          case HeaderEnum::Accept:
            return "Accept";
          case HeaderEnum::Accept_Charset:
            return "Accept-Charset";
          case HeaderEnum::Accept_Datetime:
            return "Accept-Datetime";
          case HeaderEnum::Accept_Encoding:
            return "Accept-Encoding";
          case HeaderEnum::Accept_Language:
            return "Accept-Language";
          case HeaderEnum::Authorization:
            return "Authorization";
          case HeaderEnum::CloudFront_Forwarded_Proto:
            return "CloudFront-Forwarded-Proto";
          case HeaderEnum::CloudFront_Is_Desktop_Viewer:
            return "CloudFront-Is-Desktop-Viewer";
          case HeaderEnum::CloudFront_Is_Mobile_Viewer:
            return "CloudFront-Is-Mobile-Viewer";
          case HeaderEnum::CloudFront_Is_SmartTV_Viewer:
            return "CloudFront-Is-SmartTV-Viewer";
          case HeaderEnum::CloudFront_Is_Tablet_Viewer:
            return "CloudFront-Is-Tablet-Viewer";
          case HeaderEnum::CloudFront_Viewer_Country:
            return "CloudFront-Viewer-Country";
          case HeaderEnum::Host:
            return "Host";
          case HeaderEnum::Origin:
            return "Origin";
          case HeaderEnum::Referer:
            return "Referer";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace HeaderEnumMapper
    } // namespace Model
  } // namespace Lightsail
} // namespace Aws


/**
 */

#include <aws/lightsail/model/HeaderEnum.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace Lightsail
  {
    namespace Model
    {
      namespace HeaderEnumMapper
      {

        static const int Accept_HASH = HashingUtils::HashString("Accept");
        static const int Accept_Charset_HASH = HashingUtils::HashString("Accept-Charset");
        static const int Accept_Datetime_HASH = HashingUtils::HashString("Accept-Datetime");
        static const int Accept_Encoding_HASH = HashingUtils::HashString("Accept-Encoding");
        static const int Accept_Language_HASH = HashingUtils::HashString("Accept-Language");
        static const int Authorization_HASH = HashingUtils::HashString("Authorization");
        static const int CloudFront_Forwarded_Proto_HASH = HashingUtils::HashString("CloudFront-Forwarded-Proto");
        static const int CloudFront_Is_Desktop_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Desktop-Viewer");
        static const int CloudFront_Is_Mobile_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Mobile-Viewer");
        static const int CloudFront_Is_SmartTV_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-SmartTV-Viewer");
        static const int CloudFront_Is_Tablet_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Tablet-Viewer");
        static const int CloudFront_Viewer_Country_HASH = HashingUtils::HashString("CloudFront-Viewer-Country");
        static const int Host_HASH = HashingUtils::HashString("Host");
        static const int Origin_HASH = HashingUtils::HashString("Origin");
        static const int Referer_HASH = HashingUtils::HashString("Referer");

        HeaderEnum GetHeaderEnumForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == Accept_HASH)
          {
            return HeaderEnum::Accept;
          }
          else if (hashCode == Accept_Charset_HASH)
          {
            return HeaderEnum::Accept_Charset;
          }
          else if (hashCode == Accept_Datetime_HASH)
          {
            return HeaderEnum::Accept_Datetime;
          }
          else if (hashCode == Accept_Encoding_HASH)
          {
            return HeaderEnum::Accept_Encoding;
          }
          else if (hashCode == Accept_Language_HASH)
          {
            return HeaderEnum::Accept_Language;
          }
          else if (hashCode == Authorization_HASH)
          {
            return HeaderEnum::Authorization;
          }
          else if (hashCode == CloudFront_Forwarded_Proto_HASH)
          {
            return HeaderEnum::CloudFront_Forwarded_Proto;
          }
          else if (hashCode == CloudFront_Is_Desktop_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Desktop_Viewer;
          }
          else if (hashCode == CloudFront_Is_Mobile_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Mobile_Viewer;
          }
          else if (hashCode == CloudFront_Is_SmartTV_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_SmartTV_Viewer;
          }
          else if (hashCode == CloudFront_Is_Tablet_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Tablet_Viewer;
          }
          else if (hashCode == CloudFront_Viewer_Country_HASH)
          {
            return HeaderEnum::CloudFront_Viewer_Country;
          }
          else if (hashCode == Host_HASH)
          {
            return HeaderEnum::Host;
          }
          else if (hashCode == Origin_HASH)
          {
            return HeaderEnum::Origin;
          }
          else if (hashCode == Referer_HASH)
          {
            return HeaderEnum::Referer;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<HeaderEnum>(hashCode);
          }

          return HeaderEnum::NOT_SET;
        }

        Aws::String GetNameForHeaderEnum(HeaderEnum enumValue)

          switch(enumValue)
          {
          case HeaderEnum::Accept:
            return "Accept";
          case HeaderEnum::Accept_Charset:
            return "Accept-Charset";
          case HeaderEnum::Accept_Datetime:
            return "Accept-Datetime";
          case HeaderEnum::Accept_Encoding:
            return "Accept-Encoding";
          case HeaderEnum::Accept_Language:
            return "Accept-Language";
          case HeaderEnum::Authorization:
            return "Authorization";
          case HeaderEnum::CloudFront_Forwarded_Proto:
            return "CloudFront-Forwarded-Proto";
          case HeaderEnum::CloudFront_Is_Desktop_Viewer:
            return "CloudFront-Is-Desktop-Viewer";
          case HeaderEnum::CloudFront_Is_Mobile_Viewer:
            return "CloudFront-Is-Mobile-Viewer";
          case HeaderEnum::CloudFront_Is_SmartTV_Viewer:
            return "CloudFront-Is-SmartTV-Viewer";
          case HeaderEnum::CloudFront_Is_Tablet_Viewer:
            return "CloudFront-Is-Tablet-Viewer";
          case HeaderEnum::CloudFront_Viewer_Country:
            return "CloudFront-Viewer-Country";
          case HeaderEnum::Host:
            return "Host";
          case HeaderEnum::Origin:
            return "Origin";
          case HeaderEnum::Referer:
            return "Referer";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace HeaderEnumMapper
    } // namespace Model
  } // namespace Lightsail
} // namespace Aws


switch(enumValue)
          {
          case HeaderEnum::Accept:
            return "Accept";
          case HeaderEnum::Accept_Charset:
            return "Accept-Charset";
          case HeaderEnum::Accept_Datetime:
            return "Accept-Datetime";
          case HeaderEnum::Accept_Encoding:
            return "Accept-Encoding";
          case HeaderEnum::Accept_Language:
            return "Accept-Language";
          case HeaderEnum::Authorization:
            return "Authorization";
          case HeaderEnum::CloudFront_Forwarded_Proto:
            return "CloudFront-Forwarded-Proto";
          case HeaderEnum::CloudFront_Is_Desktop_Viewer:
            return "CloudFront-Is-Desktop-Viewer";
          case HeaderEnum::CloudFront_Is_Mobile_Viewer:
            return "CloudFront-Is-Mobile-Viewer";
          case HeaderEnum::CloudFront_Is_SmartTV_Viewer:
            return "CloudFront-Is-SmartTV-Viewer";
          case HeaderEnum::CloudFront_Is_Tablet_Viewer:
            return "CloudFront-Is-Tablet-Viewer";
          case HeaderEnum::CloudFront_Viewer_Country:
            return "CloudFront-Viewer-Country";
          case HeaderEnum::Host:
            return "Host";
          case HeaderEnum::Origin:
            return "Origin";
          case HeaderEnum::Referer:
            return "Referer";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }

/**
 */

#include <aws/lightsail/model/HeaderEnum.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace Lightsail
  {
    namespace Model
    {
      namespace HeaderEnumMapper
      {

        static const int Accept_HASH = HashingUtils::HashString("Accept");
        static const int Accept_Charset_HASH = HashingUtils::HashString("Accept-Charset");
        static const int Accept_Datetime_HASH = HashingUtils::HashString("Accept-Datetime");
        static const int Accept_Encoding_HASH = HashingUtils::HashString("Accept-Encoding");
        static const int Accept_Language_HASH = HashingUtils::HashString("Accept-Language");
        static const int Authorization_HASH = HashingUtils::HashString("Authorization");
        static const int CloudFront_Forwarded_Proto_HASH = HashingUtils::HashString("CloudFront-Forwarded-Proto");
        static const int CloudFront_Is_Desktop_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Desktop-Viewer");
        static const int CloudFront_Is_Mobile_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Mobile-Viewer");
        static const int CloudFront_Is_SmartTV_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-SmartTV-Viewer");
        static const int CloudFront_Is_Tablet_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Tablet-Viewer");
        static const int CloudFront_Viewer_Country_HASH = HashingUtils::HashString("CloudFront-Viewer-Country");
        static const int Host_HASH = HashingUtils::HashString("Host");
        static const int Origin_HASH = HashingUtils::HashString("Origin");
        static const int Referer_HASH = HashingUtils::HashString("Referer");

        HeaderEnum GetHeaderEnumForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == Accept_HASH)
          {
            return HeaderEnum::Accept;
          }
          else if (hashCode == Accept_Charset_HASH)
          {
            return HeaderEnum::Accept_Charset;
          }
          else if (hashCode == Accept_Datetime_HASH)
          {
            return HeaderEnum::Accept_Datetime;
          }
          else if (hashCode == Accept_Encoding_HASH)
          {
            return HeaderEnum::Accept_Encoding;
          }
          else if (hashCode == Accept_Language_HASH)
          {
            return HeaderEnum::Accept_Language;
          }
          else if (hashCode == Authorization_HASH)
          {
            return HeaderEnum::Authorization;
          }
          else if (hashCode == CloudFront_Forwarded_Proto_HASH)
          {
            return HeaderEnum::CloudFront_Forwarded_Proto;
          }
          else if (hashCode == CloudFront_Is_Desktop_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Desktop_Viewer;
          }
          else if (hashCode == CloudFront_Is_Mobile_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Mobile_Viewer;
          }
          else if (hashCode == CloudFront_Is_SmartTV_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_SmartTV_Viewer;
          }
          else if (hashCode == CloudFront_Is_Tablet_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Tablet_Viewer;
          }
          else if (hashCode == CloudFront_Viewer_Country_HASH)
          {
            return HeaderEnum::CloudFront_Viewer_Country;
          }
          else if (hashCode == Host_HASH)
          {
            return HeaderEnum::Host;
          }
          else if (hashCode == Origin_HASH)
          {
            return HeaderEnum::Origin;
          }
          else if (hashCode == Referer_HASH)
          {
            return HeaderEnum::Referer;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<HeaderEnum>(hashCode);
          }

          return HeaderEnum::NOT_SET;
        }

        Aws::String GetNameForHeaderEnum(HeaderEnum enumValue)
        {

        }

      } // namespace HeaderEnumMapper
    } // namespace Model
  } // namespace Lightsail
} // namespace Aws


/**
 */

#include <aws/lightsail/model/HeaderEnum.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace Lightsail
  {
    namespace Model
    {
      namespace HeaderEnumMapper
      {

        static const int Accept_HASH = HashingUtils::HashString("Accept");
        static const int Accept_Charset_HASH = HashingUtils::HashString("Accept-Charset");
        static const int Accept_Datetime_HASH = HashingUtils::HashString("Accept-Datetime");
        static const int Accept_Encoding_HASH = HashingUtils::HashString("Accept-Encoding");
        static const int Accept_Language_HASH = HashingUtils::HashString("Accept-Language");
        static const int Authorization_HASH = HashingUtils::HashString("Authorization");
        static const int CloudFront_Forwarded_Proto_HASH = HashingUtils::HashString("CloudFront-Forwarded-Proto");
        static const int CloudFront_Is_Desktop_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Desktop-Viewer");
        static const int CloudFront_Is_Mobile_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Mobile-Viewer");
        static const int CloudFront_Is_SmartTV_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-SmartTV-Viewer");
        static const int CloudFront_Is_Tablet_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Tablet-Viewer");
        static const int CloudFront_Viewer_Country_HASH = HashingUtils::HashString("CloudFront-Viewer-Country");
        static const int Host_HASH = HashingUtils::HashString("Host");
        static const int Origin_HASH = HashingUtils::HashString("Origin");
        static const int Referer_HASH = HashingUtils::HashString("Referer");

        HeaderEnum GetHeaderEnumForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == Accept_HASH)
          {
            return HeaderEnum::Accept;
          }
          else if (hashCode == Accept_Charset_HASH)
          {
            return HeaderEnum::Accept_Charset;
          }
          else if (hashCode == Accept_Datetime_HASH)
          {
            return HeaderEnum::Accept_Datetime;
          }
          else if (hashCode == Accept_Encoding_HASH)
          {
            return HeaderEnum::Accept_Encoding;
          }
          else if (hashCode == Accept_Language_HASH)
          {
            return HeaderEnum::Accept_Language;
          }
          else if (hashCode == Authorization_HASH)
          {
            return HeaderEnum::Authorization;
          }
          else if (hashCode == CloudFront_Forwarded_Proto_HASH)
          {
            return HeaderEnum::CloudFront_Forwarded_Proto;
          }
          else if (hashCode == CloudFront_Is_Desktop_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Desktop_Viewer;
          }
          else if (hashCode == CloudFront_Is_Mobile_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Mobile_Viewer;
          }
          else if (hashCode == CloudFront_Is_SmartTV_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_SmartTV_Viewer;
          }
          else if (hashCode == CloudFront_Is_Tablet_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Tablet_Viewer;
          }
          else if (hashCode == CloudFront_Viewer_Country_HASH)
          {
            return HeaderEnum::CloudFront_Viewer_Country;
          }
          else if (hashCode == Host_HASH)
          {
            return HeaderEnum::Host;
          }
          else if (hashCode == Origin_HASH)
          {
            return HeaderEnum::Origin;
          }
          else if (hashCode == Referer_HASH)
          {
            return HeaderEnum::Referer;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<HeaderEnum>(hashCode);
          }

          return HeaderEnum::NOT_SET;
        }

        Aws::String GetNameForHeaderEnum(HeaderEnum enumValue)
        {
          switch(enumValue)
          {
          case HeaderEnum::Accept:
            return "Accept";
          case HeaderEnum::Accept_Charset:
            return "Accept-Charset";
          case HeaderEnum::Accept_Datetime:
            return "Accept-Datetime";
          case HeaderEnum::Accept_Encoding:
            return "Accept-Encoding";
          case HeaderEnum::Accept_Language:
            return "Accept-Language";
          case HeaderEnum::Authorization:
            return "Authorization";
          case HeaderEnum::CloudFront_Forwarded_Proto:
            return "CloudFront-Forwarded-Proto";
          case HeaderEnum::CloudFront_Is_Desktop_Viewer:
            return "CloudFront-Is-Desktop-Viewer";
          case HeaderEnum::CloudFront_Is_Mobile_Viewer:
            return "CloudFront-Is-Mobile-Viewer";
          case HeaderEnum::CloudFront_Is_SmartTV_Viewer:
            return "CloudFront-Is-SmartTV-Viewer";
          case HeaderEnum::CloudFront_Is_Tablet_Viewer:
            return "CloudFront-Is-Tablet-Viewer";
          case HeaderEnum::CloudFront_Viewer_Country:
            return "CloudFront-Viewer-Country";
          case HeaderEnum::Host:
            return "Host";
          case HeaderEnum::Origin:
            return "Origin";
          case HeaderEnum::Referer:
            return "Referer";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }

      } // namespace HeaderEnumMapper
    } // namespace Model
  } // namespace Lightsail
} // namespace Aws


/**
 */

#include <aws/lightsail/model/HeaderEnum.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace Lightsail
  {
    namespace Model
    {
      namespace HeaderEnumMapper
      {

        static const int Accept_HASH = HashingUtils::HashString("Accept");
        static const int Accept_Charset_HASH = HashingUtils::HashString("Accept-Charset");
        static const int Accept_Datetime_HASH = HashingUtils::HashString("Accept-Datetime");
        static const int Accept_Encoding_HASH = HashingUtils::HashString("Accept-Encoding");
        static const int Accept_Language_HASH = HashingUtils::HashString("Accept-Language");
        static const int Authorization_HASH = HashingUtils::HashString("Authorization");
        static const int CloudFront_Forwarded_Proto_HASH = HashingUtils::HashString("CloudFront-Forwarded-Proto");
        static const int CloudFront_Is_Desktop_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Desktop-Viewer");
        static const int CloudFront_Is_Mobile_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Mobile-Viewer");
        static const int CloudFront_Is_SmartTV_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-SmartTV-Viewer");
        static const int CloudFront_Is_Tablet_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Tablet-Viewer");
        static const int CloudFront_Viewer_Country_HASH = HashingUtils::HashString("CloudFront-Viewer-Country");
        static const int Host_HASH = HashingUtils::HashString("Host");
        static const int Origin_HASH = HashingUtils::HashString("Origin");
        static const int Referer_HASH = HashingUtils::HashString("Referer");

        HeaderEnum GetHeaderEnumForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == Accept_HASH)
          {
            return HeaderEnum::Accept;
          }
          else if (hashCode == Accept_Charset_HASH)
          {
            return HeaderEnum::Accept_Charset;
          }
          else if (hashCode == Accept_Datetime_HASH)
          {
            return HeaderEnum::Accept_Datetime;
          }
          else if (hashCode == Accept_Encoding_HASH)
          {
            return HeaderEnum::Accept_Encoding;
          }
          else if (hashCode == Accept_Language_HASH)
          {
            return HeaderEnum::Accept_Language;
          }
          else if (hashCode == Authorization_HASH)
          {
            return HeaderEnum::Authorization;
          }
          else if (hashCode == CloudFront_Forwarded_Proto_HASH)
          {
            return HeaderEnum::CloudFront_Forwarded_Proto;
          }
          else if (hashCode == CloudFront_Is_Desktop_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Desktop_Viewer;
          }
          else if (hashCode == CloudFront_Is_Mobile_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Mobile_Viewer;
          }
          else if (hashCode == CloudFront_Is_SmartTV_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_SmartTV_Viewer;
          }
          else if (hashCode == CloudFront_Is_Tablet_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Tablet_Viewer;
          }
          else if (hashCode == CloudFront_Viewer_Country_HASH)
          {
            return HeaderEnum::CloudFront_Viewer_Country;
          }
          else if (hashCode == Host_HASH)
          {
            return HeaderEnum::Host;
          }
          else if (hashCode == Origin_HASH)
          {
            return HeaderEnum::Origin;
          }
          else if (hashCode == Referer_HASH)
          {
            return HeaderEnum::Referer;
          }
          EnumParseOverflowContainer* overflowContainer = Aws

          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<HeaderEnum>(hashCode);
          }

          return HeaderEnum::NOT_SET;
        }

        Aws::String GetNameForHeaderEnum(HeaderEnum enumValue)
        {
          switch(enumValue)
          {
          case HeaderEnum::Accept:
            return "Accept";
          case HeaderEnum::Accept_Charset:
            return "Accept-Charset";
          case HeaderEnum::Accept_Datetime:
            return "Accept-Datetime";
          case HeaderEnum::Accept_Encoding:
            return "Accept-Encoding";
          case HeaderEnum::Accept_Language:
            return "Accept-Language";
          case HeaderEnum::Authorization:
            return "Authorization";
          case HeaderEnum::CloudFront_Forwarded_Proto:
            return "CloudFront-Forwarded-Proto";
          case HeaderEnum::CloudFront_Is_Desktop_Viewer:
            return "CloudFront-Is-Desktop-Viewer";
          case HeaderEnum::CloudFront_Is_Mobile_Viewer:
            return "CloudFront-Is-Mobile-Viewer";
          case HeaderEnum::CloudFront_Is_SmartTV_Viewer:
            return "CloudFront-Is-SmartTV-Viewer";
          case HeaderEnum::CloudFront_Is_Tablet_Viewer:
            return "CloudFront-Is-Tablet-Viewer";
          case HeaderEnum::CloudFront_Viewer_Country:
            return "CloudFront-Viewer-Country";
          case HeaderEnum::Host:
            return "Host";
          case HeaderEnum::Origin:
            return "Origin";
          case HeaderEnum::Referer:
            return "Referer";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace HeaderEnumMapper
    } // namespace Model
  } // namespace Lightsail
} // namespace Aws


if (hashCode == Origin_HASH)
          {
            return HeaderEnum::Origin;
          }
          else if (hashCode == Referer_HASH)
          {
            return HeaderEnum::Referer;
          }

/**
 */

#include <aws/lightsail/model/HeaderEnum.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace Lightsail
  {
    namespace Model
    {
      namespace HeaderEnumMapper
      {

        static const int Accept_HASH = HashingUtils::HashString("Accept");
        static const int Accept_Charset_HASH = HashingUtils::HashString("Accept-Charset");
        static const int Accept_Datetime_HASH = HashingUtils::HashString("Accept-Datetime");
        static const int Accept_Encoding_HASH = HashingUtils::HashString("Accept-Encoding");
        static const int Accept_Language_HASH = HashingUtils::HashString("Accept-Language");
        static const int Authorization_HASH = HashingUtils::HashString("Authorization");
        static const int CloudFront_Forwarded_Proto_HASH = HashingUtils::HashString("CloudFront-Forwarded-Proto");
        static const int CloudFront_Is_Desktop_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Desktop-Viewer");
        static const int CloudFront_Is_Mobile_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Mobile-Viewer");
        static const int CloudFront_Is_SmartTV_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-SmartTV-Viewer");
        static const int CloudFront_Is_Tablet_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Tablet-Viewer");
        static const int CloudFront_Viewer_Country_HASH = HashingUtils::HashString("CloudFront-Viewer-Country");
        static const int Host_HASH = HashingUtils::HashString("Host");
        static const int Origin_HASH = HashingUtils::HashString("Origin");
        static const int Referer_HASH = HashingUtils::HashString("Referer");

        HeaderEnum GetHeaderEnumForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == Accept_HASH)
          {
            return HeaderEnum::Accept;
          }
          else if (hashCode == Accept_Charset_HASH)
          {
            return HeaderEnum::Accept_Charset;
          }
          else if (hashCode == Accept_Datetime_HASH)
          {
            return HeaderEnum::Accept_Datetime;
          }
          else if (hashCode == Accept_Encoding_HASH)
          {
            return HeaderEnum::Accept_Encoding;
          }
          else if (hashCode == Accept_Language_HASH)
          {
            return HeaderEnum::Accept_Language;
          }
          else if (hashCode == Authorization_HASH)
          {
            return HeaderEnum::Authorization;
          }
          else if (hashCode == CloudFront_Forwarded_Proto_HASH)
          {
            return HeaderEnum::CloudFront_Forwarded_Proto;
          }
          else if (hashCode == CloudFront_Is_Desktop_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Desktop_Viewer;
          }
          else if (hashCode == CloudFront_Is_Mobile_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Mobile_Viewer;
          }
          else if (hashCode == CloudFront_Is_SmartTV_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_SmartTV_Viewer;
          }
          else if (hashCode == CloudFront_Is_Tablet_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Tablet_Viewer;
          }
          else if (hashCode == CloudFront_Viewer_Country_HASH)
          {
            return HeaderEnum::CloudFront_Viewer_Country;
          }
          else if (hashCode == Host_HASH)
          {
            return HeaderEnum::Host;
          }
          else

          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<HeaderEnum>(hashCode);
          }

          return HeaderEnum::NOT_SET;
        }

        Aws::String GetNameForHeaderEnum(HeaderEnum enumValue)
        {
          switch(enumValue)
          {
          case HeaderEnum::Accept:
            return "Accept";
          case HeaderEnum::Accept_Charset:
            return "Accept-Charset";
          case HeaderEnum::Accept_Datetime:
            return "Accept-Datetime";
          case HeaderEnum::Accept_Encoding:
            return "Accept-Encoding";
          case HeaderEnum::Accept_Language:
            return "Accept-Language";
          case HeaderEnum::Authorization:
            return "Authorization";
          case HeaderEnum::CloudFront_Forwarded_Proto:
            return "CloudFront-Forwarded-Proto";
          case HeaderEnum::CloudFront_Is_Desktop_Viewer:
            return "CloudFront-Is-Desktop-Viewer";
          case HeaderEnum::CloudFront_Is_Mobile_Viewer:
            return "CloudFront-Is-Mobile-Viewer";
          case HeaderEnum::CloudFront_Is_SmartTV_Viewer:
            return "CloudFront-Is-SmartTV-Viewer";
          case HeaderEnum::CloudFront_Is_Tablet_Viewer:
            return "CloudFront-Is-Tablet-Viewer";
          case HeaderEnum::CloudFront_Viewer_Country:
            return "CloudFront-Viewer-Country";
          case HeaderEnum::Host:
            return "Host";
          case HeaderEnum::Origin:
            return "Origin";
          case HeaderEnum::Referer:
            return "Referer";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace HeaderEnumMapper
    } // namespace Model
  } // namespace Lightsail
} // namespace Aws


/**
 */

#include <aws/lightsail/model/HeaderEnum.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace Lightsail
  {
    namespace Model
    {
      namespace HeaderEnumMapper
      {

        static const int Accept_HASH = HashingUtils::HashString("Accept");
        static const int Accept_Charset_HASH = HashingUtils::HashString("Accept-Charset");
        static const int Accept_Datetime_HASH = HashingUtils::HashString("Accept-Datetime");
        static const int Accept_Encoding_HASH = HashingUtils::HashString("Accept-Encoding");
        static const int Accept_Language_HASH = HashingUtils::HashString("Accept-Language");
        static const int Authorization_HASH = HashingUtils::HashString("Authorization");
        static const int CloudFront_Forwarded_Proto_HASH = HashingUtils::HashString("CloudFront-Forwarded-Proto");
        static const int CloudFront_Is_Desktop_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Desktop-Viewer");
        static const int CloudFront_Is_Mobile_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Mobile-Viewer");
        static const int CloudFront_Is_SmartTV_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-SmartTV-Viewer");
        static const int CloudFront_Is_Tablet_Viewer_HASH = HashingUtils::HashString("CloudFront-Is-Tablet-Viewer");
        static const int CloudFront_Viewer_Country_HASH = HashingUtils::HashString("CloudFront-Viewer-Country");
        static const int Host_HASH = HashingUtils::HashString("Host");
        sta

tic const int Origin_HASH = HashingUtils::HashString("Origin");
        static const int Referer_HASH = HashingUtils::HashString("Referer");

        HeaderEnum GetHeaderEnumForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == Accept_HASH)
          {
            return HeaderEnum::Accept;
          }
          else if (hashCode == Accept_Charset_HASH)
          {
            return HeaderEnum::Accept_Charset;
          }
          else if (hashCode == Accept_Datetime_HASH)
          {
            return HeaderEnum::Accept_Datetime;
          }
          else if (hashCode == Accept_Encoding_HASH)
          {
            return HeaderEnum::Accept_Encoding;
          }
          else if (hashCode == Accept_Language_HASH)
          {
            return HeaderEnum::Accept_Language;
          }
          else if (hashCode == Authorization_HASH)
          {
            return HeaderEnum::Authorization;
          }
          else if (hashCode == CloudFront_Forwarded_Proto_HASH)
          {
            return HeaderEnum::CloudFront_Forwarded_Proto;
          }
          else if (hashCode == CloudFront_Is_Desktop_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Desktop_Viewer;
          }
          else if (hashCode == CloudFront_Is_Mobile_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Mobile_Viewer;
          }
          else if (hashCode == CloudFront_Is_SmartTV_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_SmartTV_Viewer;
          }
          else if (hashCode == CloudFront_Is_Tablet_Viewer_HASH)
          {
            return HeaderEnum::CloudFront_Is_Tablet_Viewer;
          }
          else if (hashCode == CloudFront_Viewer_Country_HASH)
          {
            return HeaderEnum::CloudFront_Viewer_Country;
          }
          else if (hashCode == Host_HASH)
          {
            return HeaderEnum::Host;
          }
          else if (hashCode == Origin_HASH)
          {
            return HeaderEnum::Origin;
          }
          else if (hashCode == Referer_HASH)
          {
            return HeaderEnum::Referer;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<HeaderEnum>(hashCode);
          }

          return HeaderEnum::NOT_SET;
        }

        Aws::String GetNameForHeaderEnum(HeaderEnum enumValue)
        {
          switch(enumValue)
          {
          case HeaderEnum::Accept:
            return "Accept";
          case HeaderEnum::Accept_Charset:
            return "Accept-Charset";
          case HeaderEnum::Accept_Datetime:
            return "Accept-Datetime";
          case HeaderEnum::Accept_Encoding:
            return "Accept-Encoding";
          case HeaderEnum::Accept_Language:
            return "Accept-Language";
          case HeaderEnum::Authorization:
            return "Authorization";
          case HeaderEnum::CloudFront_Forwarded_Proto:
            return "CloudFront-Forwarded-Proto";
          case HeaderEnum::CloudFront_Is_Desktop_Viewer:
            return "CloudFront-Is-Desktop-Viewer";
          case HeaderEnum::CloudFront_Is_Mobile_Viewer:
            return "CloudFront-Is-Mobile-Viewer";
          case HeaderEnum::CloudFront_Is_SmartTV_Viewer:
            return "CloudFront-Is-SmartTV-Viewer";
          case HeaderEnum::CloudFront_Is_Tablet_Viewer:
            return "CloudFront-Is-Tablet-Viewer";
          case HeaderEnum::CloudFront_Viewer_Country:
            return "CloudFront-Viewer-Country";
          case HeaderEnum::Host:
            return "Host";
          case HeaderEnum::Origin:
            return "Origin";
          case HeaderEnum::Referer:
            return "Referer";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace HeaderEnumMapper
    } // namespace Model
  } // namespace Lightsail
} // namespace Aws


cplus/github/kartikkukreja/blog-codes/src/Range Updates & Point Queries with BIT.cpp

#include <cstdio>
#include <cstring>
#define LSOne(S) (S & (-S))
using namespace std;

typedef long long ll;

// Fenwick tree
// Only the updates are stored. Original array entries are not
// stored and are assumed to be 0. If the original array entries
// are non-zero, we can store them in another array A and modify
// point query to return query(b) + A[b].
ll ft[10005];

// Array size
int N;

// Point query: Returns the value at position b in the array
ll query(int b)	{
	ll sum = 0;
	for (; b; b -= LSOne(b)) sum += ft[b];
	return sum;
}

// Point update: Adds v to the value at position k in the array

{
	for (; k <= N; k += LSOne(k)) ft[k] += v;
}

// Range update: Adds v to each element in [i...j] in the array
void range_update(int i, int j, int v)	{
	update(i, v);
	update(j + 1, -v);
}

int main()  {
	int T, U, Q, i, l, r, val;

	scanf("%d", &T);
	while (T--)	{
		scanf("%d %d", &N, &U);
		memset(ft, 0, (N+1) * sizeof(ll));

		// U -> no. of updates
		for (i = 0; i < U; i++)	{
			// l and r are zero-based indices
			scanf("%d %d %d", &l, &r, &val);
			range_update(l + 1, r + 1, val);
		}
		// Q -> no. of queries
		scanf("%d", &Q);
		for (i = 0; i < Q; i++)	{
			// val is zero-based index
			scanf("%d", &val);
			printf("%lld\n", query(val + 1));
		}
	}

    return 0;
}


{
	int T, U, Q, i, l, r, val;

	scanf("%d", &T);
	while (T--)	{
		scanf("%d %d", &N, &U);
		memset(ft, 0, (N+1) * sizeof(ll));

		// U -> no. of updates
		for (i = 0; i < U; i++)	{
			// l and r are zero-based indices
			scanf("%d %d %d", &l, &r, &val);
			range_update(l + 1, r + 1, val);
		}
		// Q -> no. of queries
		scanf("%d", &Q);
		for (i = 0; i < Q; i++)	{
			// val is zero-based index
			scanf("%d", &val);
			printf("%lld\n", query(val + 1));
		}
	}

    return 0;
}

#include <cstdio>
#include <cstring>
#define LSOne(S) (S & (-S))
using namespace std;

typedef long long ll;

// Fenwick tree
// Only the updates are stored. Original array entries are not
// stored and are assumed to be 0. If the original array entries
// are non-zero, we can store them in another array A and modify
// point query to return query(b) + A[b].
ll ft[10005];

// Array size
int N;

// Point query: Returns the value at position b in the array
ll query(int b)	{
	ll sum = 0;
	for (; b; b -= LSOne(b)) sum += ft[b];
	return sum;
}

// Point update: Adds v to the value at position k in the array
void update(int k, int v) {
	for (; k <= N; k += LSOne(k)) ft[k] += v;
}

// Range update: Adds v to each element in [i...j] in the array
void range_update(int i, int j, int v)	{
	update(i, v);
	update(j + 1, -v);
}

int main()


	scanf("%d", &T);
	while (T--)	{
		scanf("%d %d", &N, &U);
		memset(ft, 0, (N+1) * sizeof(ll));

		// U -> no. of updates
		for (i = 0; i < U; i++)	{
			// l and r are zero-based indices
			scanf("%d %d %d", &l, &r, &val);
			range_update(l + 1, r + 1, val);
		}
		// Q -> no. of queries
		scanf("%d", &Q);
		for (i = 0; i < Q; i++)	{
			// val is zero-based index
			scanf("%d", &val);
			printf("%lld\n", query(val + 1));
		}
	}

    return 0;
}


scanf("%d", &T);
	while (T--)	{
		scanf("%d %d", &N, &U);
		memset(ft, 0, (N+1) * sizeof(ll));

		// U -> no. of updates
		for (i = 0; i < U; i++)	{
			// l and r are zero-based indices
			scanf("%d %d %d", &l, &r, &val);
			range_update(l + 1, r + 1, val);
		}
		// Q -> no. of queries
		scanf("%d", &Q);
		for (i = 0; i < Q; i++)	{
			// val is zero-based index
			scanf("%d", &val);
			printf("%lld\n", query(val + 1));
		}
	}

#include <cstdio>
#include <cstring>
#define LSOne(S) (S & (-S))
using namespace std;

typedef long long ll;

// Fenwick tree
// Only the updates are stored. Original array entries are not
// stored and are assumed to be 0. If the original array entries
// are non-zero, we can store them in another array A and modify
// point query to return query(b) + A[b].
ll ft[10005];

// Array size
int N;

// Point query: Returns the value at position b in the array
ll query(int b)	{
	ll sum = 0;
	for (; b; b -= LSOne(b)) sum += ft[b];
	return sum;
}

// Point update: Adds v to the value at position k in the array
void update(int k, int v) {
	for (; k <= N; k += LSOne(k)) ft[k] += v;
}

// Range update: Adds v to each element in [i...j] in the array
void range_update(int i, int j, int v)	{
	update(i, v);
	update(j + 1, -v);
}

int main()  {
	int T, U, Q, i, l, r, val;


#include <cstdio>
#include <cstring>
#define LSOne(S) (S & (-S))
using namespace std;

typedef long long ll;

// Fenwick tree
// Only the updates are stored. Original array entries are not
// stored and are assumed to be 0. If the original array entries
// are non-zero, we can store them in another array A and modify
// point query to return query(b) + A[b].
ll ft[10005];

// Array size
int N;

// Point query: Returns the value at position b in the array
ll query(int b)	{
	ll sum = 0;
	for (; b; b -= LSOne(b)) sum += ft[b];
	return sum;
}

// Point update: Adds v to the value at position k in the array
void update(int k, int v) {
	for (; k <= N; k += LSOne(k)) ft[k] += v;
}

// Range update: Adds v to each element in [i...j] in the array
void range_update(int i, int j, int v)	{
	update(i, v);
	update(j + 1, -v);
}

int main()  {
	int T, U, Q, i, l, r, val;

	scanf("%d", &T);
	while (T--)	{
		scanf("%d %d", &N, &U);
		memset(ft, 0, (N+1) * sizeof(ll));

		// U -> no. of updates
		for (i = 0; i < U; i++)	{
			// l and r are zero-based indices
			scanf("%d %d %d", &l, &r, &val);
			range_update(l + 1, r + 1, val);
		}
		// Q -> no. of queries
		scanf("%d", &Q);
		for (i = 0; i < Q; i++)	{
			// val is zero-based index
			scanf("%d", &val);
			printf("%lld\n", query(val + 1));
		}
	}


#include <cstdio>
#include <cstring>
#define LSOne(S) (S & (-S))
using namespace std;

typedef long long ll;

// Fenwick tree
// Only the updates are stored. Original array entries are not
// stored and are assumed to be 0. If the original array entries
// are non-zero, we can store them in another array A and modify
// point query to return query(b) + A[b].
ll ft[10005];

// Array size
int N;

// Point query: Returns the value at position b in the array
ll query(int b)	{
	ll sum = 0;
	for (; b; b -= LSOne(b)) sum += ft[b];
	return sum;
}

// Point update: Adds v to the value at position k in the array
void update(int k, int v) {
	for (; k <= N; k += LSOne(k)) ft[k] += v;
}

// Range update: Adds v to each element in [i...j] in the array
void range_update(int i, int j, int v)	{
	update(i, v);
	update(j + 1, -v);
}

int main()  {
	int T, U, Q, i, l, r, val;

	scanf("%d", &T);
	while (T--)	{
		scanf("%d %d", &N, &U);
		memset(ft, 0, (N+1) * sizeof(ll));

		// U -> no. of updates
		for (i = 0; i < U; i++)	{
			// l and r are zero-based indices
			scanf("%d %d %d", &l, &r, &val);
			range_update(l + 1, r + 1, val);
		}
		// Q -> no. of queries
		scanf("%d", &Q);
		for (i = 0; i < Q; i++)	{
			// val is zero-based index
			scanf("%d", &val);
			printf("%lld\n", query(val + 1));
		}
	}

    re


void range_update(int i, int j, int v)	{
	update(i, v);
	update(j + 1, -v);
}

#include <cstdio>
#include <cstring>
#define LSOne(S) (S & (-S))
using namespace std;

typedef long long ll;

// Fenwick tree
// Only the updates are stored. Original array entries are not
// stored and are assumed to be 0. If the original array entries
// are non-zero, we can store them in another array A and modify
// point query to return query(b) + A[b].
ll ft[10005];

// Array size
int N;

// Point query: Returns the value at position b in the array
ll query(int b)	{
	ll sum = 0;
	for (; b; b -= LSOne(b)) sum += ft[b];
	return sum;
}

// Point update: Adds v to the value at position k in the array
void update(int k, int v) {
	for (; k <= N; k += LSOne(k)) ft[k] += v;
}

// Range update: Adds v to each element in [i...j] in the array

int main()  {
	int T, U, Q, i, l, r, val;

	scanf("%d", &T);
	while (T--)	{
		scanf("%d %d", &N, &U);
		memset(ft, 0, (N+1) * sizeof(ll));

		// U -> no. of updates
		for (i = 0; i < U; i++)	{
			// l and r are zero-based indices
			scanf("%d %d %d", &l, &r, &val);
			range_update(l + 1, r + 1, val);
		}
		// Q -> no. of queries
		scanf("%d", &Q);
		for (i = 0; i < Q; i++)	{
			// val is zero-based index
			scanf("%d", &val);
			printf("%lld\n", query(val + 1));
		}
	}

    return 0;
}


for (i = 0; i < Q; i++)	{
			// val is zero-based index
			scanf("%d", &val);
			printf("%lld\n", query(val + 1));
		}

#include <cstdio>
#include <cstring>
#define LSOne(S) (S & (-S))
using namespace std;

typedef long long ll;

// Fenwick tree
// Only the updates are stored. Original array entries are not
// stored and are assumed to be 0. If the original array entries
// are non-zero, we can store them in another array A and modify
// point query to return query(b) + A[b].
ll ft[10005];

// Array size
int N;

// Point query: Returns the value at position b in the array
ll query(int b)	{
	ll sum = 0;
	for (; b; b -= LSOne(b)) sum += ft[b];
	return sum;
}

// Point update: Adds v to the value at position k in the array
void update(int k, int v) {
	for (; k <= N; k += LSOne(k)) ft[k] += v;
}

// Range update: Adds v to each element in [i...j] in the array
void range_update(int i, int j, int v)	{
	update(i, v);
	update(j + 1, -v);
}

int main()  {
	int T, U, Q, i, l, r, val;

	scanf("%d", &T);
	while (T--)	{
		scanf("%d %d", &N, &U);
		memset(ft, 0, (N+1) * sizeof(ll));

		// U -> no. of updates
		for (i = 0; i < U; i++)	{
			// l and r are zero-based indices
			scanf("%d %d %d", &l, &r, &val);
			range_update(l + 1, r + 1, val);
		}
		// Q -> no. of queries
		scanf("%d", &Q);


while (T--)	{
		scanf("%d %d", &N, &U);
		memset(ft, 0, (N+1) * sizeof(ll));

		// U -> no. of updates
		for (i = 0; i < U; i++)	{
			// l and r are zero-based indices
			scanf("%d %d %d", &l, &r, &val);
			range_update(l + 1, r + 1, val);
		}
		// Q -> no. of queries
		scanf("%d", &Q);
		for (i = 0; i < Q; i++)	{
			// val is zero-based index
			scanf("%d", &val);
			printf("%lld\n", query(val + 1));
		}
	}

#include <cstdio>
#include <cstring>
#define LSOne(S) (S & (-S))
using namespace std;

typedef long long ll;

// Fenwick tree
// Only the updates are stored. Original array entries are not
// stored and are assumed to be 0. If the original array entries
// are non-zero, we can store them in another array A and modify
// point query to return query(b) + A[b].
ll ft[10005];

// Array size
int N;

// Point query: Returns the value at position b in the array
ll query(int b)	{
	ll sum = 0;
	for (; b; b -= LSOne(b)) sum += ft[b];
	return sum;
}

// Point update: Adds v to the value at position k in the array
void update(int k, int v) {
	for (; k <= N; k += LSOne(k)) ft[k] += v;
}

// Range update: Adds v to each element in [i...j] in the array
void range_update(int i, int j, int v)	{
	update(i, v);
	update(j + 1, -v);
}

int main()  {
	int T, U, Q, i, l, r, val;

	scanf("%d", &T);


#include <cstdio>
#include <cstring>
#define LSOne(S) (S & (-S))
using namespace std;

typedef long long ll;

// Fenwick tree
// Only the updates are stored. Original array entries are not
// stored and are assumed to be 0. If the original array entries
// are non-zero, we can store them in another array A and modify
// point query to return query(b) + A[b].
ll ft[10005];

// Array size
int N;

// Point query: Returns the value at positi

on b in the array
ll query(int b)	{
	ll sum = 0;
	for (; b; b -= LSOne(b)) sum += ft[b];
	return sum;
}

// Point update: Adds v to the value at position k in the array
void update(int k, int v) {
	for (; k <= N; k += LSOne(k)) ft[k] += v;
}

// Range update: Adds v to each element in [i...j] in the array
void range_update(int i, int j, int v)	{
	update(i, v);
	update(j + 1, -v);
}

int main()  {
	int T, U, Q, i, l, r, val;

	scanf("%d", &T);
	while (T--)	{
		scanf("%d %d", &N, &U);
		memset(ft, 0, (N+1) * sizeof(ll));

		// U -> no. of updates
		for (i = 0; i < U; i++)	{
			// l and r are zero-based indices
			scanf("%d %d %d", &l, &r, &val);
			range_update(l + 1, r + 1, val);
		}
		// Q -> no. of queries
		scanf("%d", &Q);
		for (i = 0; i < Q; i++)	{
			// val is zero-based index
			scanf("%d", &val);
			printf("%lld\n", query(val + 1));
		}
	}

    return 0;
}