executable

How to write and executable Windows .exe manually (machine code with Hex editor)?

心已入冬 提交于 2019-12-02 15:08:54
I'd like to know how is it possible to write something as simple as an Hello World program just by using an Hex Editor. I know that I could use an assembler and assembly language to this at a near machine level but I just want to experiment with really writing machine code in a toy example such as Hello World. This could be a simple DOS .COM file that I can run on DOSBox. But it would be nice if someone could provide an example for an .EXE file for running it directly on my Windows PC. This is just pure curiosity. No... I'm not thinking of writing programs directly in binary machine code (I

Getting the program version of an executable file like explorer does in C# .NET 2 [duplicate]

守給你的承諾、 提交于 2019-12-02 13:19:36
This question already has an answer here: FileVersionInfo doesn't match Details tab in Explorer 1 answer if I make a right-click in explorer on an executable file and choose "properties". then in the properties dialog I select the tab "version". Then I click on the productversion. This is the value which I need to get with c#. I tried it with "fileversioninfo.productversion", but if I get in the explorer "1.85" the fileversioninfo returns me weird values like: 1,00000,8,00. Dots become commas and the last digits are stripped off. I use net 2 on win 7 64 bit, if that matters. fileversioninfo

Can't execute javac or other command line applications in Java using ProcessBuilder under Windows 7

南楼画角 提交于 2019-12-02 12:00:15
I'm trying to execute javac from Java using ProcessBuilder but i get no output and nothing happens. I tried reading the input stream (as there is a bug where the process hangs if i don't read it) but still no results. I originally passed all required parameters to javac but it was not working, so i simplified it down to just javac (which should print the help message). i tried running "C:\Windows\System32\cmd.exe /c C:\\"Program Files\"\Java\jdk1.6.0_23\bin\javac.exe" "C:\\"Program Files\"\Java\jdk1.6.0_23\bin\javac.exe" and surrounding the entire path to javac with double quotes but still

Why won't the loader load at the desired location

北战南征 提交于 2019-12-02 09:47:42
It is said that sometimes the loader loads the exe at an address which is different than the one assumed by the linker. What all could be the cases when loader does so?? mox Basically, this takes place in the following situations: The address at which the image prefers to be loaded is already occupied. For example, there may be another image already loaded there. The image to be loaded has been compiled with ASLR enabled. The FLG_LDR_TOP_DOWN global flag has been set, which forces modules to be loaded at the highest possible address. 来源: https://stackoverflow.com/questions/9698496/why-wont-the

Make a ruby script with text IO double clickable executable file?

谁说胖子不能爱 提交于 2019-12-02 08:00:37
问题 I'm a beginner at Ruby and I don't know how to do this.... Right now I have the script and it runs perfectly in terminal but I was hoping to be able to create a double clickable version of it on the desktop that would then open a window in terminal and run the script. Automator and Platypus don't work. I'm not sure what to do. Thank you in advance. 回答1: Assuming you're targeting Mac OS X (Unix) or Linux you can put this line at the top of your Ruby file to make it compatible with the Terminal

How to run an executable file using Perl on Windows XP?

我只是一个虾纸丫 提交于 2019-12-02 06:52:31
问题 How to run an executable file using perl? For instance, i want to run a plain notepad.exe. How could I achieve this? This is what I've got: my @args = system("notepad.exe"); system(@args) == 0 or die "system @args failed: $?"; But it returns: Can't spawn "cmd.exe": No such file or directory blah blah blah. What am I missing? 回答1: Try this. my $prog = "C:\\strawberry\\perltest\\Extractor.bat"; if (-f $prog) # does it exist? { print "Will run notepad"; system($prog); } else { print "$prog doesn

How to give executable permission to all Python scripts in Linux?

你。 提交于 2019-12-02 06:03:23
问题 Suppose I have a python script called a.py like this: #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author : Bhishan Poudel # Date : Jul 13, 2016 # Imports # Script print("hello") I can run this scripts in two ways: Using python interpreter: python3 a.py Changing permission chmod a+x a.py; ./a.py QUESTION How can I run any new or old python scripts without using chmod a+x script_name all the times. I have root access and user access both to my computer. Basically i want executable

I have managed to compile java-program but I cannot execute it

雨燕双飞 提交于 2019-12-02 05:01:44
问题 I have just installed JDK on Windows Vista. After that I set proper values for the 4 environment variables: classpath, include, lib, path. After that I was able to compile my HelloWorld-program (I got a *.class file). But when I try to execute the compiled program (I type java HelloWorldApp) it does not work. The Java write a lot of stuff and in the end it is written that it "could not find the main class: HelloWorldApp". Can anybody, pleas, help me with this problem? 回答1: create a file

Printing out the names of implicitly linked dll's from .idata section in a portable executable

故事扮演 提交于 2019-12-02 04:04:58
I am trying to write a code which is supposed to print out the names of all the imported dll's in the exe by using the 'name' field of the IMAGE_IMPORT_DESCRIPTOR structure in the .idata section of the exe, but the program seems to be getting stuck in an infinite loop. Can someone please tell me how to get the names printed out correctly... #include<iostream> #include<Windows.h> #include<stdio.h> #include<WinNT.h> int main() { FILE *fp; int i; if((fp = fopen("c:\\Linked List.exe","rb"))==NULL) std::cout<<"unable to open"; IMAGE_DOS_HEADER imdh; fread(&imdh,sizeof(imdh),1,fp); fseek(fp,imdh.e

Output of 'make' is a shared object and not an executable

北城以北 提交于 2019-12-02 02:59:58
问题 Edit: It appears to be a g++ issue, as compiling with clang++ does output an executable file. I've written a C++ application that has a main function, creates an application window, loads a 3D fbx file and draws that using opengl. To create the Makefile for compiling i'm using a CMakeLists.txt file: cmake_minimum_required(VERSION 2.8) project(solight) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") INCLUDE_DIRECTORIES(lib/include) ########################################### #SET THIS TO