Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Priston Tale Updater server creator.

Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
For reasons of copyleft I am posting this updater server maker .

It was created with the informations in this thread and some additional help from Gregoo and Moons.

It's purpose is to create the file structure that you host on your web server if you want to redirect the official update programs (psupdate.exe) to your server so you can roll out updates the way they do.

LunarPT where keen to do that, and had already made the necessary modifications to psupdate.exe, but couldn't quite get the right formatting for the files server side... most importantly the setfile.lst file.

In order to use this tool, you will need (known as LhA on the Amiga where it really took off, or LZH on DOS)... you should have it installed in some location in your system search path. What does that mean? Start a command line and enter "path" you will see the response "PATH=" and a long list of fully qualified directories separated by semi-colons (";") any one of those will do for you, but I would recommend whatever your equivalent of C:\Windows is... to be sure, from the same command line, you can enter "Echo %SystemRoot%" and it will tell you. You can also type "%SystemRoot%" in the address bar of any explorer browser window for it to change to that directory, and then you can just drop Lha.exe there.

This isn't production quality. It has a number of flaws, and I'm not releasing the source till everything works as it's supposed to. Right now, the option to choose your input and output directories doesn't work at all, and I notice some of the "/" parameters are playing up again. But you can consider it a functional beta. Core functionality works, some options perform in unexpected ways and extended functionality is designed but not yet implemented.

As it stands, it will take an installation from the the present working directory, and produce the directory structure you need on your web server in a new "updates" folder in the parent of the present wording directory. The term "present working directory" refers to what ever comes before the ">" on the command prompt. So if the prompt is "C:\PT\MyClientFiles>" then "C:\PT\MyClientFiles" is the present working directory. Windows will always pass a "present working directory" to any program it runs, but it's difficult to tell, until you run the program, if it's going to pass the folder the executable you are running is located in or the %SystemRoot% path. The old Windows .pif files used to let you manually set it, but this isn't a DOS tool... it's a Win32 command line program, so it gets a .lnk not a .pif.

There is a maximum file count of 20013 files... this is enforced in MakeUps.exe, and I'm sure you can hack it out, but the reason it's there is that the psupdate.exe I tried would crash horribly if you try to include more files in the updater than that. (they don't allocate enough memory to hold the indexes of more files)

You can use it's output to start working on patching up your own updater, since I understand Lunar have no intention of releasing theirs, and I see no reason why they should. Their changes are very specific for their server and you are as well off working directly from an original... if you can.:eek:tt1:

More important for me is that this updater is mine. (With all due credit to RaGEZONE and especially Gregoo, Moons) I worked hard on it and wrote it up developing and learning as I went. If anybody releases something similar from here on out, it's probably based on my work.

The date stamp on this post is my proof that on this date, I had created a workable (if beta) solution for this issue. I didn't work it all out myself without help... I had help. But I pulled it all together and made something that does the job.

Once bugs are ironed out I will release the source... but as LunarPT are the initiators they will get advance copies of each improvement to use as they choose. But by and by I will update this release for everyone.
 

Attachments

You must be registered for see attachments list
Last edited:
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
1) Place lha.exe in search path
2) Place MakeUps.exe in the directory BELOW your game files
3) CD into your game files (where game.exe is)
4) type "..\MakeUps"

For more information run "MakeUps -h" or read the readme.txt provided:eek:tt1:

Most of the options are to do with how detailed you want the on-screen output, but BRIEF mode will only update the setfile.lst and setdir.lst without re-creating all the archives.

Then upload to a webserver, and hack the psupdate.exe to point to the URL which houses setfile.lst and setdir.lst. That part belongs to Moons, and I have no right to share his efforts on that, though having seen how he did it, I have re-created my own updater... it's not hard if you can Olly, and I know you can Bruno. :wink:
 
Last edited:
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
A RaGEZONE user has asked me to make a simpler explanation of how to use this, and I don't like to share information with just one person. But I will keep their identity to myself. (since this may be why they contacted me in PM)

This is basically what I told them.
The project was written to complement Lunar PTs psupdate.exe, as they had already modified the official one to point to their web-server (ftp server will also do, I think) and since I don't have permission to re-distribute their modified updater, I have to assume you know how to do that part your self.

I would probably have the full client installed on my local PC where I'm testing and developing it. Use MakeUps.exe to create the files and structure which should live on the web server and FTP them to my web server. (or attach my local drive on the Remote Desktop and just drag and drop them from that, since many people host their website from their PT Dedi)

So... if you drop lha.exe into %SystemRoot% (usually C:\Windows\System32) and MakeUps.exe into your client folder and just run it, it will make everything you need on your web server in a directory alongside your client folder called updates. (provided there are not more than 20,013 files in your client) That sounds a lot, but it's not hard to do, and Lunar had more than that to begin with.

What do I mean by "along side"? Well, if PT is installed in "C:\Priston Tale" then it will make "C:\updates" and fill that with your update files. If PT is installed in "D:\Games\PT" then it will make "D:\Games\updates" and fill that.

A major problem is that if you just do that, then MakeUps.exe will add it's self to the update set, and then your updater will distribute it to all your players. They don't really want it, so I recommend you maybe put MakeUps.exe in your %SystemRoot% too, and run it from the command line after CDing to your PT client folder.​
I will also add, as I tried doing the very basic method with my client, to remind myself. (but knowing full well that my client has more than 12,0013 files in it:lol:) That has also reminded me that Unicode file names are an absolute no-no.

I have some files with Japanses names in my client folder, which are left over from a jPT asset strip. It can't archive those on my PC, because my ANSI code page is not Japanese... and so it has no way to interpret those as 8-bit characters, and replaces each character with a question mark ("?") and then fails to find the file ??.txt or whatever.
 
Last edited:
Initiate Mage
Joined
Aug 9, 2011
Messages
1
Reaction score
0
what exactly dose this do?

---------- Post added at 12:12 AM ---------- Previous post was at 12:09 AM ----------

also when i click 'Wait to download' nothing happens.. i click it over and over again but nothing happens :S
 
Moderator
Staff member
Moderator
Joined
Feb 22, 2008
Messages
2,404
Reaction score
724
are you crazy? this is the tool to get your pstaleupdate working, it was said one thousand times... read carefully.

--- bump ---

Just bumping, but I cant use this tool, every option I try throws an error...

---edit

argh, I cant use this >.< lha.exe is already placed at windows folder but I cant understand how those parameters works

I'm doing with -v parameter, and this error occurs:

Error creating C:\Users\Leandro\Desktop\client full\..\updates\files\weapons!

I had to hack the exe to make it work lol
 
Last edited by a moderator:
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
Try EZMode. XD
Place LhA.exe and MakeUps.exe in %SystemRoot%\System32 (or elsewhere in $path$) then place your PT Client in C:\PTInstall open a command prompt in C:\PTInstall and run...
Code:
C:\PTInstall>MakeUps
Wait, some considerable time. :(: You will find your updater files in C:\updates.

--- EDIT ---
Oh yes! To be safe, make sure C:\updates doesn't already exist.
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
i thought it would generate a setfile.lst.
Yes, it does. Both setfile.lst and setdir.lst.
pstaleupdate uses this file right? I already have all the UPW files, but I dont know what to do with them.
Actually, the updater is usually psupdate.exe, pstale.exe is the launcher / client configuration. (edits ptreg.rgx etc.) psupdate.exe is usually launched from pstale.exe, but some clients force it to complete successfully from game.exe before game.exe will go any further. ^_^

The updater should get a page like http://myserver.me/update.asp?type=0and that page will be something like
Code:
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"></head><body>UPDATE_COUNTER=0
UPDATE_VERSION=1873
UPDATE_PATH=http://127.0.0.1/Update/1873/UpdateFiles
UPDATE_INFO=http://127.0.0.1/Update/1873/setfile.lst
UPDATE_DIRINFO=http://127.0.0.1/Update/1873/setdir.lst
</body></html>
So your server will be hosting files in the virtual hosted folder /1873/UpdateFiles (all the stuff in C:\updates\files) and setfile.lst and setdir.lst will be in the virtual folder /1873. (I think Gregoo, Moons and I where just using http://hostname/update.asp and http://hostname/files directory for the files, hence the folder name)

Different official updaters seem to use slightly different API sets, or just format the strings very oddly, I'm not sure. But in many of them, I believe you can actually make http://myserver.me/update.asp?type=0 become file://C|/updates/update.html and then make a similar plain, static html file that tells the updater to get all the files from the local file-system, via appropriate URLs. Whether you can use UNCs, like \\mypc\pt-updates\update.html I'm not sure... again, it depends on the API levels used in the updater. I certainly remember setting one of them up to collect update files from something like ftp://192.168.1.2/updates.txt. The files that page pointed to where also on the same FTP server... not that I can remember what program I used to host the FTP service now.
 
Last edited:
Moderator
Staff member
Moderator
Joined
Feb 22, 2008
Messages
2,404
Reaction score
724
Now its working. can we see the source code of it?


in pstaleupdate, the http strings are "encrypted". We can see here, the routine that decrypts them.
Code:
00411060  /$ 8B5424 08      MOV EDX,DWORD PTR SS:[ESP+8]
00411064  |. 53             PUSH EBX
00411065  |. 56             PUSH ESI
00411066  |. 8B7424 14      MOV ESI,DWORD PTR SS:[ESP+14]
0041106A  |. 8BCE           MOV ECX,ESI
0041106C  |. 8BD9           MOV EBX,ECX
0041106E  |. C1E9 02        SHR ECX,2
00411071  |. 57             PUSH EDI
00411072  |. 33C0           XOR EAX,EAX
00411074  |. 8BFA           MOV EDI,EDX
00411076  |. F3:AB          REP STOS DWORD PTR ES:[EDI]
00411078  |. 8BCB           MOV ECX,EBX
0041107A  |. 83E1 03        AND ECX,3
0041107D  |. 85F6           TEST ESI,ESI
0041107F  |. F3:AA          REP STOS BYTE PTR ES:[EDI]
00411081  |. 7E 18          JLE SHORT psupdate.0041109B
00411083  |. 8B4C24 10      MOV ECX,DWORD PTR SS:[ESP+10]
00411087  |. 8BC2           MOV EAX,EDX
00411089  |. 2BCA           SUB ECX,EDX
0041108B  |. EB 03          JMP SHORT psupdate.00411090
0041108D  |  8D49 00        LEA ECX,DWORD PTR DS:[ECX]
00411090  |> 8A1401         /MOV DL,BYTE PTR DS:[ECX+EAX]
00411093  |. F6D2           |NOT DL
00411095  |. 8810           |MOV BYTE PTR DS:[EAX],DL
00411097  |. 40             |INC EAX
00411098  |. 4E             |DEC ESI
00411099  |.^75 F5          \JNZ SHORT psupdate.00411090
0041109B  |> 5F             POP EDI
0041109C  |. 5E             POP ESI
0041109D  |. 5B             POP EBX
0041109E  \. C2 0C00        RETN 0C
The magic is in the NOT DL.
As we can see, even in the updater, the encrypt routine sucks :lol: while the in the packets it is just a XOR based enc/dec, in the updater is just a NOT lol... gz yedang.

I think I managed to get the urls right, but the updater only downloads 19 files and then all of sudden it closes...
I hacked the strings to point everytime to 127.0.0.1 but yet dont seem to work, I can upload my pstaleupdater here for you to see if I did something wrong...
 
Last edited:
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
They are clearly different. The English psupdate.exe is definitely not using ANY "encryption".
feHIo - Priston Tale Updater server creator. - RaGEZONE Forums

I'm pretty sure this is the version Moons said he based the LunaPT updater on. KPT and JPT are quite different from it... internally. But they look just the same. How different they are from each other, I have not checked.

I'll have a look at the difference between LunaPT psupdate.exe and EPT psupdate.exe.
 

Attachments

You must be registered for see attachments list
Moderator
Staff member
Moderator
Joined
Feb 22, 2008
Messages
2,404
Reaction score
724
could you please send me this pstaleupdate? I tried with PTBr updater, maybe it is over protected.

---------- Post added at 05:44 PM ---------- Previous post was at 04:59 PM ----------

I am already using subagames pstaleupdater, but yet, it just closes without any reason.

---------- Post added at 05:56 PM ---------- Previous post was at 05:44 PM ----------

I edited the setfile.lst to force it to download game.exe, but this is what I get, and no game.exe downloaded:

bobsobol - Priston Tale Updater server creator. - RaGEZONE Forums
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
Hmm... okay, other than that URL, and some title changes, Moons altered a table loaded in .data section from address 0042D0E0 to 0042D220 when loaded in memory. Not sure why yet...

As for sending you this updater it is in my release as "EPT.exe".
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
I don't have permission to share Moons work. But it is hardly different from the one in the afore mentioned thread. The differences that exist, I have stated.

How did you "force setfile.lst to download game.exe"? It should do so anyway, but you can move the game.exe record (complete with all fields, date and CRC most importantly) to be at the front of the list.

If any fields are wrong... the updater will just keep downloading the same file. XD
 
Moderator
Staff member
Moderator
Joined
Feb 22, 2008
Messages
2,404
Reaction score
724
I just edited the game.exe name inside the setfile.lst file, but it doesnt want to download, I deleted two files, my updater shows that it have to download 2 files, but it just closes suddenly without downloading anything. >.<

--
I deleted another file, EPT updater shows for a short period of time. [0/3] in the download status, but it doesnt even start downloading anything...
 
Last edited:
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
Well... changing the string, clearly, will not work. At the very least, for the reasons I gave above... but it may present other problems reading the file too.

Moons edit at 0042D0E0, you will see three occurrences of the repeating sequence:-
Code:
97 8B 8B 8F C5 D0 D0 9A 8A 8F 9B 9E 8B 9A D1 8F
8D 96 8C 8B 90 91 8B 9E 93 9A D1 9C 90 92 D0 8F
8C 8B 9E 93 9A D0 8A 8F 9B 9E 8B 9A D1 9E 8C 8F
which he replaced with sequences of
Code:
97 8B 8B 8F C5 A3 A3 8B 96 8D A3 8A 8F 9B 9E 8B
9A D1 97 8B 92 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
That should enable you to make EPT.exe exactly equivalent to Moons LunarPT psupdate.exe.

If you can figure out exactly what that change does (if it's important) please share with us. :D:
 
Moderator
Staff member
Moderator
Joined
Feb 22, 2008
Messages
2,404
Reaction score
724
I should look that in EPT.exe ?

this is what I have for that offset in ept.exe:

Code:
0042D0E0   0100             ADD DWORD PTR DS:[EAX],EAX
0042D0E2   0000             ADD BYTE PTR DS:[EAX],AL
0042D0E4   F0:F2:           LOCK PREFIX REPNE:                       ; LOCK prefix is not allowed
0042D0E6   41               INC ECX
0042D0E7   00D4             ADD AH,DL
0042D0E9   F2:              PREFIX REPNE:                            ; Superfluous prefix
0042D0EA   41               INC ECX
0042D0EB   00ACF2 4100978B  ADD BYTE PTR DS:[EDX+ESI*8+8B970041],CH
0042D0F2   8B8F C5D0D09A    MOV ECX,DWORD PTR DS:[EDI+9AD0D0C5]
0042D0F8   8A8F 9B9E8B9A    MOV CL,BYTE PTR DS:[EDI+9A8B9E9B]
0042D0FE   D18F 8D968C8B    ROR DWORD PTR DS:[EDI+8B8C968D],1
0042D104   90               NOP
0042D105   91               XCHG EAX,ECX
0042D106   8B9E 939AD19C    MOV EBX,DWORD PTR DS:[ESI+9CD19A93]
0042D10C   90               NOP
0042D10D   92               XCHG EAX,EDX
0042D10E   D08F 8C8B9E93    ROR BYTE PTR DS:[EDI+939E8B8C],1
0042D114   9A D08A8F9B 9E8B CALL FAR 8B9E:9B8F8AD0                   ; Far call
0042D11B   9A D19E8C8F 0000 CALL FAR 0000:8F8C9ED1                   ; Far call

you mean this one?
Code:
0042D170   97               XCHG EAX,EDI
0042D171   8B8B 8FC5D0D0    MOV ECX,DWORD PTR DS:[EBX+D0D0C58F]
0042D177   9A 8A8F9B9E 8B9A CALL FAR 9A8B:9E9B8F8A                   ; Far call
0042D17E   D18F 8D968C8B    ROR DWORD PTR DS:[EDI+8B8C968D],1
0042D184   90               NOP
0042D185   91               XCHG EAX,ECX
0042D186   8B9E 939AD19C    MOV EBX,DWORD PTR DS:[ESI+9CD19A93]
0042D18C   90               NOP
0042D18D   92               XCHG EAX,EDX
0042D18E   D08F 8C8B9E93    ROR BYTE PTR DS:[EDI+939E8B8C],1
0042D194   9A D08A8F9B 9E8B CALL FAR 8B9E:9B8F8AD0                   ; Far call
0042D19B   9A D19E8C8F 0000 CALL FAR 0000:8F8C9ED1                   ; Far call
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
Top one, very close to the Address quoted, yes.

Should not be code, since it's in the .data section... but that could be to fool us.
 
Back
Top