Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 08:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Need Help [Media.PK2 Edit]

Discussion on Need Help [Media.PK2 Edit] within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2009
Posts: 19
Received Thanks: 2
Need Help [Media.PK2 Edit]

Hi,
I wanna write a mediapatcher with vb.net...

I can wrote IP adresses in media.pk2 but silkroad crashes...

Please help me.

Code:
Dim fs As New FileStream("C:\Program Files (x86)\Silkroad\Media.pk2", FileMode.Open, FileAccess.Write)
        Dim br As New BinaryWriter(fs)
        Dim bytes() As Byte
        'IP1
        br.BaseStream.Position = "&H25F24011"
        bytes = System.Text.Encoding.Default.GetBytes(ip1.Text)
        br.Write(bytes)
        If ip1.TextLength <> 16 Then
            For i = 1 To 16 - ip1.TextLength
                Dim tmp As Byte = &H0
                br.Write(tmp)
            Next
        End If
        'IP2
        br.BaseStream.Position = "&H25F24026"
        bytes = System.Text.Encoding.Default.GetBytes(ip2.Text)
        br.Write(bytes)
        If ip2.TextLength <> 16 Then
            For i = 1 To 16 - ip2.TextLength
                Dim tmp As Byte = &H0
                br.Write(tmp)
            Next
        End If
        'IP3
        br.BaseStream.Position = "&H25F2403B"
        bytes = System.Text.Encoding.Default.GetBytes(ip3.Text)
        br.Write(bytes)
        If ip3.TextLength <> 16 Then
            For i = 1 To 16 - ip3.TextLength
                Dim tmp As Byte = &H0
                br.Write(tmp)
            Next
        End If
        'IP4
        br.BaseStream.Position = "&H25F24050"
        bytes = System.Text.Encoding.Default.GetBytes(ip4.Text)
        br.Write(bytes)
        If ip4.TextLength <> 16 Then
            For i = 1 To 16 - ip4.TextLength
                Dim tmp As Byte = &H0
                br.Write(tmp)
            Next
        End If
        'port
        br.BaseStream.Position = "&H25F24461"
        bytes = System.Text.Encoding.Default.GetBytes(port.Text)
        br.Write(bytes)
        If ip4.TextLength <> 5 Then
            For i = 1 To 5 - port.TextLength
                Dim tmp As Byte = &H0
                br.Write(tmp)
            Next
        End If
        br.Close()
        fs.Close()
lvszoc is offline  
Old 06/02/2011, 20:13   #2
 
bootdisk's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 134
Received Thanks: 41
I don't know c# but...

Code:
br.BaseStream.Position = "&H25F24050"
are you sure about those offsets?
where did you get those? are the actual offsets?
bootdisk is offline  
Old 06/02/2011, 20:31   #3
 
elite*gold: 0
Join Date: May 2009
Posts: 19
Received Thanks: 2


ps: and this code is vb.net :P not c#
lvszoc is offline  
Old 06/03/2011, 02:38   #4
 
bootdisk's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 134
Received Thanks: 41
first of all you should update the lengths if the new string is greater or smaller than the actual one.
second, previous to those strings there is a DWORD telling how many bytes will follow (haven't checked... I just saw your picture).

3rd... it might be vb.net but for me they all look the same xD

Edit: what about if it's greater? it will start writing other files present in the pk2 file.
So it's like:
DWORD <-- size of the string
BYTES <-- null terminated string
bootdisk is offline  
Old 06/03/2011, 21:05   #5
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by bootdisk View Post
3rd... it might be vb.net but for me they all look the same xD
Noob. xD

VB.Net is English-like syntax.
C# is C-like syntax.
lesderid is offline  
Reply


Similar Threads Similar Threads
Media.PK2 Edit
12/31/2023 - Silkroad Online - 8 Replies
I need the newst media.pk2 edit (skill bar, mp\hp, unique etc.) thnx.
[Media Pk Edit] How to edit wellcome message [Question]
06/18/2012 - Silkroad Online - 5 Replies
Hello guys how i can edit wellcome message ? can anyone tell or post program or how to do it or link if there is posted on ePVP Thanks, Ficko5
need help with media.pk2 edit
10/05/2009 - Silkroad Online - 4 Replies
can some one make a pk2 edit for me plz?? if so, i want: unique monster map new hp and mp bar new main bar and if u want u can add a new intro.. BUT i dont want the crap with blue zerk new items and a 60 horse is a pegasus. thats only much bull crap.. thx
i need help to edit media pk2
05/31/2009 - SRO Private Server - 0 Replies
i want know how i can change the sjsro launcher pic ?
need help for media pk2 edit
03/21/2009 - SRO Private Server - 1 Replies
i want to do a media with 10 degree but i dont know wich progs i need or how to change degrees pls help me



All times are GMT +1. The time now is 08:29.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.