Re: Beta Technical Demonstration - Translation without Hexing the EXE
I dont understand what you've said.
Well, in your answers can you use words more "simple"?
I mean, its been a while that I dont use english, I'm using it just here in RZ. But you are a native speaker, and I'm not, and as your answers are like a big book (XD nothing against. You are a great teacher) sometimes I just, lose the "point" of what you are saying.
And another thing. Why dont upgrade to the 1988 client I have posted here? Its more actual than 1977 of yours.
Reegards.
18-12-10
bobsobol
Re: Beta Technical Demonstration - Translation without Hexing the EXE
Okay. In reverse order.
a) I'm using Butchered because the point of Butchered was to be a general client that people could use for their server, and configure how they want, like a newer QF1873, and it's taken me nearly 8 months to get it to this point... to start over with 1988 would be a lot of work.
The features I've added (or restrictions removed) UAC compliance (no need to be full token Admin) DEP compliance, no access to registry HKLM, no restriction on screen resolution, enabled window mode, enabled hardware cursor (need to make it "change shape") etc. No XTrap code of any kind (I hope), and I've reduced a lot of the calls to official PT IPs (which are present even in 1873) even though that code is rarely / never accessed... also added some code bumming (made routines smaller / faster) to improve frame rate and reduce screen lag.
b) Simple words. "How far have you got" up until 6113028 in rdata section. XD
Which should be the exact same format as the .lng file. In fact, if you used it as your .lng file then you would have very large memory usage from IntStr.dll and quite a lot of lag, with no alteration what-so-ever to the text produced in game.
I keep this in a batch file, and extract .rdata to 1977.RData and .data to 1977.Data files in the same folder.
I think my last post suggests I don't want people to use the final International.dll method with other clients... ever. Which is wrong. I'm happy for them to be used with clients which aren't 1977 Butchered, but I also want Butchered to use them as an integral part of it's being a general client that anyone can use... regardless of what language they want their players to run, what hardware they want as minimum & maximum, what resolutions they want to allow, what fonts and skins and so-on and so-forth.
I can see that KPTTrans section is a big part of why 1873 is good, I can also see that KPTTrans is a very, very bad way of making changes to a client to make it more useful as a private server client. I wanted to achieve the same, thing in Butchered, but do it in a better way. The International.dll is the way I'm attempting. If you want to use it elsewhere, that's fine, but Butchered is what inspired it. That's all.
The problem with the line
Code:
6136992 = "Vel. da Arma:/n"
is that 6136992 is a valid string address in 1977, and should contain "%s%s%s". So now routines are looking for 3 extra parameters (arguments) in a string that no longer has formatters for *any* other parameters. :S
That could be tricky to fix... but I guess I could ensure that there are as many "%" that aren't "%%" in the destination as there are in the source. The loss then, would be that you couldn't use the old
Code:
6191640 = "Ver: 2b Eng"
method. As it would now have to have 4 additional parameters in it, just as the original "%s%d.%d.%d" string had. If you see what I mean?
--- EDIT2 ---
Erroneous .lng line log extract:-
Code:
wsprintf(), 6136992, "%s%s%s", "Vel. da Arma:/n"
wsprintf(), 1566796, "GeoSphere_1.smd", "/* Not Replaced */"
wsprintf(), 1568552, "image\Sinimage\AssaEffect\Ball\", "/* Not Replaced */"
wsprintf(), 1567072, "", "/* Not Replaced */"
; Should have produced the string "image\Sinimage\AssaEffect\Ball\image\Sinimage\AssaEffect\Ball\" for FindFirstFile(), FindNextFile(), FindClose() loop!!! Problem.
wsprintf(), 6136992, "%s%s%s", "Vel. da Arma:/n"
wsprintf(), 1566496, "GeoSphere_1.ase", "/* Not Replaced */"
wsprintf(), 1568552, "image\Sinimage\AssaEffect\Ball\", "/* Not Replaced */"
wsprintf(), 1567072, "", "/* Not Replaced */"
; Should have produced the string "image\Sinimage\AssaEffect\Ball\image\Sinimage\AssaEffect\Ball\GeoSphere_1.ase" for fopen()!!! Bigger Problem
wsprintf(), 6136992, "%s%s%s", "Vel. da Arma:/n"
lstrcpy(), 52719956, "Vel. da Arma:/n", "/* Not Replaced */"
lstrcpy(), 52719956, "Vel. da Arma:/n", "/* Not Replaced */"
lstrcpy(), 6092928, "smd", "/* Not Replaced */"
; Should be replacing the file names found from FindNextFile() with ""image\Sinimage\AssaEffect\Ball\image\Sinimage\AssaEffect\Ball\GeoSphere_1.smd" but gives "Vel. da Arma:/nVel. da Armasmd" instead", so now we try to open that for binary read!? :s
Correct operation:-
Code:
wsprintf(), 6136992, "%s%s%s", "/* Not Replaced */"
wsprintf(), 1566796, "GeoSphere_1.smd", "/* Not Replaced */"
wsprintf(), 1568552, "image\Sinimage\AssaEffect\Ball\", "/* Not Replaced */"
wsprintf(), 1567072, "", "/* Not Replaced */"
wsprintf(), 6136992, "%s%s%s", "/* Not Replaced */"
wsprintf(), 1566496, "GeoSphere_1.ase", "/* Not Replaced */"
wsprintf(), 1568552, "image\Sinimage\AssaEffect\Ball\", "/* Not Replaced */"
wsprintf(), 1567072, "", "/* Not Replaced */"
wsprintf(), 6136992, "%s%s%s", "/* Not Replaced */"
lstrcpy(), 52719956, "image\Sinimage\AssaEffect\Ball\GeoSphere_1.ase", "/* Not Replaced */"
lstrcpy(), 52719956, "image\Sinimage\AssaEffect\Ball\GeoSphere_1.ase", "/* Not Replaced */"
lstrcpy(), 6092928, "smd", "/* Not Replaced */"
lstrcmp(), 6092892, "SMD Model data Ver 0.62", "/* Not Replaced */"
lstrcmp(), 1565476, "SMD Model data Ver 0.62", "/* Not Replaced */"
lstrcpy(), 1561336, "image\Sinimage\AssaEffect\Ball\GeoSphere_01.bmp", "/* Not Replaced */"
---/EDIT2 ---
--- EDIT ---
BTW... I also like Vormavs idea of loading the item tables from files, and hope he will share his findings and methods to the extent that that can be incorporated into Butchered. :D:
18-12-10
SheenBR
Re: Beta Technical Demonstration - Translation without Hexing the EXE
No I dont. Vel da Arma: is Weapon Speed.
This is a Item Decription.
18-12-10
bobsobol
Re: Beta Technical Demonstration - Translation without Hexing the EXE
Not in 1977 it isn't. It's mostly used for concatenating paths to resources, but that constant string formatter could be used for many things.
The problem was that you where using an .lng file developed based on one exe on a different exe... that won't work, and that's your problem. (It's also why I asked that you post .lng files based on 1977 clients out of preference... unless you want to make everyone work out what the correct offsets are)
My problem is that I would rather it wasn't so catastrophic when the two don't match. If it throws up a dialogue box or leaves an error log, I'm not so unhappy, but if it crashes the game with no explanation as to why... that's not acceptable to me. :wink:
--- EDIT ---
BTW, if I could click the like button 20 times for Vormavs' example line post, I would. That was such a great help.
Thank you, thank you, thank you. I'd given invalid addresses before, but never patched the wrong thing at such a crucial, and valid address.
18-12-10
SheenBR
Re: Beta Technical Demonstration - Translation without Hexing the EXE
OK, I will use 1977 game then.
19-12-10
bobsobol
Re: Beta Technical Demonstration - Translation without Hexing the EXE
For the time being, I would appreciate that. Thanks.
Eventually, I hope to be able to document everything a person needs to do to integrate the system with whatever client they want. But while it's developing, it would help a lot if we all use the same client. Especially where things require modification of the basic operation of the exe in order to gain access points to patch.
Why I like to work together with you:-
Spoiler:
I can't force people not to "opt-out" and use the information and code I've listed here to "go their own way". I can't even force people to go any further than a commit part way, and develop further for them self alone. But I do appreciate those of you who have chosen to "chip-in" and help me make this better for us all.
I'm sure there is some ego-centric win to be gained by working alone. That you can say "This is mine, all mine!" but I also believe that that feeling can only last until someone takes it off you. The moment you show everyone what it is you have done that is so great, is the moment someone will try to take it from you. What if you never show it to anyone? Ah, but then what was the point in achieving it, and who will know of your greatness?
I know this because I have seen those who choose to work alone get ripped off by others who want what they have. That's why I choose to work openly, and publicly. Because I believe that if you want some of what I can give, you will feed back, and help me make it, or make it better than I alone could have imagined. And when that is the case, it is no longer mine, it is ours. And the "greatness" belongs to us all. So I protect myself from being stolen from, by giving before I have made any claim to complete ownership.
I believe this to be true, right and fair to all. It is in the best interest of producers, contributors and consumers alike. Those of you who are working with me are proving my belief.
Thank you all.
19-12-10
Vormav
Re: Beta Technical Demonstration - Translation without Hexing the EXE
Quote:
Originally Posted by bobsobol
BTW... I also like Vormavs idea of loading the item tables from files, and hope he will share his findings and methods to the extent that that can be incorporated into Butchered. :D:
Well, I always release my stuff (except heavy beta or pre alpha projects ;) ). Problem with this is that there is no space for modifications so I jump to new section move data to register and jump back, in other words there is a lot of jumping and I am afraid that game might slow down by a few nanoseconds ;).
You need to do a lot of manual work to move this to a different .exe (and doing it with dll is impossible, this would be more hack than app + it would slow down game A LOT!) but in exchange adding items will be very easy.
Anyway lets back to main "dish".
Do you think it is possible to patch monsters names with your .dlls?
There is 6112016 = "Hopy" in your 009.lng file, I tried with other mob names too and its not working for me :/
It would be cool if players could see monsters names in their language.
--EDIT--
When I think about it now, mobs names coming in packets so I think It would be better to haxxor those ;)
19-12-10
SheenBR
Re: Beta Technical Demonstration - Translation without Hexing the EXE
Mobs, NPC Names they all come and go through the packets. I think its better to leave them alone. But, if bob say there is no problem at all, so its up to you either patch or not.
20-12-10
bobsobol
Re: Beta Technical Demonstration - Translation without Hexing the EXE
Quote:
Originally Posted by Vormav
Well, I always release my stuff (except heavy beta or pre alpha projects ;) ). Problem with this is that there is no space for modifications
It's good to hear, even though I suspected as much. There is some cross-over between your item import project and my text import one, so I think there's room for collaboration between these projects. Possibly even with an ultimate aim of merging them.
Maybe there is "no space" in your game.exe, but between code bumming and dumping all XTrap routines, there is lots of space in Butchered for new routines, or moving routines to a new location where they can "Grow". This is what I did with the Class Skills table builder.
I do wonder if something like an XML file mightn't be the easiest editable form to keep item tables, and then you have the choice of Hashing the table in memory or file. (I even wonder if Class Skills shouldn't come from an XML file rather than copy / expand from .rdata to .data, especially as many people want to implement the second page of Class Tiers)
If you import functions to retrieve the data structures of XML files from a DLL, the code in game shouldn't be too big. (there are a number of freely available small fast XML handling DLLs)
Removing the item table from the .data section clears a lot of space there, but it's awkwardly placed. If you could move stuff above it back in memory, you could reduce the game.exe size considerably. The same is true of the many many strings of text in the game.exe, however, they are mixed and mashed into a whole load of other data.
Quote:
Originally Posted by Vormav
Do you think it is possible to patch monsters names with your .dlls?
There is 6112016 = "Hopy" in your 009.lng file, I tried with other mob names too and its not working for me :/
It would be cool if players could see monsters names in their language.
--EDIT--
When I think about it now, mobs names coming in packets so I think It would be better to haxxor those ;)
Correct, they come from the server, not the client. For some reason the client keeps internal names for the key monsters... but they aren't the names that are displayed on screen.
a) The server could be language neutralized with these libraries the same as the game.exe, but it will still only produce a single language per instance (Alpha, Beta, Gamma).
b) I wouldn't patch the packets, as such, but considered changing the monster names, and the "*CHAT" for key codes, like the Item codes "WA101" = "Stone Axe". So you could then make the client lookup the code in the players preferred language before displaying it.
c) All strings that come from the server are going to be a lower priority than anything that is already embedded client side. Because it's more work, and it probably involves tying the client into a specific setup of server.
It's not beyond the realm of possibility, and certainly wouldn't pose a great slow down in game play, if it's done right. But it would require considerable effort and coding (there are lots of texts that come from the server) and is more likely to be a "Version 2.0" implementation... where I'm not even up to Version 0.1 yet.
Strings that are moved with Rep Movs along with other binary data before being merged together with wsprintf() or strcat() are prevalent, and each of those will need client modification to use the DLLs effectively. Something I wanted to avoid as much as possible when I started out, but seems unavoidable now. This makes it hard to use the DLLs in other clients... but I think Lelejau has proven that it can be done, if it's sufficiently well documented.
20-12-10
Vormav
Re: Beta Technical Demonstration - Translation without Hexing the EXE
Quote:
Originally Posted by bobsobol
[...]there is lots of space in Butchered for new routines, or moving routines to a new location where they can "Grow". This is what I did with the Class Skills table builder.
I do wonder if something like an XML file mightn't be the easiest editable form to keep item tables, and then you have the choice of Hashing the table in memory or file.[...]
Problem is that I can't do something like this:
MOV ECX,DWORD PTR DS:[EDI+600F7C]
and just change 600F7C to my offset (448105C) address because it will contain address to memory where items_table.dat is stored and not data. I have to do something like this:
For every offset to item table... (300+,400+? I stopped counting =P)
But in they end if I am going to add for example SWORD to item table all I have to do is copy last SWORD (item size is constant and its 314)
and past it on the end of last item with WEAPON "mark", fix Item ID to new one and than add +314 to every offset after that weapon:
if i add sword and a bow than +(314 x 2) and so on.
Its quite simple instead of fixing all offsets all the time and TOOL for adding items can be made, rules are simple :)
For now I adding everything to new section so other people will know what was added and what was changed :)
ESI contain monster/NPC/player name from packets.
It can work as "detector" but it don't see "/hide" hidden GM/ADMIN :/
Anyway if you swap name here, monster/NPC/player name will swap too :)
Names are putted here 01E29168 and some more details after name but all you have to do is extract name and change it.
PS. I can help you when I finish external items table =P
20-12-10
bobsobol
Re: Beta Technical Demonstration - Translation without Hexing the EXE
That's good to know.
Actually, I was thinking of reading values from XML into a memory table... so that it's still represented like items_table.dat in memory, but is loaded value by value from a plain text file.
So how game.exe works shouldn't be any different, but the way the file is loaded is... IE the binary data is laid out from reading a text file.
I know that would be a slower loading method, but since it should be done before the intro sequence, it wouldn't interfere with the game play. And it's only a thought, as that would mean you don't have to know the binary layout or how to edit a file in Hex to add, remove or change items.
>Update IntStr V0.0.2.30<
Fixes multiple line output in the log, to comply with CSV more fully.
Tooltips on items look like they could do with optimising... I see no reason why the following sequence should appear so many times between each TextOut() of the information:-
That just looks like another silly waste of CPU time to me... and it certainly wastes an awful lot of log space.
Can others confirm they also get a similar sequence repeated over and over? (the list is only 1 iteration of many in the sequence before it's actually displayed)
20-12-10
Vormav
Re: Beta Technical Demonstration - Translation without Hexing the EXE
Same here,
Code:
wsprintf(), 6109760, "%d%s\r", "/* Not Replaced */"
lstrcat(), 1637672, "Critical: \r", "/* Not Replaced */"
lstrcat(), 51370400, "Wyvern Axe \rDamage: \rSpeed: \r", "/* Not Replaced */"
lstrcat(), 1637608, "20%\r", "/* Not Replaced */"
lstrcat(), 51364608, "\r81-107\r7\r", "/* Not Replaced */"
lstrcpy(), 6119276, "명중력: \r", "Weight: \r"
wsprintf(), 6109768, "%d\r", "/* Not Replaced */"
lstrcat(), 1637672, "Weight: \r", "/* Not Replaced */"
lstrcat(), 51370400, "Wyvern Axe \rDamage: \rSpeed: \rCritical: \r", "/* Not Replaced */"
lstrcat(), 1637608, "226\r", "/* Not Replaced */"
lstrcat(), 51364608, "\r81-107\r7\r20%\r", "/* Not Replaced */"
lstrcpy(), 6119252, "블럭율: \r", "Block: \r"
wsprintf(), 6099548, "%", "/* Not Replaced */"
wsprintf(), 6109760, "%d%s\r", "/* Not Replaced */"
I see those patterns all the time.
But aren't those talking about every item?
lstrcat(), 1637672, "Weight: \r", "/* Not Replaced */"
Weight of my shield, axe, gloves, my weight?
So they are same yet different for different item?
20-12-10
bobsobol
Re: Beta Technical Demonstration - Translation without Hexing the EXE
Yea, but how many times does it repeat that loop of building the layout of the tooltip text from those details between each TextOut() loop which is where all that work is used.
All the times in-between are exactly the same details being strung together into a complete tooltip which is then cleared, and done again... and again... and again, until, eventually, it is broken down again at the "\r" points and made into little strings which are passed to TextOut(). (twice per line, for the shadow effect... if you can see that XD )