Generate OS-specific command to run Minecraft 1.14 in Python - python

Hey guys, I'm working on a flexible Minecraft launcher in Python.
I have the code for the authentication all sorted out here to get things like the access token to log into the game and all the other necessary bits for a launcher, apart from the most important bit; I haven't got a method to actually start the game.
This isn't a duplicate of this or this, as they are for the old launcher and system. It could be classed as a duplicate for this, but that hasn't been answered for a long time.
Basically what I'm asking is, does anybody know how I can start Minecraft from a specific version such as 1.14.4? I'm making this on macOS Mojave but most of my friends who will use it are on Windows 10 so I'll need a method that can work on Windows, macOS and Linux if possible.
Thanks for any help! -Sam
Edit: I have it done for the most-part, yet when I start the game I get Error: Unable to initialize main class net.minecraft.client.main.Main
Caused by: java.lang.NoClassDefFoundError: joptsimple/OptionSpec

Is not so easy as you think :))
You try to make a custom launcher, but minecraft is Java (and bedrock edition is C++) so you need to have a little knowledge and from thins programming language.
For java you need to know how to work with files from .jar (what are just some archives)...
Is not impossible but still not easy.

Related

Best way to protect source code of .exe program running on Python?

I am developing proprietary software that would be distributed in a form of .exe file. In order to use it, users will have to authenticate with their whitelist credentials (username + password).
The issue I have encountered is that in the industry I am selling on, there are a lot of "hackers" who will try to decompile your executable file, get the source code and distribute it for free to other people.
To combat these reverse-engineering attempts, I have tried to both obfuscate my code and use various compilers, but so far to no success.
What I have tried:
Use py2exe compiler: "hackers" managed to decompile executable in an hour.
Use pyinstaller compiler: same as with py2exe.
Use pyminifier to obfuscate the code: "hackers" managed to deobfuscate the code.
Use Oxyry Python Obfuscator: same as with pyminifier.
Those who managed to decompile and deobfuscate my program explained that the open-source nature of the 4 tools mentioned above means that their algorithms are well-known and there are solutions out there made to reverse-engineer programs that use these open-source compilers and obfuscators.
What I didn't try yet:
Using Pyarmor to obfuscate my code. I've heard it is good, but it costs 50$, so I want to be sure that it is the best obfuscation tool out there before purchasing the license.
Using Cython library to create a C-wrapper for my program, making it compiled in C instead of Python. Since C binaries are much harder to read, it will make the program significantly harder to decompile. However, I have never programmed in C, and I want to know if there are better ways to compile my source Python code, without the need to learn C.
What I am not going to try:
Completely rewrite my whole program in a language other than Python. I am not strong in other languages, plus the program itself consists of over 1,000 lines of code, so I can't just completely rewrite it for the sole purpose of making it harder to decompile.
Making program open-source: This is a for-profit software, so I am not going to release the proprietary code, thank you for understanding.
Making the program a web-app: Since my program directly interacts with files on the user's PC, I can't make it web-based, it has to be on the user's PC.
Please also consider that if "hacker" will be able to disable the whitelist system without even accessing the source code, he will be able to distribute it to other users with no limitation. Therefore, I am looking for a way that will not only make it extremely hard to decompile the program, but also make it almost impossible to meddle with binaries and turn off certain parts of the program's code.
Since people in this thread did not provide any satisfiable answers, I will explain what I did to secure my program. As I mentioned previously, my goal is not to create an "uncrackable" program, just one that is secure enough to deter away amateurs.
I got help on one of the reverse-engineering forums, so props to those people!
Firstly, I used Nuitka to convert .py file into a C-based standalone executable. Then, I passed a resulting .exe file through VMProtect to obfuscate the binaries.
I've tested it on a few CS graduates, and they weren't able to crack or deobfuscate the program, so this is good enough for me.
P.S. Those who said that "it is impossible" or "your business model is wrong", please do not share your opinions unless you have a reverse-engineering experience, thank you :)
I guess I'll be the brave one to post as the answer: There is no technical means you can take to prevent software running on end user machines from being cracked.
You can perhaps make it more difficult, but since you've stated that in this market, people will always prefer cracked software to legit at any price, this is a situation you have essentially no hope of winning: if you have determined pirates, they will win every time.
So: You can't; give up
Sorry :-(

Python can't find module "site"

I'm currently trying to run a game which seems to need Python2.2. When I start the game nothing happens, so I brought back my very basic debugging skills and found out that the code calls a function called "InitializeEx" with "site" as parameter, then fails with "ERROR_FILE_NOT_FOUND (00000002)" and exits. I googled and it seems like site is a module of Python.
The problem is I have never had any contact with Python and all this modules-stuff. I think I even have multiple versions of Python installed on my PC (just downloaded 2.2). Can I somehow just download this library and install it?
I'm using Windows 10 Proffesional x64.
PS: I wasn't really sure if I should post this to StackOverflow or SuperUser. So if you are a moderator feel free to move this to the right place :)

What Language To Use To Manipulate OSX Application Windows?

I'm sure many of us have seen vision degradation from too much screen time from programming.
A theory suggests that when they eyes become fixed, tension builds. And that tension causes the vision to slowly degrade.
This software promises to prevent that fixation...
http://www.central-fixation.com/downloads.php
The problem is it's outdated, and Windows only.
I'd like to write a script that will "swing" all open windows according to a set pattern & speed. A script that works with OSX 10.9 and later.
I know Python and Javascript but have no idea where to start on this.
Please help me out.
How is it done? What language is used to manipulate OSX application windows? And/or simply manipulate the whole desktop window space?
I haven't tried to do exactly what you are trying to achieve here, but ANYTHING at all related to manipulating OS X should be done via Automator or AppleScript. If you are running Yosemite, the app is called "Script Editor". Anything older and it's called "AppleScript Editor".
Try this site.
Extract:
tell application "Finder" to set the position of the front Finder window to {94, 134}
I know your question is labeled "python" but I believe that AppleScript is the way to go with this.
You can add AppleScript to an Automator workflow with the "script" object. I'm not sure how to make this run periodically, but one option would be to keep it open in the background. You can do this in AppleScript with the delay command:
(do stuff here)
delay (your delay)
Hope this achieves your purpose.

Python front-end GUI for Linux

I'm planning to take a non-GUI Linux distro (no Gnome, KDE, etc) and build my own front-end GUI for it. While I have a few years of Python programming experience, I have never attempted to do something quite like this.
To be more specific about my project, I'm building a CarPC and I have everything pretty much worked out so far, except the front-end. Most pre-existing front-ends for CarPCs run on Windows and the ones that run on Linux are hard to find (they either quit development or only run on specific hardware). My front-end will always be full-screen and I do not want to run a desktop environment unless I absolutely have to; it would just slow down the boot time and provide unnecessary features.
My question is basically where I should start. What Python graphics libraries are out there that would allow me to build a front-end GUI without a desktop environment?
You'll probably want to look at other answers and questions on this topic such as this one
Another good link is this one on the Python websitewhich lists different GUI toolkits.
While I haven't used it, Kivy looks like a good place to start. It's apparently got touch screen capabilities which I assume you would use and it doesn't look constrained to a GUI desktop env.
Hopefully you can find a way to do this without a desktop env. If not perhaps consider using X11 as your layer and go from there.
You should probably consider DirectFB. You can even use a DE on it if you like (although not required).
WxPython is awesome. I use it with Python and plain WxWidgets in C++ too. I've had great luck with making native GUIs from it and internationalization is supported too. Good luck!
Edit: I missed the "without a desktop environment bit". I'm not sure my answer is relevant. You should edit the Title of the question. Just disregard.

Creating a minidump in a Python application (Windows)

I'm working on a Python application. Sometimes the interpreter crashes when in a third party C++ DLL.
I'm thinking about writing a Python extension that installs a handler for unhandled structured exceptions (Windows) in order to write a minidump to the disk and log the stack trace of every Python thread.
Two questions:
Does a Python extension with a similar purpose already exist? According to my own Google search, nothing seems to be publicly available, but maybe I didn't search enough.
Is it feasible to implement something like this? (I'm experienced in C++ and Windows programming, but have never implemented a Python extension...)
Check out FaultHandler on PyPI.
I recently wanted to do the same thing and created minidumper to do so, and did a small write-up of it here.

Categories

Resources