Are process image and executable file different? - process

What is the difference between the two?
Is the process image a file that is stored and managed separately from the executable?

yes they are exactly same things.

Related

How to find the path from where an app is started?

I put my EXE files (usually to edit/convert ASCII files) in an own directory. The directory path is also put in the PATH variable of the system, so I can start the programs from anywhere. So here my question:
Is there a way (in VB.net) to find from where I started my program?
I need to know that to put that path as initial directory for the openFile-Dialogues.
Thanks for your help,
Jan
There are a few ways to do this. Here are two:
System.AppDomain.CurrentDomain.BaseDirectory()
Or:
Application.StartupPath
Both will return strings of the path where your app was started.
Read more:
https://msdn.microsoft.com/en-us/library/system.appdomain.basedirectory(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/system.windows.forms.application.startuppath(v=vs.110).aspx
EDIT:
There is also this way, which checks the path based on the current executing/executed assembly:
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
https://msdn.microsoft.com/en-us/library/aa457089.aspx
But personally I'd recommend the above two.
Ok, I found a quite simple answer. I already tried it once, but apparently under different circumstances. The right function is just CurDir(). Thanks for your efforts.

I want to know how "inotifywait" trace file's operation

I used "inotifywait" to trace the file's operation. I want to know its structure. How does it know that a file is created, read and deleted? How does it know that a directory is created and removed? What are kernel's files that inotifywait tracks. Which kernel's files doing these file's operation? Please help me find out. Thank you.
inotify is a feature built into the kernel (first included in version 2.6.13). Since a file create request or a file close (on write complete) request needs to go through the kernel, it is implicitly aware of all these operations. Same goes for directories, since the kernel is aware if the file created is a directory or not.
Which kernel's files doing these file's operation?
Are you asking for the inotify source code? You could possible start by looking at the header files here: http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/include/linux/ (inotify.h)

Getting batch variables

Hi there. I am busy with making kind of script in batch.
I need to insert into it kind of "Resume" function.
I know how to write variables into a file.
But is it possbile to get it back?
Is it possible to get variables from registry?
I found a nice BAT => EXE converter. It looks really professional if you run .exe in place of .bat. I would like the user to download .exe installer of my batch program, and install the real program. But is it possible to install it (place file of program) as .exe? I don't know much about .exe languages.
If I understand your questions correctly,
Do you want to read a variable that was previously written to a file back into the batch script? Yes, it is possible to read a file into a variable as long as you know the file's format.
Yes, it is possible to read keys and values from the registry using the reg command.
Once you convert a .bat script into an .exe you can distribute it however you like. Place it in a .exe installer, zip it in a archive.

run ffmpeg with multiple threads

Ok i have learnt how to convert videos files using vb.net and ffmpeg. But as far as i know we cannot use multiple threads to run same exe file to convert files. Do you know how i can convert multiple videos using one external exe file (ffmpeg)?
I have not tried because my computer time was over. So iam just asking a general doubt whether if we attach it to one process then wouldn't the process get locked? Then can we multi-thread this application or not ?
Thanks in advance.
But as far as i know we cannot use multiple threads to run same exe file to convert files.
You are mistaken. Multiple FFmpeg instances (1st level OS processes) can run on a single machine. I'm doing this in Java myself. You can even use the same source file. (Obviously, you cannot allow each individual instance to use the same target file.)

How are self-extracting executables made?

There are many programs out there that will allow you to pack a few files together and generate an executable that has the necessary code to extract them. Somehow, those files are residing inside the executable. I am interested in doing the same thing; how is this done?
FYI, I'm interested primarily in Windows .exe files, if it makes a difference.
Look at this: Article
You could probably save a file/files in a resource, compile it into the exe then use some code in the exe to extract it out to a file.
ie:
http://www.codeproject.com/KB/winsdk/binaryresources.aspx
Self extracting .exe files are usually archive files (zip, rar, tar, etc) concatenated together with a small program that does the extraction then executes the program that was extracted from the archive.
A really sophisticated one could extract the archive into memory and then jump to the extracted code and run it, but back in the old days, that sort of thing was easier to do.
If you wanted to write your own in Windows, you would create a small console application that did the extraction, and you would include the 'real' program in the console programs' resources.
There are also products like pkzip and winzip which do it for you. If your time is worth anything, those would be more efficient.
UPX is a well known packer for Windows .EXE which can be found here on WikiPedia. And here is the main site on sourceforge for UPX.
Hope this helps,
Best regards,
Tom.