Jump to content
  • 2

Question

Posted

Hi, Is it possible to hook field offsets using lua? If its possible, can u send a template? Thanks. 

Recommended Posts

  • 0
Posted (edited)

There is a way to hook via gg

 

Here's an example you can modify based on your desired function 

function O_dinitial_search(class)
		gg.setRanges(gg.REGION_OTHER);
		gg.searchNumber(":" .. class, gg.TYPE_BYTE);
		count = gg.getResultsCount();
		if (count == 0) then
		else
			Refiner = gg.getResults(1);
			gg.refineNumber(Refiner[1].value, gg.TYPE_BYTE);
			count = gg.getResultsCount();
			val = gg.getResults(count);
			gg.addListItems(val);
		end
	end
	function CA_pointer_search()
		gg.clearResults();
		gg.setRanges(gg.REGION_C_ALLOC);
		gg.loadResults(gg.getListItems());
		gg.searchPointer(0);
		count = gg.getResultsCount();
		vel = gg.getResults(count);
		gg.clearList();
		gg.addListItems(vel);
	end
	function CA_apply_offset()
    tanker = 0xfffffffffffffff0
    local copy = false
    local l = gg.getListItems()
    if not copy then gg.removeListItems(l) end
    for i, v in ipairs(l) do
      v.address = v.address + tanker
      if copy then v.name = v.name..' #2' end
    end
    gg.addListItems(l)
	end
	function A_base_value()
		gg.setRanges(gg.REGION_ANONYMOUS);
		gg.loadResults(gg.getListItems());
		gg.clearList();
		gg.searchPointer(0);
		count = gg.getResultsCount();
		tel = gg.getResults(count);
		gg.addListItems(tel);
	end
	function A_base_accuracy()
	  gg.setRanges(gg.REGION_ANONYMOUS | gg.REGION_C_ALLOC)
		gg.loadResults(gg.getListItems());
		gg.clearList();
		gg.searchPointer(0);
		count = gg.getResultsCount();
		kol = gg.getResults(count);
		i = 1;
		h = {};
		while (i - 1) < count do
			h[i] = {};
			h[i].address = kol[i].value;
			h[i].flags = 32;
			i = i + 1;
		end
		gg.addListItems(h);
	end
	function A_user_given_offset(_offset, type)
		local _offset = load("return " .. _offset)();
		local old_save_list = gg.getListItems();
		for i, v in ipairs(old_save_list) do
			v.address = v.address + _offset;
			v.flags = type;
		end
		gg.clearResults();
		gg.loadResults(old_save_list);
	end
	function findClassPointer(class)
		gg.clearResults();
		gg.clearList();
		O_dinitial_search(class);
		CA_pointer_search();
		CA_apply_offset();
		A_base_value();
		A_base_accuracy();
	end
	function hackOffset(_offset, type, value)
		A_user_given_offset(_offset, type);
		gg.refineNumber("0~40", type);
		gg.getResults(99999999);
		gg.editAll(value, type);
	end



 

hooking with class pointer via game guardian.txt

Edited by brubbribo
  • 0
Posted
4 hours ago, Xaviesz said:

[ @AMIYA ]
---
Ah great, another short answer and most importantly, vague.
image.thumb.png.bfdbc20aeca2c401e79d95be617b198b.pngimage.thumb.png.c5d45282c76e4ea3d9fc97e38ff113b1.pngimage.thumb.png.a680d50503e7fbd47244afd03002470c.png
---

https://gameguardian.net/forum/profile/1373768-ltc/

It has a good skill converting hook cpp to lua , and it works perfectly , 

Class to class or etc

Sorry he name lethichin

4 hours ago, Xaviesz said:

[ @AMIYA ]
---
Ah great, another short answer and most importantly, vague.
image.thumb.png.bfdbc20aeca2c401e79d95be617b198b.pngimage.thumb.png.c5d45282c76e4ea3d9fc97e38ff113b1.pngimage.thumb.png.a680d50503e7fbd47244afd03002470c.png
---

You eye Your eyes are fine right?

  • 0
Posted

[ @AMIYA ]
---

Quote

You eye Your eyes are fine right?

Google keeps autocorrect the searches and that's what I found on it.
---

Quote

Sorry he name lethichin

Right, you should have mention it "LTC" to be searchable.
---

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.