/* * * * * * * * * * * * * * * * 
 * 	 ______     __  __     ______     __  __     ______     ______     __  __    
 *	/\  __ \   /\ \/\ \   /\  == \   /\ \_\ \   /\  __ \   /\  ___\   /\ \/ /    
 *	\ \ \/\ \  \ \ \_\ \  \ \  __<   \ \  __ \  \ \  __ \  \ \ \____  \ \  _"-.  
 *	 \ \_____\  \ \_____\  \ \_____\  \ \_\ \_\  \ \_\ \_\  \ \_____\  \ \_\ \_\ 
 *	  \/_____/   \/_____/   \/_____/   \/_/\/_/   \/_/\/_/   \/_____/   \/_/\/_/ 
 *
 *  - Version : 3L
 *  - By Oubliette
 * * * * * * * * * * * * * * * */

#include "oubhack_exports.h"
#include "oubhack.h"

CLuaExports::CLuaExports(){

	// GetProcAddress all of Garry's exported functions
	this->m_pLuaLoadBuffer = (luaL_loadbufferFunc)GetProcAddress( GetModuleHandle("lua_shared.dll"), "luaL_loadbuffer" );

}

int CLuaExports::luaL_loadbuffer( lua_State* L, const char* ccCode, size_t sSize, const char* ccName ){

	if ( ((BYTE*)this->m_pLuaLoadBuffer)[0] == 0xE9 ){
		oubhack->Error("CLuaExports[ 1 ] : 0xE9 bytes found"); return 0;
	}

	return this->m_pLuaLoadBuffer( L, ccCode, sSize, ccName );

}
