executable

How to read Mach-O header from object file?

我们两清 提交于 2019-12-04 00:11:09
I have spent the past few days experimenting with assembly, and now understand the relationship between assembly and machine code (using x86 via NASM on OSX, reading the Intel docs ). Now I am trying to understand the details of how the linker works, and specifically want to understand the structure of Mach-O object files, starting with the Mach-O headers. My question is, can you map out how the Mach-O headers below map to the otool command output (which displays the headers, but they are in a different format)? Some reasons for this question include: It will help me see how the documents on

Create a Python executable with chromedriver & Selenium

只愿长相守 提交于 2019-12-03 22:22:42
I have created a small web scraping app using Selenium & chromedriver for a project that outputs the content into an excel file. The people I did this app for unfortunately aren't the most tech-savvy. So my question is how can I share this app with these people? I looked into py2exe.org, but it doesn't take the chromedriver into account when creating the executable. Any better ways of doing this, without these people having to add the files manually to their "usr/bin"? You can do this with the help of pyinstaller : Below is the solution which work on Windows but pyinstaller says its capable of

The simplest way to create jar file?

大憨熊 提交于 2019-12-03 20:40:22
I have a java project and i need to create jar file from my project . any body can tell me what is the simplest way to make this? From scratch.. with CMD The command line is what almost every other application will use to build your JAR file. They just wrap it up a little nicer for you. In truth, it's very simple to do yourself. Obviously Java have explained this way in detail so there is no sense in me repeating it. Note : You need to have your JDK/bin directoy appended onto your %PATH% system variable to be able to use this method. Double Note : As pointed out in the comments, I'd suggest

How to make an executable file in Python?

[亡魂溺海] 提交于 2019-12-03 20:01:18
问题 I want to make an executable file (.exe) of my Python application. I want to know how to do it but have this in mind: I use a C++ DLL! Do I have to put the DLL along side with the .exe or is there some other way? 回答1: py2exe can generate single file executables. see this link for examples. The setup.py I use uses the following combination of options: 'compressed': 1, 'optimize':2, 'bundle_files': 1 I usually add external dlls (p.e. msvcr71.dll) in the same folder where the executable is. To

How long does a batch file take to execute?

左心房为你撑大大i 提交于 2019-12-03 19:48:02
问题 How can I write a script to calculate the time the script took to complete? I thought this would be the case, but obviously not.. @echo off set starttime=%time% set endtime=%time% REM do stuff here set /a runtime=%endtime%-%starttime% echo Script took %runtime% to complete 回答1: Two things leap out about the original batch file. but neither is going to help in the long run. Whatever your benchmark method, be sure to capture the start time before the operation, and the end time after the

chrome/chromium extension: run a executable/script via the context menu

女生的网名这么多〃 提交于 2019-12-03 17:52:24
问题 I'm writing a small chrome extension for personal use and I would like to run an executable via the context menu and pass certain information as arguments to said executable. What the simplest and/or cleanest way to achieve this? To me it seems that it is impossible due to chrome's sandboxing. 回答1: This can be accomplished via NPAPI Plugins. Code running in an NPAPI plugin has the full permissions of the current user and is not sandboxed or shielded from malicious input by Google Chrome in

Compile stand alone exe with Cygwin

拜拜、爱过 提交于 2019-12-03 14:54:55
I want to make a stand-alone exe with cygwin. I have two options: Staticly link cygwin1.dll If I can statically link cygwin1.dll, then I can get a stand-alone exe. Merge cygwin1.dll with myprog.exe If I can merge cygwin1.dll with my program, the I can get a stand-alone exe. Do not suggest that I use IlMerge. This will not work because I didn't compile my program with .NET. Are any of these options possible? If not, is there anything that is possible with this dilemma? Thanx! I can see two possibilities that you might consider reasonable. One would be to build a stub executable with a different

Is there a Perl equivalent to Python's `if __name__ == '__main__'`?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 14:35:46
问题 Is there a way to determine if the current file is the one being executed in Perl source? In Python we do this with the following construct: if __name__ == '__main__': # This file is being executed. raise NotImplementedError I can hack something together using FindBin and __FILE__ , but I'm hoping there's a canonical way of doing this. Thanks! 回答1: unless (caller) { print "This is the script being executed\n"; } See caller. It returns undef in the main script. Note that that doesn't work

CMake linking problem

懵懂的女人 提交于 2019-12-03 14:31:23
I am trying to use CMake to compile a C++ application that uses the C library GStreamer. My main.cpp file looks like this: extern "C" { #include <gst/gst.h> #include <glib.h> } int main(int argc, char* argv[]) { GMainLoop *loop; GstElement *pipeline, *source, *demuxer, *decoder, *conv, *sink; GstBus *bus; /* Initialisation */ gst_init (&argc, &argv); return 0; } This works: g++ -Wall $(pkg-config --cflags --libs gstreamer-0.10) main.cpp -o MPEG4GStreamer How to I make it with CMake? My CMakeLists.txt file looks like this: cmake_minimum_required (VERSION 2.6) project (MPEG4GStreamer) add

How to embed an executable in my project

偶尔善良 提交于 2019-12-03 14:23:46
I would like to embed a command-line executable in my Xcode/Cocoa project, to then start it with NSTask. Which path should I use in the setLaunchPath ? Thanks ! Ernesto you should add it to your resources folder. Then, in runtime, read the app's resource bundle path, and append the name of the executable (including subfolders if you add it to a folder inside the resource bundle) For instance: NSString *execPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"binaryname"]; NSTask *task = [[NSTask alloc] init]; [task setLaunchPath: execPath]; 来源: https://stackoverflow