Question unused writable ram?

Sumandora Jul 13, 2019.

  1. Sumandora
    OP

    Sumandora Im using Parental Controls. Change my Mind!

    Member
    4
    Nov 13, 2018
    Germany
    Hello,
    I recently wanted to make a Homebrew connecting to another one.
    but writing a text file is silly assfuck i mean you can just edit it.
    so i thought about writing the memory into ram.
    but then i have the problem that the ram could be overwritten by Horizon.
    so does anybody know a location where i can write ram and it cant get overwritten.
    and on switchbrew stands the memory layout but for every new version a new table.
    and this is only for 1.x.x - 6.x.x. so i hope someone knows.
    and if this doesnt work how does it work with Freebird and Freeset
     
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23
    Nov 21, 2005
    United Kingdom
    Very few things will work this way any more. Way way way back in the day (DOS era, and even then it was a dubious practice) on X86 it would be referred to as terminate and stay resident (TSR). Nothing today will really do this, and if it does it is usually considered a bug which can lead to some odd behaviours or a security risk.

    Your options as I see it are
    1) as the Switch is technically a multi tasking device you could try to have another super small program launch, speak to the program you want while it is active, stay running and then have the next program speak to it. I don't know what multitasking is like for the homebrew Switch these days though.
    2) You introduce an extra service on the Switch that stays running in the background and speak to that to have it save your data.
    3) Rather than write a file you write to the network somewhere to have it pop back out when it needs it (some types of save dumping on other devices do this).
    4) Just write a file. Barring stuff like 1) then it is what everybody does these days. If have not checked the Switch to see if it has a /tmp ( https://www.linux.com/blog/learn/intro-to-linux/2018/4/linux-filesystem-explained ) type section of memory going on that you could use for this if you are really reluctant to write to the SD.
     
  3. Sumandora
    OP

    Sumandora Im using Parental Controls. Change my Mind!

    Member
    4
    Nov 13, 2018
    Germany
    so
    1) there is no way to load both homebrews with the normal hbl as far as i see right?
    2) dont i need a complete CFW for that
    3) yea that would be a idea but what if user wants to play in his car where he doesnt have a Network...
    4) does the switch have a linux file struct? i mean its horizon

    so hard?
     
  4. Dichotomy754

    Dichotomy754 GBAtemp Regular

    Member
    4
    Nov 11, 2018
    United States
    2) On the switch you'd be looking at something called a sys module. You can find some examples basically at the top of the list here https://wiki.gbatemp.net/wiki/List_of_Switch_homebrew_applications
     
  5. chaoskagami

    chaoskagami G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚

    Member
    10
    Mar 26, 2016
    United States
    ↑↑↓↓←→←→BA
    1 - There's no way to load two homebrews, no. But first - why is two homebrews the solution to your problem? Could threads or files solve the issue instead? A cleverly constructed argv?

    3 - Then use the switch's IPC and write a system module that's backed by memory or a file. That's what freebird does.

    4 - I'm assuming you mean file handles, because there are two functions that return such a thing; fopen and open. One returns an opaque struct that you never tamper with, and the other returns a fd (which is an integer.) I fail to see how this would help you.

    1) You can have multiple threads in a single homebrew and pass arguments when launching other homebrew but you cannot run more than one at a time (unless you count running as a game and under an applet simultaneously, but that's sandboxed and fails the OP's requirements.)

    4) The switch does not have any form of tmpfs as far as I am aware, and even if it did, there's no mmap equivalent that would allow mapping said file into memory without properly reading it as a file first.
     
    Last edited by chaoskagami, Jul 13, 2019
  6. hippy dave

    hippy dave BBMB

    Member
    15
    Apr 30, 2012
    United Kingdom
    I mean yeah, you (OP) haven't given much detail on when the "connecting" between the apps takes place - if one is to be run immediately after the other, then passing an argument sounds great. If the first program just finishes and then the user loads the second one whenever they're ready, then argument passing doesn't sound so feasible, so you'd probably go with either the sysmodule or just writing a file. Add some basic encryption/signature if you really don't want it edited.
     
  7. Sumandora
    OP

    Sumandora Im using Parental Controls. Change my Mind!

    Member
    4
    Nov 13, 2018
    Germany
    yea encrypted file was my thought too.
     
  8. smf

    smf GBAtemp Psycho!

    Member
    9
    Feb 23, 2009
    United Kingdom
    I can just as easily edit your encrypted file or ram, what exactly are you trying to achieve & why are you so bothered if someone edits it?
     
    chaoskagami likes this.
  9. chaoskagami

    chaoskagami G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚

    Member
    10
    Mar 26, 2016
    United States
    ↑↑↓↓←→←→BA
    The reality is if you do any crypto locally, someone can derive the keys and work around it. See: Nintendo, Atmosphere.

    I think you're trying to solve the wrong problem here. Take a step back and think about what you're really trying to do here, because chances are this is the wrong approach to whatever your "problem" is (and since you won't explain at all, it's impossible to offer any advice. Aside from that, I probably wouldn't use anything you coded just based on this thread, no offense.)
     
    Last edited by chaoskagami, Jul 15, 2019
    gnmmarechal likes this.
  10. Sumandora
    OP

    Sumandora Im using Parental Controls. Change my Mind!

    Member
    4
    Nov 13, 2018
    Germany
    i know but how ever why should someone want to crack a HB port?
     
  11. chaoskagami

    chaoskagami G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚

    Member
    10
    Mar 26, 2016
    United States
    ↑↑↓↓←→←→BA
    Because they can?

    If you can't answer any of these questions, I'm just not going to bother replying any further. You're making it difficult to impossible to help you, since none of us have any clue what problem you're even trying to solve here. You're being so vague that we have nothing to work with here.
     
    gnmmarechal likes this.
  12. Sumandora
    OP

    Sumandora Im using Parental Controls. Change my Mind!

    Member
    4
    Nov 13, 2018
    Germany
    well i always think mmh. they cracked it... new version and all the work was for nothing
     
  13. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23
    Nov 21, 2005
    United Kingdom
    What chaoskagami said -- most of us are all for abstract discussions (see me wittering on about TSR above) but at this point it is all a bit too abstract. I am not even sure if we are talking about having a program immediately pass off the info to another program (in which case having some fun with the call arguments is probably the way) and have it do something or have it all happen at some essentially arbitrary point in the future (in which case we are back to the abstract things I started on about, and apparently with the nature of things here some of those are not so viable compared to a more traditional computing setup).

    Most things that would need a security focus have already been solved, or largely solved. Might be a new example of the concept that has never been done before, however the abstract is a different matter; pretty sure nobody made a DS application to speak to my small local bank to do online accounting, does not mean online banking application is not a largely solved issue though. That sort of thing we are more likely to at least be able to point you at something to handle it.
     
    chaoskagami likes this.
  14. smf

    smf GBAtemp Psycho!

    Member
    9
    Feb 23, 2009
    United Kingdom
    I get the impression it wasn't a security thing, more that he couldn't cope with the potential that someone might look at or modify his variables. But as he couldn't even cope with giving any information about it, then we'll never know for sure.

    I kinda agree that putting things in files to pass between programs is not ideal when they could be part of the same program or at least do some more modern IPC, encrypting it doesn't make it more ideal. Storing stuff in unallocated ram and hoping it stays there is even less ideal, I second the opinion that I wouldn't want to run any thing like that.

    Apparently someone else has figured it out, whatever it was.
     
    Last edited by smf, Jul 15, 2019
    chaoskagami likes this.
  15. eyeliner

    eyeliner Has an itch needing to be scratched.

    Member
    7
    Feb 17, 2006
    Portugal
    Explain the rectal fornication part. I am intrigued at how your homebrew could open up vast amounts of enjoyment to rectal fornicators out there.
    Thank you.
     
Quick Reply
Draft saved Draft deleted
Loading...