executable

Run a Python program at start-up on Windows

浪子不回头ぞ 提交于 2019-12-08 02:01:13
问题 I am developing a key-logger on Python (only for curiosity sake). And the script will be an executable. Without access to the computer so the process should not need a UI or user interaction. Is there any way, even in another executable to make the key-logger start at start-up ? 回答1: I don't use Windows, but you can try making a batch script that runs your python file and make that script Run a program automatically when Windows starts: Click the Start button Picture of the Start button ,

creating 100% standalone executable jar that doesn't require the java command

泪湿孤枕 提交于 2019-12-07 12:56:33
问题 so apparently if you create an executable jar, in order to run it you still need the java command: java -jar something.jar but what if I just want it to run without the java command, so just directly from the command line something.jar is there a way to export my java app in eclipse in order to accomplish such 回答1: Excelsior JET - http://www.excelsior-usa.com/jet.html - claims to compile to native code and bring its own runtime support, so it does not require an existing JVM. Commercial

Difference between ./executable and . executable

試著忘記壹切 提交于 2019-12-07 12:43:35
问题 In a shell, what is the difference between? . executable and ./executable In the first one, the dot a shortcut for source right? So is there a difference between ./executable and source executable ? 回答1: is there a difference between ./executable and source executable? basic difference is, ./foo.sh - foo.sh will be executed in a sub-shell source foo.sh - foo.sh will be executed in current shell some example could help to explain the difference: let's say we have foo.sh : #!/bin/bash VAR=100

How do I find out if a .exe is running in c++?

冷暖自知 提交于 2019-12-07 12:20:43
问题 How can you find out if an executable is running on Windows given the process name, e.g. program.exe? 回答1: The C++ standard library has no such support. You need an operating system API to do this. If this is Windows then you'd use CreateToolhelp32Snapshot(), followed by Process32First and Process32Next to iterate the running processes. Beware of the inevitable race condition, the process could have exited by the time you found it. 回答2: I just created one using Hans suggestion. Works like a

Names of PE directories

北城以北 提交于 2019-12-07 10:58:59
问题 I'm working on a PE dissector and came across something rather unusual. The names and order of directories in the PE format seem to differ depending on where you look: From PEReader (perdr): #define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory #define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory #define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 // Exception Directory #define IMAGE_DIRECTORY_ENTRY_SECURITY 4 // Security

How to get the executable path from a Managed DLL

倾然丶 夕夏残阳落幕 提交于 2019-12-07 10:58:46
问题 I have a managed DLL (written in C++/CLI) that contains a class used by a C# executable. In the constructor of the class, I need to get access to the full path of the executable referencing the DLL. In the actual app I know I can use the Application object to do this, but how can I do it from a managed DLL? 回答1: Assembly.GetCallingAssembly() or Assembly.GetExecutingAssembly() or Assembly.GetEntryAssembly() Depending on your need. Then use Location or CodeBase property (I never remember which

Fixing file permissions after modifying in C++?

和自甴很熟 提交于 2019-12-07 10:23:07
问题 I'm saving my data in the executable file of the program. I copy it to a temporary file, overwrite a part starting at a 'magic string' and rename it to the original. I know this is a bad idea, but I'm doing it just for experimenting. I got everything to work so far, except for that I have to re-enable "Allow running as an executable" each time the file is replaced. What ways are there to solve this? Additional information: I use linux. 回答1: If you want to avoid using system(), you can use

Python: Making a standalone executable file on MacOS with py2app

早过忘川 提交于 2019-12-07 07:14:54
问题 I have an application in a python script my_app.py and want to make a standalone executable out of it on a MacOS (10.14). Following the video-tutorial here, I entered sequentially the following commmands: pip install virtualenv virtualenv venv --system-site-packages source venv/bin/activate pip install py2app cd /path/to/my_app.py python setup.py py2app -A with the following setup.py file: from setuptools import setup APP = ["my_app.py"] DATA_FILES = [] OPTIONS = { "argv_emulation": True,

Reducing GCC target EXE code size?

不打扰是莪最后的温柔 提交于 2019-12-07 06:45:08
问题 When I compiled a no-op program: int main(void) { return 0; } with various compilers: GCC (similar result to LLVM as well): Gave a 10-KiB executable (compiled with -s ) Sections: .CRT , .bss , .data , .idata , .rdata , .text , .tls Depends on msvcrt.dll and kernel32.dll MSVC 2010: Gave a 5.5 KiB executable (compiled with /MD /Ox ) Sections: .data , .rdata , .reloc , .text Depends on msvcr100.dll and kernel32.dll Could have been further reduced by merging .rdata with .text Windows Driver Kit 7

Runnable JAR not working with referenced libraries

回眸只為那壹抹淺笑 提交于 2019-12-07 06:35:09
问题 I want to create a runnable JAR that include referenced libraries, namely jackson, in eclipse via the export. There used to be fat jar that seemed to be the goto solution before Eclipse offered to export to runnable JAR. From this question, the first option would be what I'm looking for. Since it is for the moment a small project, it wouldn't be a problem to always have everything together (plus it's easier for me since I'm just starting with JARs, runnables and jnlp) When I try to launch it,