Replace references inside an UObject/uasset C++

Here’s the problem. I’m loading a bunch of .pak files from a server. Inside those paks I have StaticMesh, Material and Texture assets. I was able to mount the paks and load async the objects in order to show them when I need them.
However when I load a UStaticMesh object and attach it to an actor, there’s no material on it. That’s because the reference paths inside the static mesh .uasset file do not match the actual reference paths where I mount the paks which contain the material.
I could load the material manually passing the right reference path but the material has wrong reference paths to the textures.
So what I was thinking to do was replace the wrong paths references inside the UObjects I wanna load (the static meshes and the materials) with the actual paths I used to mount the files inside the paks.

Notice that I cannot know the original paths of materials and textures. They could be everything, so I need to replace them. I think it is totally possible, but I found no clue how to do that, except that maybe I could use this class

But I had no success, because I did not understand how to use the ReplacementMap.

P.S: English is not my primary language, so please forgive any grammatical or synthax error I could have done in this post.

did u find any solution?

Unfortunately no. I think it is totally doable because the editor does that when you move assets that have dependencies in a different folder. However I implemented a different solution in the project I am working so I really don’t need to replace references anymore. I’m still curious to know the answer, tho.