EOSERV Forum > Client Editing > Reading what maps the user is on?(UPDATED :D)
Page: << 1 >>
Reading what maps the user is on?(UPDATED :D)
Author Message
Post #197741 Reading what maps the user is on?(UPDATED :D)

UPDATE:

Solved the use of the "byte" class, using 32bit integer.

Now begins playing my remade Title theme when the map value has not been set(default 0), and can read when the player has switched to map 5(Aeven), and begins the Aeven theme. Using libZPlay, so it supports MP3, OGG, FLAC, and quite a few others.

So this is going to work. Thanks for all of the advice everyone offered. This still has a LONG way to go, but it's definitely possible. Hopefully I'll have a beta soon.

Original Post:

For a while now, I've been using some of my spare time and some of the things I've picked up helping artists with their music- specifically to recreate some of the EO soundtrack and one day search for a way to apply it. That day came, when I started taking focus away from my own games and screw around with my test server.

First, to prove I'm not ****ing around- listen to this draft remake of the Aeven theme. It was inspired heavily by the Metroid Prime soundtrack. And my remake of mfx016.

https://www.youtube.com/watch?v=vnqgGHdjDMM

https://www.youtube.com/watch?v=afQUJh2GGKw

After a night of drinking, speeding the game up and adding a few quests: I was sick of hearing the Midi tracks packaged in the normal EO client and was dying to add my own. I tried applying normal SFX objects- but this seemed very cheap and tacky, the WAV formatted music had very large file size, sounded bad, and the volume varied too much.

So my question was, how could I do this?

A simple idea, but a complicated goal. I needed to create a launcher, that would use Endless Online as a guest process and read memory from an address and the EO client to see what map the user was on, compare the value to a list read from a text file, and play the assigned music file to that map in the background.

So I broke open cheat engine, and was able to find 3 values that consistently returned the map number- but after some more fiddling I found a HUGE problem.

The addresses are different every time you start the game.

I've a lot of work already, and need to finish it or it'll drive me absolutely mad.

I need a function, a program, anything(preferably C#) - that I can grab a users map number and return it to a background music player. Creating the application would be extremely easy for me, if I could find that. And finally put everything together- this would also allow me to create entirely new soundtracks for other servers if they wished. Although the original EO soundtrack was good for its age, I think we've all grown tired of it and Midi all together.

Can ANYONE help me?

8 years, 35 weeks ago
Post #197742 Re: Reading what maps the user is on?(Read & Listen)

If I remember correctly there is a constant memory location for the map number and x, y position of the character so you need to keep looking. Failing that you could always just intercept the map packets from the server. 

Getting your code loaded into the clients memory is pretty easy if you use EO.Addons. Simply create a .dll file rename it to an .eaf file and drop it in the \Addons\ folder, it'll be loaded and executed (DllMain()) by EO.Addons when the client starts.

No real SDK but you can import some helper functions that do things like edit memory and hook various API calls and window messages from other loaded addons. See http://sordie.co.uk/downloads/EO.Addons/EOAddons.pas for reference.

---
Forgotten Passwords = Fresh Start
8 years, 35 weeks ago
Post #197744 Re: Reading what maps the user is on?(Read & Listen)

I had totally forgotten about that, I actually discovered that it has 2 consistent addresses I can use, but both of them have frequent value flashes(changing to something random, and then reverting). I opened C# and made it compare both values, my own programs "map" number will only change if both addresses return the same value.


8 years, 35 weeks ago
Post #197745 Re: Reading what maps the user is on?(Read & Listen)

Also check out EOPlugins. It features similar functionality to EO.Addons. It doesn't have helper functions, but does provide an internal proxy that makes it simple to read/manipulate packets. If you wanted to, you could just have your plugin force disable sound/music by modifying the config before the game loads(during plugin load) then you could have it just watch for packets that would cause music to change and run your own music. Your plugin run function is executed on its own thread, so playing music should not interfere with the main game thread.

It also includes some example plugins in C++ and C#, so getting started should be as easy as playing with the examples.

8 years, 35 weeks ago
Post #197746 Re: Reading what maps the user is on?(Read & Listen)

I also keep forgetting about EOPlugins. Are you still interested in developing it? I could convert some of the EO.Addons over to EOPlugins so it has things like API hooking, memory editing, etc. 


---
Forgotten Passwords = Fresh Start
8 years, 35 weeks ago
Post #197747 Re: Reading what maps the user is on?(Read & Listen)
Squirrel posted: (31st Aug 2015, 04:10 pm)

I also keep forgetting about EOPlugins. Are you still interested in developing it? I could convert some of the EO.Addons over to EOPlugins so it has things like API hooking, memory editing, etc. 


I wouldnt mind continuing developing it further. The whole reason i stopped before was because there seemed to be zero interest. I would very much appreciate if you could port api hooking and memory editing. I had some trouble with adding those things myself. Thats part of the reason i came up with including a proxy, to sort of make up for the non memory editing haha.

Only issue with it though is that i don't have access to the source atm. Last time i worked on it was exclusively on my desktop machine, and since i never really got any responses with it, I'm pretty sure it slipped my mind to put it on my dropbox. I won't have access to it until November when i return home from my deployment. 

Edit: Looking at my post on treos, it seems i let that post get ahead of the eoplugins here. Pretty sure it was because this forum was on life support around that point. See this post for latest version. 

8 years, 35 weeks ago
Post #197748 Re: Reading what maps the user is on?(Read & Listen)
mrsix- The adresses will always change for a lot of them.You need to find a static pointer, so you can automatically find the next new (changed address). I had to do this to find player values like hp,tp,sp,exp ect. It worked fine for myself, but others will have different addresses then what you have. That is the problem I ran into. If you're using cheat engine, it's pretty easy to find the static pointer.

Suirad- I'd like to see you continue on this! I think this is a neat project. Not sure if I can help with this, but I could try and help if you want/ continue with this.

---
EO Resources/Guides: â—„ eobud.boards.net â–º
8 years, 35 weeks ago
Post #197749 Re: Reading what maps the user is on?(Read & Listen)

I made a lot of progress, but ran into an issue reading map numbers above 255(it reads 256 as 0, 257 as 1) and so on. So I'm going to try reading the MFX ID later after I get off work.


I'd be interested in using EOPluggins but I'd need to know if you're okay with people distributing it with custom clients, instead of making people manually download and install their servers music.


I already have a method to merge executables which would suffice. But experimenting what you have might be more fruitful.

8 years, 35 weeks ago
Post #197752 Re: Reading what maps the user is on?(Read & Listen)
mrsix posted: (31st Aug 2015, 10:18 pm)

I made a lot of progress, but ran into an issue reading map numbers above 255(it reads 256 as 0, 257 as 1) and so on. So I'm going to try reading the MFX ID later after I get off work.


I'd be interested in using EOPluggins but I'd need to know if you're okay with people distributing it with custom clients, instead of making people manually download and install their servers music.


I already have a method to merge executables which would suffice. But experimenting what you have might be more fruitful.


Map IDs are a short (2 bytes). You're running into some integer overflow there.

Also, the open-source client I'm working on has rudimentary audio support for SFX and MFX (I haven't added a lot of SFX handling to places where it needs to go). If you're interested in re-vamping the sfx/mfx files I'd love to use them in my client.

The problem I ran into is that XNA doesn't support the shitty audio files EO comes with. The MIDIs I have to hook into a Windows Media Player process and the some of the SFX had to be re-written so the WAV header matched the actual data length. It's a hot mess.

---
class EOSERV {
Programmer | Oldbie
Open source EO Client: https://github.com/ethanmoffat/EndlessClient
};
8 years, 35 weeks ago
Post #197753 Re: Reading what maps the user is on?(Read & Listen)
mrsix posted: (31st Aug 2015, 10:18 pm


I'd be interested in using EOPluggins but I'd need to know if you're okay with people distributing it with custom clients, instead of making people manually download and install their servers music.


I already have a method to merge executables which would suffice. But experimenting what you have might be more fruitful.


That is exactly the point of it, feel free to use as you please
8 years, 35 weeks ago
Post #197754 Re: Reading what maps the user is on?(Read & Listen)

So, I tested reading the MFX ID, used the same "comparison" technique from 2 addresses that remained the same throughout each session(switched to VB though, because I moved this to my Laptop while I ran some updates).


The MFX ID addresses changed on my laptop, but the map ID addresses were still the same so can be safely used on different machines. the "255" limit is caused by the enforced use of the Byte class(CLRs "Byte" class is strictly 8bit, so even converting it to an integer will not change its limitations).


So, I'm out of ideas. This is my first attempt at any kind of memory reading. Searching for a pointer seemed fruitless(after about 40 rescans I still have over 41,000,000 results) and repeating the search & rescan I only lose mere hundreds.


If anyone was curious, here is the code so far:

    Public Sub GetMapID()
        'Find endless.exe process
        Dim ProcessToReadFrom As Process = Process.GetProcessesByName("endless")(0)
        Dim MemoryReader As New NativeMemoryReader(ProcessToReadFrom)

        'Read Map ID bytes
        Dim MapIDByteA1() As Byte = MemoryReader.ReadMemory(New IntPtr(&H18F71C), 1)
        Dim MapIDByteA2() As Byte = MemoryReader.ReadMemory(New IntPtr(&H18FC44), 1)

        'Read MFX ID bytes
        Dim MusicIDByteA1() As Byte = MemoryReader.ReadMemory(New IntPtr(&HBA2FBFC), 10)
        Dim MusicIDByteA2() As Byte = MemoryReader.ReadMemory(New IntPtr(&HBA2FC00), 10)

        Dim Value1 As Byte = MusicIDByteA1(0)
        Dim Value2 As Byte = MusicIDByteA2(0)

        Label1.Text = Value1.ToString
        Label2.Text = Value2.ToString

        If (Value1 = Value2) Then
            Label3.Text = Label1.Text
        End If
        MemoryReader.Dispose()
    End Sub

8 years, 35 weeks ago
Page: << 1 >>

EOSERV Forum > Client Editing > Reading what maps the user is on?(UPDATED :D)