|
The first argument to execl should contain the full path to the executable you want to run:
execl("/bin/ls","ls",NULL);
|
|
|
|
|
i understant that if i have parameters i shoud write
execl("/bin/date", "date", "-u", NULL);
how can i write the same thing with execv ?
|
|
|
|
|
Also execl returns a value that can help you tell why it isn't working.
Such as '2' which seems to pretty much always mean that it couldn't find the file it needed to execute.
|
|
|
|
|
Hello Friends
I am having a file in binary mode.Now, I want to read it So that I can get the format of that File.
Is ther any way in MFC or Win32 to reverse it ?
Thanks In Advance.
regards
yogesh
|
|
|
|
|
Unless you know the format of the file contents there is not really any way to do it. You can try some guesswork and logical tests (I have done similar in the past) but it is really down to looking at the content, and figuring out what each byte or set of bytes is supposed to represent.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
What do you mean with getting the format? If it's a binary file and you don't know how to interpret its contents, I don't think you can get a format.
Regarding the reversion, thats quite easy, although I don't see the point in doing it. You could use the functions fread(), frwite() and the like to read it into a large enough char array, loop through it from back to front and write it byte by byte into a new file (assuming is is small enough to fit into memory).
|
|
|
|
|
thanks Guys For your valuable replies.
|
|
|
|
|
yogeshs wrote: Is ther any way in MFC or Win32 to reverse it ? Reverse engineer, or reverse the contents?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
There is a free game development tool called "Wolf RPG Editor". Details on the following site,
http://www.silversecond.com/WolfRPGEditor/[^]
The problem is that its been written in Japanese. Using Resource Hacker[^] I managed to translate one of the configuration tools that came with it. For reference here are screenshots of my efforts,
BEFORE,
http://img507.imageshack.us/img507/4545/configjapanese.jpg[^]
AFTER,
http://img811.imageshack.us/img811/3365/configenglish.jpg[^]
My next plan is to try and work with a few friends to translate the rest of the tool. Basically, it revolves around changing the text in the dialog boxes. The problem I'm facing is how to manage such a team effort.
Does anyone know a way (or utility) to extract the resources from a windows executable, split it into different files and then merge it all back together?
As useful as Resource Hacker is, its essentially a one-man tool. I'm looking for something that would let me work with a version control system for this.
On the legal side of things, I've been led to understand that the original developer has granted permission for translation efforts (admittedly, hearsay from others). The way I see things, since its a free tool and because I'm only translating it, there shouldn't be any trouble.
-chronodekar
|
|
|
|
|
There's a bunch of commercially availble tools for the job, you could check out Deja Vu, SDL Passolo or Idiom. If you google around for Flexytrans, you may find that one (it should be for free if you manage to find it).
The more elaborate tools have loads of functions for working in teams. For the simpler ones, use the Clipboard to export the strings to text files.
|
|
|
|
|
Compile same code twice, why the result(exe) is not same。both release mode and debug mode exist the same problem。if want to get same result, how to setting to the project, such as compile option。
|
|
|
|
|
What did you do, exactly, to get to this observation? Usually, when you build a project, you overwrite the previous build, so there's nothing to compare it to.
|
|
|
|
|
The differences are probably superficial. For example, an exe or dll contains a date-time stamp which specifies the time it was linked.
Steve
|
|
|
|
|
Can you explain little more please. What do you mean that result is not same? output?you just clear all in build option and rebuild the solution again.
|
|
|
|
|
I suppose you are compiling with VS. What differs is a timestamp added by compiler (more precisely, by linker). I don't remember where, but I think is somewhere in IAT. You can patch those bytes (I think is a __int64, most likely a FILETIME) either by patching the binary or by setting system time (not sure since you don't know when exactly the linking occurs).
Nuclear launch detected
|
|
|
|
|
Hello every body
how can we add two different or more images in a same row using CListCtrl MFC.
Best Regards
Sarfaraz
|
|
|
|
|
Please don't repost the same question. You have already asked this in the Q&A section.
|
|
|
|
|
Is it possible in C++ to declare a pointer as long?( like long int).
I'm reading some string from a XML file and assigning it to a <code>const char*</code> variable.
But the application crashes, when string is huge. Is there any maximum limit for char * variable?
How to avoid the crash,when the string is huge?
|
|
|
|
|
pix_programmer wrote: Is it possible in C++ to declare a pointer as long?( like long int). On most platforms, both are 32-bit so there would be no difference.
pix_programmer wrote: Is there any maximum limit for char * variable? A pointer just points to something.
pix_programmer wrote: How to avoid the crash,when the string is huge? Showing the relevant code, for starters.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
A pointer is a pointer is a pointer; it is a fixed size and has nothing to do with the length of the item(s) that it is pointing to. You need to use your debugger to investigate why your program is crashing.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
pix_programmer wrote: I'm reading some string from a XML file and assigning it to a <code>const char*</code> variable.
That doesn't make sense. A pointer can only be sensibly initialized within the program, at runtime, because only then does the computer know where in memeory every object lies. Therefore it doesn't make sense to either store or restore a pointer to/from a file!
What you need to do instead is:
1. read that string from your file
2. Allocate a char array on the heap that is big enough to contain that string (including the terminating NULL character!)
3. Assign that array to your pointer
4. Store the string in that char array.
Of course, if you use std::string , that would save you some of that efort.
|
|
|
|
|
Stefan_Lang wrote: Therefore it doesn't make sense to either store or restore a pointer to/from a file! I think the "it" the OP was referring to was the string, not the file.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I'm not so sure - he (or she) asked about using a bigger pointer type after all.
In any case, I've found that it's often better to take a question literally - if it isn't meant that way, it helps the author to improve on it and provide a better description of the actual problem.
|
|
|
|
|
Application crash has nothing to do with the size of the pointer. You should show us the relevant code to get better help.
Veni, vidi, vici.
|
|
|
|
|
A pointer is just a pointer, just pointing to something. I think your application is crashing with some other reason. just debug the code and ensure what is the problem.. if you are using visual c++ just using LPCTSTR variable for storing string data read from xml.
|
|
|
|