Jump to content
GustavoHMA

[Help] LuaSQL.dll

Recommended Posts

7 hours ago, KONG said:

do you need help compiling, injecting, or calling?

To call the function within the lua and injection.

Edited by GustavoHMA

Share this post


Link to post
Share on other sites

There are multiple ways of injecting a DLL.
There is the Codecave method which uses LoadLibrary&GetProcAddress,
but you can use programs like: CFF Explorer to eliminate the need to use those methods.
These tools requires a "dllexport" method, so in dllmain.cpp
the function: __declspec(dllexport) void __cdecl ExportedFunction() {}
is present so these tools can inject DLL. 

Screenshot_130.png

And to use the functions via LUA, I will ask @Wrexor to upload his documentation for using the interface
because I dont have it. Kudos to Miha for the picture hehe :)

 

EDIT: I just found this: maybe it'll work I havent tried. but it must be something like this

SQL_CONNECT = 'connect'
SQL_QUERY = 'query'
SQL_FETCH = 'fetch'
SQL_HOST = '127.0.0.1,3707'
SQL_UID = 'sa'
SQL_PWD = 'Y87dc#$98'

local connect, handle = LuaSQL(SQL_CONNECT, SQL_HOST, SQL_UID, SQL_PWD)
if(connect == 1) then
	print('Connection Established')
	local SqlText = "select * from accountserver.dbo.account_login where name = 'admin'"
	local query, stmt = LuaSQL(SQL_QUERY, handle, SqlText)
	
	if(query == 1) then
		print('Query success, fetching...')
		local row = LuaSQL(SQL_FETCH, handle, stmt)
		for i,v in pairs(row) do
			print(i..'=>'..v)
		end
	else
		print('Query Failed => '..query)
	end
else
	print('Connection Failed')
end

QueryAsyn(SQL_HOST, SQL_UID, SQL_PWD, 'UPDATE TradeDB.dbo.AccountInfo SET money = 99 WHERE accName = \'admin\'')

 

  • Like 1

kong.png

a2.png

Share this post


Link to post
Share on other sites

Maybe function pointers mismatch offsets. To verify this, make sure

you see: "DLL Loaded!" at the top of GS console.

If visible, Need to go back to debugger to collect offsets.
If not visible, DLL not injected/hooked.


kong.png

a2.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...