Example #1
0
int LuaOpenDumpFile(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->OpenDumpFile((PSTR)lua.checkintegerL(2)));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #2
0
	void kaguya_return_userdata_measure(nonius::chronometer& meter) {
		kaguya::State lua;
		lua.setErrorHandler(kaguya_panic_throw);

		lua["f"].setFunction(basic_return);
		auto code = repeated_code("b = f(i)");
		meter.measure([&]() {
			lua(code.c_str());
		});
	}
Example #3
0
int LuaFlushCallbacks(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->FlushCallbacks());
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #4
0
int LuaExitDispatch(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->ExitDispatch((IDebugClient *)Client));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #5
0
int LuaSetKernelConnectionOptions(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->SetKernelConnectionOptions(lua.checkstringL(2)));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #6
0
int LuaStartServer(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->StartServer(lua.checkstringL(3)));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #7
0
int LuaWriteDumpFile(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->WriteDumpFile(lua.checkstringL(2), lua.checkintegerL(3)));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #8
0
int LuaAttachKernel(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->AttachKernel((ULONG)lua.checkintegerL(2), lua.checkstringL(3)));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #9
0
int LuaTerminateProcesses(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->TerminateProcesses());
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #10
0
int LuaSetOutputLinePrefix(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->SetOutputLinePrefix(lua.checkstringL(2)));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #11
0
int LuaSetProcessOptions(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->SetProcessOptions(lua.checkintegerL(2)));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #12
0
int LuaConnectSession(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->ConnectSession(lua.checkintegerL(2), lua.checkintegerL(3)));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #13
0
int LuaSetOtherOutputMask(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->SetOtherOutputMask((IDebugClient *)Client, lua.checkintegerL(2)));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #14
0
int LuaOutputRegisters(lua_State *L)
{
	LuaAPI lua(L);
	DbgRegist *Reg = (DbgRegist *)lua.CheckUserPointer(1, str::utLuaDebugRegisters);

	RSLT(Reg->OutputRegisters(lua.checkintegerL(2), lua.checkintegerL(3)));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #15
0
int LuaConnectProcessServer(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	ULONG64 srv;
	RSLT(Client->ConnectProcessServer(lua.checkstringL(2), &srv));
	SOK() ? lua.Push(srv) : lua.Push(false);

	return 1;
}
Example #16
0
	int isFileExist(lua_State* L)
	{
		OR::LUAStack lua(L);
		TString fn;
		lua>>fn;
		if(::IsFileExist(fn))
			lua<<1;
		else
			lua<<0;
		return 1;
	}
Example #17
0
int LuaGetProcessOptions(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	ULONG options;
	RSLT(Client->GetProcessOptions(&options));
	SOK() ? lua.pushinteger(options) : lua.Push(false);

	return 1;
}
Example #18
0
int LuaGetOutputCallbacks(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	PDEBUG_EVENT_CALLBACKS pDEC;
	RSLT(Client->GetEventCallbacks(&pDEC));
	SOK() ? lua.NewUserPointer(pDEC, str::utLuaEventCallback) : lua.Push(false);

	return 1;
}
Example #19
0
int LuaGetOtherOutputMask(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	ULONG mask;
	RSLT(Client->GetOtherOutputMask((IDebugClient *)Client, &mask));
	SOK() ? lua.pushinteger(mask) : lua.Push(false);

	return 1;
}
Example #20
0
int LuaGetExitCode(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	ULONG ec;
	RSLT(Client->GetExitCode(&ec));
	SOK() ? lua.pushinteger(ec) : lua.Push(false);

	return 1;
}
Example #21
0
int LuaSetInputCallbacks(lua_State *L)
{
	LuaAPI lua(L);
	DbgClient *Client = (DbgClient *)lua.CheckUserPointer(1, str::utLuaDebugClient);

	RSLT(Client->SetInputCallbacks((IDebugInputCallbacks *)
		lua.CheckUserPointer(2, str::utLuaInputCallback)));
	SOK() ? lua.Push(true) : lua.Push(false);

	return 1;
}
Example #22
0
int LuaGetValue(lua_State *L)
{
	LuaAPI lua(L);
	DbgRegist *Reg = (DbgRegist *)lua.CheckUserPointer(1, str::utLuaDebugRegisters);

	DEBUG_VALUE dv;
	RSLT(Reg->GetValue(lua.checkintegerL(2), &dv));
	SOK() ? VALUE2Table(L, &dv) : lua.Push(false);

	return 1;
}
Example #23
0
int LuaGetNumberRegisters(lua_State *L)
{
	LuaAPI lua(L);
	DbgRegist *Reg = (DbgRegist *)lua.CheckUserPointer(1, str::utLuaDebugRegisters);

	ULONG n;
	RSLT(Reg->GetNumberRegisters(&n));
	SOK() ? lua.pushinteger(n) : lua.Push(false);

	return 1;
}
Example #24
0
int LuaGetStackOffset(lua_State *L)
{
	LuaAPI lua(L);
	DbgRegist *Reg = (DbgRegist *)lua.CheckUserPointer(1, str::utLuaDebugRegisters);

	ULONG64 offset;
	RSLT(Reg->GetStackOffset(&offset));
	SOK() ? lua.pushinteger(offset) : lua.Push(false);

	return 1;
}
Example #25
0
int LuaGetIndexByName(lua_State *L)
{
	LuaAPI lua(L);
	DbgRegist *Reg = (DbgRegist *)lua.CheckUserPointer(1, str::utLuaDebugRegisters);

	ULONG i;
	RSLT(Reg->GetIndexByName(lua.checkstringL(2), &i));
	SOK() ? lua.pushinteger(i) : lua.Push(false);

	return 1;
}
Example #26
0
void CScriptEngine::setup_auto_load()
{
    luaL_newmetatable(lua(), "XRAY_AutoLoadMetaTable");
    lua_pushstring(lua(), "__index");
    lua_pushcfunction(lua(), auto_load);
    lua_settable(lua(), -3);
    lua_pushstring(lua(), "_G");
    lua_gettable(lua(), LUA_GLOBALSINDEX);
    luaL_getmetatable(lua(), "XRAY_AutoLoadMetaTable");
    lua_setmetatable(lua(), -2);
    //. ??????????
    // lua_settop							(lua(),-0);
}
Example #27
0
// matrix object を複製し、新たなmatrix object を生成する
int
CKLBLuaLibMatrix::luaCopyMatrix(lua_State * L)
{
	CLuaState lua(L);
	MATRIX * pMat = getMatPointer(lua, 1);
	MATRIX * pNew = newMatrix();

	for(int i = 0; i < 16; i++) pNew->m[i] = pMat->m[i];
	lua.retPointer(pNew);
	return 1;
}
Example #28
0
int
CKLBLuaLibFONT::luaFontRelease(lua_State * L)
{
	CLuaState lua(L);
	int argc = lua.numArgs();
	for(int i = 1; i <= argc; i++) {
		FONTOBJ * fontobj = (FONTOBJ *)lua.getPointer(i);
		remove_font(fontobj);
		lua.retNil();
	}
	return argc;
}
Example #29
0
	void kaguya_c_function_measure(nonius::chronometer& meter) {
		kaguya::State lua;
		lua.setErrorHandler(kaguya_panic_throw);

		lua["f"].setFunction(basic_call);
		auto code = repeated_code("f(i)");
		meter.measure([&]() {
			if (!lua(code)) {
				lua_error(lua.state());
			}
		});
	}
Example #30
0
// matrix object を破棄する
int
CKLBLuaLibMatrix::luaDeleteMatrix(lua_State * L)
{
	CLuaState lua(L);
	int argc = lua.numArgs();
	for(int i = 1; i <=  argc; i++) {
		MATRIX * pMat = getMatPointer(lua, i);
		delMatrix(pMat);
		lua.retNil();
	}
	return argc;
}