Giter Site home page Giter Site logo

Comments (15)

HeyItsWaters avatar HeyItsWaters commented on July 24, 2024

The process list is generated using Python, not C++
See

memory-deck/main.py

Lines 12 to 44 in e38ce4c

async def get_processes(self):
print("Getting processes")
process_list = []
# Get a list of processes using ps for the current user, we need the PID and the untruncated process name.
ps = subprocess.Popen(
["ps", "-u", "1000", "-o", "pid,command"], stdout=subprocess.PIPE)
output = subprocess.check_output(
('grep', '-v', 'grep'), stdin=ps.stdout)
ps.wait()
# Blacklist some processes
blacklist = ["ps ", "systemd", "reaper ", "pressure-vessel", "proton ", "power-button-handler", "ibus", "xbindkeys", "COMMAND", "wineserver", "system32", "socat", "sd-pam", "gamemoded", "sdgyrodsu", "dbus-daemon", "kwalletd5",
"gamescope-session", "gamescope", "PluginLoader", "pipewire", "Xwayland", "wireplumber", "ibus-daemon", "sshd", "mangoapp", "steamwebhelper", "steam ", "xdg-desktop-portal", "xdg-document-portal", "xdg-permission-store", "bash"]
# Parse output
for line in output.splitlines():
pid, name = line.decode().split(None, 1)
# If the name doesn't contain any string from the blacklist, append it
if not any(x in name for x in blacklist):
process_list.append({"pid": pid, "name": name})
# Remove blacklisted processes#
for process in process_list:
for blacklist_item in blacklist:
# Check if blacklist item is contained in the process name
if blacklist_item in process["name"]:
process_list.remove(process)
return process_list

For clarification, you're saying if you launch Tropico 5 through the normal SteamOS launcher, the memory-deck plugin does not scan the process (Tropico5) correctly? (Does it scan the process but won't return results? How does it fail?)

But if you launch Tropico 5 through Steam Tinker Launch, you can use memory-deck to scan the process (Tropico5.exe) and it works as expected? You can find and alter values?

from memory-deck.

Mte90 avatar Mte90 commented on July 24, 2024

Yes exactly

For clarification, you're saying if you launch Tropico 5 through the normal SteamOS launcher, the memory-deck plugin does not scan the process (Tropico5) correctly? (Does it scan the process but won't return results? How does it fail?)

But if you launch Tropico 5 through Steam Tinker Launch, you can use memory-deck to scan the process (Tropico5.exe) and it works as expected? You can find and alter values?

I can do some tests on the desktop mode with steam client to see if there is something that can be helpful.

from memory-deck.

HeyItsWaters avatar HeyItsWaters commented on July 24, 2024

Please do, the more information the better, since I don't have that game I can't recreate this exact issue.

I'm interested to know how STL launches the game differently...I wonder if it uses some kind of native version of the game or some kind of native Linux sandbox to run the game...

Whereas SteamOS probably uses Proton (which uses Windows emulation under the hood). This would explain why you see the .exe in the process list (.exe files are typically Windows exectuable files).

I would have guessed that the Proton version would behave more nicely with memory-deck, but who knows.

If you're feeling adventurous, you can launch the Konsole application in desktop mode and run the ~/homebrew/plugins/memory-deck/main.py manually (you will have to "uncomment" code at the bottom of that file) to see if there are any errors. I should really write up some step-by-step instructions on manually running this plugin at somepoint.

from memory-deck.

Mte90 avatar Mte90 commented on July 24, 2024

IMG_20221229_202115.jpg
Searching on terminal with the same command reveals the path. Checking that Tropico is a real Linux program and not something that use proton.
IMG_20221229_202358.jpg
Output of the plugin (maybe with other programs to blacklist) but it's there after selecting no search it is possible.
IMG_20221229_202436.jpg
IMG_20221229_202502.jpg
Also using the different operator, results always 0.

I read online that they crypt maybe values but with something like this I should be able to get something.

from memory-deck.

HeyItsWaters avatar HeyItsWaters commented on July 24, 2024

I'd be really curious if you ran the game in Desktop Mode through the normal Steam Launcher, and used that main.py file I mentioned in my last comment.

Again, you'd have to open the main.py file in a text editor and remove the # from the following lines:

memory-deck/main.py

Lines 130 to 183 in e38ce4c

# async def main():
# # This is only executed when the plugin is run directly
# # Create an instance of the plugin
# plugin = Plugin()
# await plugin._main()
# print(await plugin.get_processes())
# # Read PID from stdin
# print("Enter PID: ")
# pid = int(input('> '))
# await plugin.attach(pid, "Test")
# matches = -1;
# # Until matches is exactly 1, request a new value
# while matches != 1:
# # Get the new value
# newValue = input("> ")
# if newValue == "exit":
# return
# if newValue == "reset":
# plugin.scanmem.reset()
# continue
# if newValue == "list":
# plugin.scanmem.exec_command("list")
# continue
# # If newValue starts with 'pid ' then we need to attach to a new process
# if newValue.startswith("pid "):
# pid = int(newValue.split(" ")[1])
# await plugin.attach(pid)
# continue
# # await plugin.search_regions(ScanMatchType.MATCH_EQUAL_TO, newValue)
# plugin.scanmem.exec_command("= " + newValue)
# matches = await plugin.get_num_matches()
# if matches < 50:
# print(await plugin.get_match_list())
# print("Finished")
# if __name__ == "__main__":
# asyncio.run(main())

If you can run that while the game is running (python3 main.py), provide it the process ID (which you can get from running ps aux | grep -i tropico in Konsole, it'll be the first number in the output from that) and then search for a value and provide that output here or in a pastebin?

We can chat on Discord if you rather find me there.

from memory-deck.

Mte90 avatar Mte90 commented on July 24, 2024

To search with terminal I was in desktop mode but to test memory deck I was in gaming mode.
Maybe memory deck does not work fine with native Linux stuff?

from memory-deck.

HeyItsWaters avatar HeyItsWaters commented on July 24, 2024

Perhaps? I haven't really checked which games are using Proton vs native linux.

Running that main.py file while in desktop mode is like running a slimmed down version of memory-deck.

from memory-deck.

Mte90 avatar Mte90 commented on July 24, 2024

Right now I am using the SD without a keyboard and manipulate a file with the keyboard on screen is not very comfortable.
Anyway the pid is the right one, I think that I will check if I have some game linux native to see if that idea is real before to do other tests.

from memory-deck.

kayon avatar kayon commented on July 24, 2024

Native Linux games don't work, permission denied.
Edit /home/deck/homebrew/plugins/memory-deck/plugin.json add "root" to "flags", then reboot.

"flags": ["debug", "root"],

from memory-deck.

Mte90 avatar Mte90 commented on July 24, 2024

This explains a lot, how did you got the error?

from memory-deck.

HeyItsWaters avatar HeyItsWaters commented on July 24, 2024

@kayon I am also interested in this - where did you see a permission denied error?

Admittedly I haven't really used the plugin on any linux-native games on my Steam Deck, all the games I've tried are being ran through proton.

from memory-deck.

kayon avatar kayon commented on July 24, 2024

@kayon I am also interested in this - where did you see a permission denied error?

Admittedly I haven't really used the plugin on any linux-native games on my Steam Deck, all the games I've tried are being ran through proton.

Run main.py through ssh, Permission denied after search.
In addition, the search for Float and Double will never result, needs to be modified like this.
main.py line: 160, in the method: search_regions

                case "c_float":
                    val.flags |= MatchFlag.FLAG_F32B
                    val.float32_value = float(searchValue)
                case "c_double":
                    val.flags |= MatchFlag.FLAG_F64B
                    val.float64_value = float(searchValue)
                case _:
                    print("Invalid value!")
                    return False
        if val.flags & MatchFlag.FLAG_F32B or val.flags & MatchFlag.FLAG_F64B:
            self.scanmem.globals.options.scan_data_type = ScanDataType.ANYFLOAT
        else:
            self.scanmem.globals.options.scan_data_type = ScanDataType.ANYINTEGER

from memory-deck.

Mte90 avatar Mte90 commented on July 24, 2024

I don't have anymore tropico installed, someone that can test it?

from memory-deck.

colpocleisis avatar colpocleisis commented on July 24, 2024

I tested with hollow knight, dead cells and Slay the Spire native ports, can confirm @kayon solution works

from memory-deck.

HeyItsWaters avatar HeyItsWaters commented on July 24, 2024

v0.1.8 has been released to the test Decky store, should hit the production store soon. it should resolve this issue.

from memory-deck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.