Jump to content
  • 0

Script to automatically calculate offset


Question

Posted

Hi guys, for example I have address "A" and "B" I want my script to automatically calculate offset and how should I do it?, Please help me, thanks

13 answers to this question

Recommended Posts

  • 0
Posted

offset is just a distance between two address, so if you want to get the offset between addess A and B it will be just B - A

  • 0
Posted
  On 5/12/2023 at 8:33 PM, MAARS said:

offset chỉ là khoảng cách giữa hai địa chỉ, vì vậy nếu bạn muốn lấy offset giữa addess A và B thì nó sẽ chỉ là B - A

Expand  

I just for example Address "A" & "B" 

  • 0
Posted

Maybe if you give more information about what you tryna do i could provide you some code

  • 0
Posted

Thanks bro, I mean I want to create a script that automatically calculates offset for example from address "A" to "B" is 0x123 the script will calculate automatically

  • 0
Posted

Ok, but where the address come from ? do you want a prompt for the address ? or the addresses are picked from a file ? from the saveList ? from the search result ?
You need to be more specific in what you need 

  • 0
Posted
  On 5/12/2023 at 11:52 PM, MAARS said:

Ok, nhưng địa chỉ đến từ đâu? bạn có muốn nhắc địa chỉ không? hoặc các địa chỉ được chọn từ một tập tin? từ saveList? từ kết quả tìm kiếm?
Bạn cần phải cụ thể hơn trong những gì bạn cần 

Expand  

Yes please give me example "A" and "B"

  • 0
Posted (edited)

I think there is a little misunderstanding, i was hopping you to explain to me, what you are trying to do, cause just saying calculate the offset betwen two address i could just respond with
 

local addressA = 0x10000
local addressB = 0x250000
local offsetAB = addressB - addressA

print (offsetAB)

so as you can see, you need to be more precise in your demand

Edited by MAARS
  • 0
Posted
  On 5/13/2023 at 2:35 AM, MAARS said:

Tôi nghĩ rằng có một chút hiểu lầm, tôi đã hy vọng bạn giải thích cho tôi, bạn đang cố gắng làm gì, vì chỉ cần nói tính toán phần bù giữa hai địa chỉ, tôi có thể trả lời với
 

 
 

như bạn có thể thấy, bạn cần chính xác hơn trong nhu cầu của mình

Expand  

Thanks bro, that's exactly what I meant

  • 0
Posted
  On 5/13/2023 at 12:54 PM, AMIYA said:

Tại sao bạn không sử dụng tính toán offset?

Expand  

I want the script to automatically calculate the offset to edit the arm of my next project

  On 5/13/2023 at 2:35 AM, MAARS said:

Tôi nghĩ rằng có một chút hiểu lầm, tôi đã hy vọng bạn giải thích cho tôi, bạn đang cố gắng làm gì, vì chỉ cần nói tính toán phần bù giữa hai địa chỉ, tôi có thể trả lời với
 

 
 

như bạn có thể thấy, bạn cần chính xác hơn trong nhu cầu của mình

Expand  

Hi bro, Can we calculate the offset as shown in the picture?

Screenshot_20230513-200623_Zombie Cubes 2.jpg

  • 0
Posted
  On 5/13/2023 at 1:23 PM, LTC said:

I want the script to automatically calculate the offset to edit the arm of my next project

Hi bro, Can we calculate the offset as shown in the picture?

Screenshot_20230513-200623_Zombie Cubes 2.jpg

Expand  

I know you want 

Use script that take many time lol 

For calculate offset

  • 0
Posted

The subtraction operation is fast.
Run this script and see how long it takes to run.


Usually it takes a lot of time to search, you need to search HEX numbers, or use chainer

How to use chainer

 

local time = {}
local addressA = 0xA7B26F2C
local addressB = 0xA7B2A774
time[1] = os.clock()
local offsetAB = addressB - addressA
time[2] = os.clock()-time[1]
local t = string.format("%.3f",time[2])
gg.alert('OffsetAB is : ' ..string.format("0x%2X",offsetAB) ..'\nRuntime: ' ..t ..' seconds')

 

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.