I posted this originally on Underground section but due to the files getting leaked, I think more people will find this tool usefull if it is posted on a public section.
--------------------
For those with the original serverfiles, I've made a tool for convert IP strings into the right int values that have to be added on the _PrivilegedIP table. If you don't know for what you need this tool, ignore this thread because that means you don't need it.
I've tested it with the Gateway server of the leaked serverfiles and it reads all the random IP's I've tested, so it's working fine. Still my coding skills are not that great, so there could be bugs, specially on the 127 IP range, so report them if you find it (post the IP that you have entered and caused the bug).
wow it's great but if u find it before we post this table
PHP Code:
USE [SRO_VT_ACCOUNT] GO /****** Object: Table [dbo].[_PrivilegedIP] Script Date: 09/13/2011 08:35:06 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO drop table _PrivilegedIP CREATE TABLE [dbo].[_PrivilegedIP]( [IP1] [tinyint] NOT NULL, [IP2] [tinyint] NOT NULL, [IP3] [tinyint] NOT NULL, [IP4] [tinyint] NOT NULL, [IP5] [tinyint] NOT NULL, [IP6] [tinyint] NOT NULL, [IP7] [tinyint] NOT NULL, [IP8] [tinyint] NOT NULL ) ON [PRIMARY] GO
Hello, i have gm account problems, with can you give me its says me when i convert; -710235816 this is for _PriveLegendIP table its 710.235.816? or 7.102.35.816? idont know can you give me this point ? and sorry for my bad english i learn ^_^ only french
Seen this one here and decided to create the pure SQL way for the hell of it
Includes also the emulated function "explode" - the procedure can be used practically with e.g. cursors and dynamic SQL since a table ExplodeResultset will be misused as an "array".
Make sure to run the stuff on SRO_VT_ACCOUNT to convert the IP's however you want.
Code:
USE SRO_VT_ACCOUNT
GO
CREATE PROCEDURE [dbo].[Explode_String] /* by Caipi */
@String varchar(max),
@Delimiter varchar(255)
as
SET NOCOUNT ON;
IF exists (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'ExplodeResultset')
BEGIN
DROP TABLE ExplodeResultset;
END
CREATE TABLE ExplodeResultset (Num INT IDENTITY, String varchar(max) NULL);
Declare @TempS varchar(max) = '';
WHILE (LEN(@String) != 0)
BEGIN
SET @TempS = SUBSTRING(@String,0,CHARINDEX(@Delimiter,@String));
IF (CHARINDEX(@Delimiter,@String)=0)
BEGIN
INSERT INTO ExplodeResultset SELECT @String
BREAK;
END
ELSE
BEGIN
INSERT INTO ExplodeResultset SELECT @TempS
END
SET @String = RIGHT(@String,LEN(@String)-(LEN(@TempS)+LEN(@Delimiter)))
END
SET NOCOUNT OFF;
SELECT * FROM ExplodeResultset
Code:
USE SRO_VT_ACCOUNT
GO
CREATE PROCEDURE _ConvertIP /* by Caipi */
@String varchar(16)
as
SET NOCOUNT ON;
Declare @conIP INT,
@1 INT,
@2 INT,
@3 INT,
@4 INT;
exec Explode_String @String,'.'
SELECT @1 = String FROM ExplodeResultset WHERE Num = 1;
SELECT @2 = String FROM ExplodeResultset WHERE Num = 2;
SELECT @3 = String FROM ExplodeResultset WHERE Num = 3;
SELECT @4 = String FROM ExplodeResultset WHERE Num = 4;
exec @conIP = make_ip @1,@2,@3,@4
SET NOCOUNT OFF;
SELECT @conIP as ConvertedIP
An example as rrbutot stated regarding to the integer -710235816, conversion to IP + vice versa.
Code:
USE SRO_VT_ACCOUNT
Declare @conIP INT = -710235816,
@IP varchar(128) = '';
exec @IP = split_ip @conIP;
SELECT @IP as IP
exec _ConvertIP @IP