• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Decoding ip

nielu

New Member
Joined
Jun 16, 2007
Messages
15
Reaction score
0
How can i decode ip from table players ? I have noticed that someone is recently visiting some pages that he should not visit ;) I know that 192.168.1.65 menas 1157736640 in table players but i have no idea what means 83.45.230.12 :)
 
if you want to do it in LUA for some reason this function does the trick
Code:
function findIP(IP)

	local ip=string.format("%X",IP)
	local string1=string.sub(ip,7,8)
	local string2=string.sub(ip,5,6)
	local string3=string.sub(ip,3,4)
	local string4=string.sub(ip,1,2)
	local decip=tonumber(string1, 16).."."..tonumber(string2, 16).."."..tonumber(string3, 16).."."..tonumber(string4, 16)

	return decip
end

it basically converts the ip from database into hex, then reverses the order of the bytes then puts them back together and converts back to decimal
:)
 
Back
Top