Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 03.02.2006, 18:39   #1
Validator
Архивный участник
 
Join Date: Dec 2005
Posts: 88
Default [SHARE] Wrong class exploite

My first share. Anyway thx to PP community.

modify lin_CreateChar
Code:
CREATE PROCEDURE [dbo].[lin_CreateChar]  
(  
@char_name NVARCHAR(15),  
@account_name NVARCHAR(15),  
@account_id INT,  
@pledge_id INT,  
@builder  TINYINT,  
@gender TINYINT,  
@race  TINYINT,  
@class  TINYINT,  
@world  SMALLINT,  
@xloc  INT,  
@yloc  INT,  
@zloc  INT,  
@HP  FLOAT,  
@MP  FLOAT,  
@SP  INT,  
@Exp  INT,  
@Lev  TINYINT,  
@align  SMALLINT,  
@PK  INT,  
@Duel  INT,  
@PKPardon  INT,  
@FaceIndex   INT = 0,  
@HairShapeIndex  INT = 0,  
@HairColorIndex  INT = 0  
)  
AS  
  
SET NOCOUNT ON  
  
SET @char_name = RTRIM(@char_name)  
DECLARE @char_id int  
SET @char_id = 0  
   
IF @char_name LIKE N' '   
BEGIN  
 RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)  
 RETURN -1  
END

IF @race = 4 AND @class <> 53   
BEGIN  
 RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)  
 RETURN -1  
END

IF (@race = 3) AND (@class < 44 or @class >49)
BEGIN  
 RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)  
 RETURN -1  
END

IF (@race = 0) AND (@class >10)
BEGIN  
 RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)  
 RETURN -1  
END   
 
IF (@race = 1) AND (@class < 18 or @class >25)
BEGIN  
 RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)  
 RETURN -1  
END

IF (@race = 2) AND (@class < 31 or @class >38)
BEGIN  
 RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)  
 RETURN -1  
END


-- check user_prohibit   
if exists(select char_name from user_prohibit (nolock) where char_name = @char_name)  
begin  
 RAISERROR ('Character name is prohibited: name = [%s]', 16, 1, @char_name)  
 RETURN -1   
end  
  
declare @user_prohibit_word nvarchar(15)  
select top 1 @user_prohibit_word = words from user_prohibit_word (nolock) where PATINDEX('%' + words + '%', @char_name) > 0   
if @user_prohibit_word is not null  
begin  
 RAISERROR ('Character name has prohibited word: name = [%s], word[%s]', 16, 1, @char_name, @user_prohibit_word)  
 RETURN -1   
end  
  
-- check reserved name  
declare @reserved_name nvarchar(15)  
declare @reserved_account_id int  
select top 1 @reserved_name = char_name, @reserved_account_id = account_id from user_name_reserved (nolock) where used = 0 and char_name = @char_name  
if not @reserved_name is null  
begin  
 if not @reserved_account_id = @account_id  
 begin  
  RAISERROR ('Character name is reserved by other player: name = [%s]', 16, 1, @char_name)  
  RETURN -1  
 end  
end  
  
-- insert user_data  
INSERT INTO user_data   
( char_name, account_name, account_id, pledge_id, builder, gender, race, class,   
world, xloc, yloc, zloc, HP, MP, max_hp, max_mp, SP, Exp, Lev, align, PK, PKpardon, duel, create_date, face_index, hair_shape_index, hair_color_index )  
VALUES  
(@char_name, @account_name, @account_id, @pledge_id, @builder, @gender, @race, @class,   
@world, @xloc, @yloc, @zloc, @HP, @MP, @HP, @MP, @SP, @Exp, @Lev, @align, @PK, @Duel, @PKPardon, GETDATE(), @FaceIndex, @HairShapeIndex, @HairColorIndex)  
  
IF (@@error = 0)  
BEGIN  
 SET @char_id = @@IDENTITY  
 INSERT INTO quest (char_id) VALUES (@char_id)  
END  
  
SELECT @char_id  
  
if @char_id > 0  
begin  
 -- make user_history  
 exec lin_InsertUserHistory @char_name, @char_id, 1, @account_name, NULL  
 if not @reserved_name is null  
  update user_name_reserved set used = 1 where char_name = @reserved_name  
end
GO
This stop dwarf-mage undying chars.
Validator is offline  
Old 03.02.2006, 19:10   #2
Thalone
Архивный участник
 
Join Date: Feb 2005
Posts: 134
Default

want to explain how you would do this exploit? if you dont want to post send it in pm
Thalone is offline  
Old 03.02.2006, 19:28   #3
Truffe
Архивный участник
 
Join Date: May 2005
Posts: 944
Default

By using L2Walker, as it allows to create dwarven mages...
Truffe is offline  
Old 03.02.2006, 20:12   #4
elcapo
Архивный участник
 
Join Date: Mar 2005
Posts: 107
Default

send me pm with the xploit.
this changes fix the problem?
elcapo is offline  
Old 03.02.2006, 20:30   #5
Truffe
Архивный участник
 
Join Date: May 2005
Posts: 944
Default

Quote:
Originally Posted by Thruth
By using L2Walker, as it allows to create dwarven mages...
Are you blind ? :|

Jeez....
Truffe is offline  
Old 03.02.2006, 21:27   #6
hr
Архивный участник
 
Join Date: Jun 2005
Posts: 285
Default

Validator, imho better make so, cause we are creating only 1st professions, plus better set @builder to 0:
Code:
---anti-DWARF-MAGE-block

--human
IF @race=0 and @class not in (0,10)   
BEGIN  
 RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)  
 RETURN -1  
END  

--elf
IF @race=1 and @class not in (18,25)   
BEGIN  
 RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)  
 RETURN -1  
END 

--delf
IF @race=2 and @class not in (31,38)   
BEGIN  
 RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)  
 RETURN -1  
END 

--orc
IF @race=3 and @class not in (44,49)   
BEGIN  
 RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)  
 RETURN -1  
END 
--dwarf
IF @race=4 and @class not in (53)   
BEGIN  
 RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)  
 RETURN -1  
END 

SET @builder=0

---eof-DWARF-MAGE
hr is offline  
Old 04.02.2006, 06:35   #7
Validator
Архивный участник
 
Join Date: Dec 2005
Posts: 88
Default

[rus]Да я думал об этом. Только толку ноль, потому что если убрать с builder_account запись, никто не может сделать билдера, кроме прямого запроса в базу, так что это безполезно)[/rus]
Validator is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 20:10.