executable

Determine target ISA extensions of binary file in Linux (library or executable)

拈花ヽ惹草 提交于 2019-11-28 16:35:54
问题 We have an issue related to a Java application running under a (rather old) FC3 on an Advantech POS board with a Via C3 processor. The java application has several compiled shared libs that are accessed via JNI. Via C3 processor is supposed to be i686 compatible. Some time ago after installing Ubuntu 6.10 on a MiniItx board with the same processor, I found out that the previous statement is not 100% true. The Ubuntu kernel hanged on startup due to the lack of some specific and optional

How do I compile a PyQt script (.py) to a single standalone executable file for windows (.exe) and/or linux?

瘦欲@ 提交于 2019-11-28 15:58:36
I started to fiddle with PyQt, and made a "beautiful" script from the pyqt whitepaper example app ( pastebin ) It works perfectly in Windows and Linux (with qt environment already installed on both). Now my question is: Since I am trying to use Qt because it is compiled (at least pure old C++ based Qt), how can I compile some .exe file to run it on Windows, or a standalone executable for Linux. The point is that I want the program to be compiled, because of speed and portability, instead of interpreted from source, which would require a previous setup on any machine. One of the goals, for

Adding multiple executables in CMake

独自空忆成欢 提交于 2019-11-28 15:25:13
My code in a C++ project is organised as follows I have several .cpp and .h files which contains my classes I have several .cxx files which have to be compiled against the .cpp files and some external libraries. Now, each of the .cxx files have a main() method, so I need to add a different executable for each of these files having the same name as the file. Also, these .cxx files might not get linked to the same external libraries. I want to write this build in CMake, in which I am kind of a newbie, how do I go about this? André My suggestion is to tackle this in two phases: Build a library

run program in Python shell

£可爱£侵袭症+ 提交于 2019-11-28 15:19:35
I have a demo file: test.py . In the Windows Console I can run the file with: C:\>test.py How can I execute the file in the Python Shell instead? phihag Use execfile for Python 2 : >>> execfile('C:\\test.py') Use exec for Python 3 >>> exec(open("C:\\test.py").read()) If you're wanting to run the script and end at a prompt (so you can inspect variables, etc), then use: python -i test.py That will run the script and then drop you into a Python interpreter. It depends on what is in test.py . The following is an appropriate structure: # suppose this is your 'test.py' file def main(): """This

Why does a binary of one OS (Windows) does not run in other ( Linux) for same underlying architecture? [closed]

99封情书 提交于 2019-11-28 14:28:21
It may be a trivial question but I have hard time to explain to my little brother that a Windows binary will not run in another different OS like Linux even when both the OS are running in the same machine. If the binaries (opcodes) have to be same to execute in the same underlying architecture ( say Intel 32-bit), what are the differences between the binaries of Windows and Linux ( or even Ubuntu and RadHat Linux)? Are there any runtime modification of the binaries at instruction level before execution by the processor? How do I explain in lay man /simple terms that he can understand. The

How to alloc a executable memory buffer?

风格不统一 提交于 2019-11-28 11:38:17
I would like to alloc a buffer that I can execute on Win32 but I have an exception in visual studio cuz the malloc function returns a non executable memory zone. I read that there a NX flag to disable... My goal is convert a bytecode to asm x86 on fly with keep in mind performance. Does somemone can help me? JS You don't use malloc for that. Why would you anyway, in a C++ program? You also don't use new for executable memory, however. There's the Windows-specific VirtualAlloc function to reserve memory which you then mark as executable with the VirtualProtect function applying, for instance,

Running EXE with parameters

拥有回忆 提交于 2019-11-28 09:42:19
I need help in trying to execute an executable from my C# application. Suppose the path is cPath , the EXE is HHTCtrlp.exe and the parameter that has to be passed is cParams . How would I go about this? The reason why the path is a variable is that there are 3 different EXE files to run and the path will change depending on which one will run, same with the parameter string. Any help would be greatly appreciated. Stephan Bauer To start the process with parameters, you can use following code: string filename = Path.Combine(cPath,"HHTCtrlp.exe"); var proc = System.Diagnostics.Process.Start

Error: Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified. Applies for all executables

為{幸葍}努か 提交于 2019-11-28 08:51:24
问题 My goal is to run SVN commands from java for one of my requirements, for the same i have already installed TortoiseSVN command line tool. Added the appropriate path"C:/Program Files"/TortoiseSVN/bin" to my environment "Path" variable. With the above setup, i can run my svn commands from windows command line using say "svn --version" and it works perfectly fine. Now coming back to the code to execute the same, i am using processbuilder for this. However i end up with the above error - java.io

How to determine a windows executables DLL dependencies programmatically?

本小妞迷上赌 提交于 2019-11-28 08:29:36
How to determine what DLL's a binary depends on using programmatic methods? To be clear, I am not trying to determine the DLL dependencies of the running exec, but of any arbitrary exec (that may be missing a required DLL). I'm looking for a solution to implement in a C/C++ application. This is something that needs to be done by my application at runtime and can't be done by a third party app (like depends). Take a look at the IMAGE_LOAD_FUNCTION API. It will return a pointer to a LOADED_IMAGE structure, which you can use to access the various sections of a PE file. You can find some articles

How to make gcc generate only machine code that can be loaded directly into memory and executed?

依然范特西╮ 提交于 2019-11-28 08:20:48
I would like to produce a file that I can load into memory (for example with mmap ) and then jump to the start of that memory to run the code. Ideally, I'd like the option of either making the code relocatable (which might be inefficient) or specifying an explicit address that the code expects to be loaded at (which is a pain), but either one would probably work fine on its own. You can do this but you will need to go through the object file format. In particular, the objcopy command can transform an executable file to a "flat" binary file (depending on your target platform). Perhaps something