Coder Social home page Coder Social logo

Comments (3)

borntohonk avatar borntohonk commented on August 29, 2024

In lines 19 + 21

subprocess.run(f'hactoolnet --keyset prod.keys -t switchfs {firmware} --title 0100000000000819 --romfsdir 0100000000000819/romfs/', stdout = subprocess.DEVNULL)

and

subprocess.run(f'hactoolnet --keyset prod.keys -t pk11 0100000000000819/romfs/nx/package1 --outdir 0100000000000819/romfs/nx/pkg1', stdout = subprocess.DEVNULL)

This could be adjusted to:

subprocess.run(f'hactoolnet --keyset ' + prod_keys + ' -t switchfs {firmware} --title 0100000000000819 --romfsdir 0100000000000819/romfs/', stdout = subprocess.DEVNULL)

and

subprocess.run(f'hactoolnet --keyset ' + prod_keys + ' -t pk11 0100000000000819/romfs/a/package1 --outdir 0100000000000819/romfs/nx/pkg1', stdout = subprocess.DEVNULL)

Reason, well you already define the path to check in this line: prod_keys = os.path.expanduser('~/.switch/prod.keys') When the subprocess runs it now looks where you put the prod_keys check in the first place.

Thanks.

I instead added argument -k or --keys to provide a keyfile, but still default to ~/.switch/prod.keys if the user does not provide an input.

from switch-ghidra-guides.

borntohonk avatar borntohonk commented on August 29, 2024

well did more than what you asked for, also with python, doing a "formatted string" ( f'thing {other_thing} thing'), you can encapsule variables with squiggly brackets to run them as code instead of doing 'thing ' + other_thing + ' thing`

subprocess.run(f'hactoolnet -t switchfs {location} --title 0100000000000819 --romfsdir {location}/titleid/0100000000000819/romfs/', stdout = subprocess.DEVNULL)

from switch-ghidra-guides.

mrdude2478 avatar mrdude2478 commented on August 29, 2024

Yep, thanks - I also made a typo in the above. But you fixed it :-)

from switch-ghidra-guides.

Related Issues (9)

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.