Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 07.07.2007, 20:36   #1
humordwarf
Архивный участник
 
Join Date: Feb 2006
Posts: 453
Default [SHARE] server crash new exploit fix *UPDATED*

*UPDATED*

inside l2server.exe we have code (dont ask me how i got it):
Code:
Log->Add(2,L"[%s][%d] user[%s] failed to ride.  no collar[%d]",  CharName, CorallID);
so, as u see, here is mistake, first arg should be string, second - number, 3rd - string, 4th - number (4 parameters)
but in args there is TWO only, last two args Log->Add gets from stack garbage...

someone got the way how to invoke this error,
and server, when try to format this text crashes

Code:
IOThread [0][875] (ahehe):  void IOThread_common(void *arglist) -> CUserSocket::OnRead -> IconAction -> User::IconAction() -> void User::Ride(CPet* pStrider) -> CLog::Add -> CLog::AddV -> Log::AddV - vswprintf_s
how to fix:

in any hex editor find UNICODE text
"[%s][%d] user[%s] failed to ride. no collar[%d]"
and change to
"user[%s] failed to ride. no collar[%d]"
edit: and dont forget to put 0000 after text as zero char (null termitnated string rule)

thats all, folks
humordwarf is offline  
Old 07.07.2007, 20:43   #2
radio
Архивный участник
 
Join Date: Feb 2006
Posts: 685
Default

[rus]корейские программисты - конина блядская

зы. тоже чтоль расшарить чё-нить....

а для буржуинов пора делать кнопки "thanks" и "good job"
[/rus]

[eng] good job, man [/eng]
radio is offline  
Old 07.07.2007, 20:56   #3
ZeniMax
Архивный участник
 
Join Date: May 2006
Posts: 209
Default

awesome share, big thanks humordwarf, cash for you! (Oh where is the cash system?? :/ )

Edit: Humordwarf we must fix that too?
[.%.s.].[.%.d.]. .u.s.e.r.[.%.s.]. .f.a.i.l.e.d. .t.o. .u.n.r.i.d.e... . .n.o. .c.o.l.l.a.r.[.%.d.]
to
[.%.s.].[.%.d.]. .u.s.e.r.[.%.s.]. .f.a.i.l.e.d. .t.o. .u.n.r.i.d.e... . .n.o. .c.o.l.l.a.r.[.%.s.]
ZeniMax is offline  
Old 07.07.2007, 21:07   #4
humordwarf
Архивный участник
 
Join Date: Feb 2006
Posts: 453
Default

Quote:
Originally Posted by ZeniMax View Post
Edit: Humordwarf we must fix that too?
[.%.s.].[.%.d.]. .u.s.e.r.[.%.s.]. .f.a.i.l.e.d. .t.o. .u.n.r.i.d.e... . .n.o. .c.o.l.l.a.r.[.%.d.]
to
[.%.s.].[.%.d.]. .u.s.e.r.[.%.s.]. .f.a.i.l.e.d. .t.o. .u.n.r.i.d.e... . .n.o. .c.o.l.l.a.r.[.%.s.]
no
unride thing pass correct parameters to log
there is call: Log->Add(2,L"[%s][%d] user[%s] failed to unride. no collar[%d]",_T(__FILE__),__LINE__,CharName,CollarID);
all fine here
humordwarf is offline  
Old 07.07.2007, 21:14   #5
ZeniMax
Архивный участник
 
Join Date: May 2006
Posts: 209
Default

Ok thanks humordward.
ZeniMax is offline  
Old 07.07.2007, 21:32   #6
Forcer
Архивный участник
 
Join Date: Apr 2006
Posts: 554
Default

Great, thanks.
[rus]
Хумор, малацца!
Меня иногда эта пиздень доставала.
По поводу корейцев - всеми руками согласен xD
[/rus]
Forcer is offline  
Old 07.07.2007, 21:36   #7
Kenjiro
Архивный участник
 
Join Date: Apr 2006
Posts: 120
Default

Big thanks, hat from head _o_
Kenjiro is offline  
Old 07.07.2007, 21:47   #8
humordwarf
Архивный участник
 
Join Date: Feb 2006
Posts: 453
Default

*UPDATE*
sorry ppl, mistake
confused with params order (first %s, then %d)
new text should be "user[%s] failed to ride. no collar[%d]"
(updated 1st post)
humordwarf is offline  
Old 08.07.2007, 07:48   #9
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default

Please, tell me,
1) what fix it? Same what do Amped "BlockRide=true" ?
2) maybe someone can do hex-text file for me?
and main question
This is only l2server error unicode message. Why fix it is a new message? So strange for me. Because so easy.
HF is offline  
Old 08.07.2007, 09:12   #10
Ra1n0
Архивный участник
 
Join Date: Feb 2007
Posts: 139
Default

Quote:
This is only l2server error unicode message. Why fix it is a new message? So strange for me. Because so easy.
error got from function vswprintf_s because not enough parameters
Ra1n0 is offline  
Old 08.07.2007, 09:55   #11
humordwarf
Архивный участник
 
Join Date: Feb 2006
Posts: 453
Default

Quote:
Originally Posted by HF View Post
Please, tell me,
1) what fix it? Same what do Amped "BlockRide=true" ?
2) maybe someone can do hex-text file for me?
and main question
This is only l2server error unicode message. Why fix it is a new message? So strange for me. Because so easy.
1) see 1st message. BlockRide is not same
2) each ppl may have different exe's, why do not try urself? its not hard

main: if you know c++ even little... look on printf-like functions, printf("%s","text") gets from stack address of "text", then read from address, chars and output to console.... but if you try use printf("%s",123) - u'll get exception (crash). like access violation read from address 123 (printf tries read text from address 123)
so look again at first message, there is "%s%d%s%d", but on stack there only one string and only one number... second string address (3rd arg) undefined on stack
humordwarf is offline  
Old 08.07.2007, 15:09   #12
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default

Quote:
Originally Posted by humordwarf View Post
main: if you know c++ even little... look on printf-like functions, printf("%s","text") gets from stack address of "text", then read from address, chars and output to console.... but if you try use printf("%s",123) - u'll get exception (crash). like access violation read from address 123 (printf tries read text from address 123)
so look again at first message, there is "%s%d%s%d", but on stack there only one string and only one number... second string address (3rd arg) undefined on stack
Ah! I understood! No more params for function calling!
Big thanks.

Question two.
What power for this bug? It's only server error? or maybe it server error on bug using? Bug cause server crash?
This is only for information.
HF is offline  
Old 08.07.2007, 15:44   #13
humordwarf
Архивный участник
 
Join Date: Feb 2006
Posts: 453
Default

Quote:
Originally Posted by HF View Post
What power for this bug? It's only server error? or maybe it server error on bug using? Bug cause server crash?
oh... relax...
as soon as u get that crash log, u'll know what to do...

i repeat, someone got the way, special or not, cheater or not, not matter... matter - it happens.
humordwarf is offline  
Old 08.07.2007, 15:46   #14
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

Quote:
Originally Posted by humordwarf View Post
oh... relax...
as soon as u get that crash log, u'll know what to do...

i repeat, someone got the way, special or not, cheater or not, not matter... matter - it happens.
Fixed, thx HD.
FidoW is offline  
Old 08.07.2007, 22:51   #15
kanziguy
Архивный участник
 
Join Date: May 2007
Posts: 12
Default

fixed file upload please please
kanziguy is offline  
Old 08.07.2007, 22:59   #16
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

kanziguy use an hex editor to correct it...
m4rk is offline  
Old 08.07.2007, 23:07   #17
Osito2Dancer
Архивный участник
 
Join Date: Mar 2005
Posts: 442
Default

Quote:
Originally Posted by FidoW View Post
Fixed, thx HD.
Which editor can i use to fix this? I tried UltraEdit 32, but cant find the damned line.

Could you teach me how to?
Osito2Dancer is offline  
Old 08.07.2007, 23:23   #18
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

You can use any editor, you just don't know how to search... Like Humordwarf said
Quote:
Originally Posted by Humordwarf
in any hex editor find UNICODE text
Code:
5b 00 25 00 73 00 5d 00 5b 00 25 00 64 00 5d 00 20 00 75 00 73 00 65 00 72 00 5b 00 25 00 73 00 5d 00 20 00 66 00 61 00 69 00 6c 00 65 00 64 00 20 00 74 00 6f 00 20 00 72 00 69 00 64 00 65 00 2e 00 20 00 20 00 6e 00 6f 00 20 00 63 00 6f 00 6c 00 6c 00 61 00 72 00 5b 00 25 00 64 00 5d
m4rk is offline  
Old 08.07.2007, 23:31   #19
emanuel
Архивный участник
 
Join Date: May 2007
Posts: 86
Default

Nice... big thx.
emanuel is offline  
Old 09.07.2007, 03:35   #20
petre1980
Архивный участник
 
Join Date: Jan 2007
Posts: 45
Default

Thx HD, i have made the corections but i don't know what you mean by that:
"edit: and dont forget to put 0000 after text as zero char (null termitnated string rule)"
petre1980 is offline  
Old 09.07.2007, 04:36   #21
Ra1n0
Архивный участник
 
Join Date: Feb 2007
Posts: 139
Default

Quote:
Thx HD, i have made the corections but i don't know what you mean by that:
"edit: and dont forget to put 0000 after text as zero char (null termitnated string rule)"
rtfm about unicode strings..

unicode strings look in hex like this
20 00 6e 00 6f 00 20 00 63 00 6f 00 6c 00 6c 00 61 00 72 00 5b 00 25 00 64 00 5d 00 00 00

after unicode string he must ended '\x00\x00", 00 00 its zero char

in ASCII strings 1 symbol =1 byte... ex. "a" in ASCII = 61
in UNICODE 1 symbol = 2 bytes.. ex. "a" in UNICODE = 61 00
Ra1n0 is offline  
Old 09.07.2007, 04:46   #22
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default

So. Short fix - 4 byte. I do easy
"5b 00 25 00 73 00 5d" [%s]
->
"5b 00 20 00 20 00 5d" [ ]

Line lenght without changes, bug fixed.
HF is offline  
Old 09.07.2007, 05:04   #23
Ra1n0
Архивный участник
 
Join Date: Feb 2007
Posts: 139
Default

some corrections..this is 4 byte fix)
"5b 00 25 00 73 00 5d 00" [%s]
->
"5b 00 20 00 20 00 5d 00" [ ]
and
"5b 00 25 00 64 00 5d 00" [%d]
->
"5b 00 20 00 20 00 5d 00" [ ]

= "[ ][ ] user[%s] failed to ride. no collar[%d]"
Ra1n0 is offline  
Old 02.08.2007, 14:49   #24
:: Eru ::
Архивный участник
 
Join Date: May 2007
Posts: 23
Default

Thanks! Fixed.

Anyway, I'm still being attacked...I have to test everything again
:: Eru :: is offline  
Old 11.08.2007, 06:21   #25
GmZenBrasil
Архивный участник
 
Join Date: Jan 2007
Posts: 30
Default

thanks ^^
GmZenBrasil 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 14:56.