|
Yeah. I see no technical reason why an .EXE can't have exports (the PE file format would allow it) but when I've tried (in the past) it hasn't worked.
Steve
|
|
|
|
|
really stephen u seem to read my mind.;)
Yes I tried to learn about Portable Executables but dont know how to implement them in VC++6.0. CAn you help me out please. i mean i really am a mediocre with C++
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
All EXEs and DLLs produced by VC++6.0 are PE files. Even dotNET assemblies are PE files.
Steve
|
|
|
|
|
ok then here is wat you will feel is useful
1)I've set of few classes
2)I'm not allowed to change anything in "1"
3)I'll create my own class(es) and rebuild it along with the above set.
now tell me when there is no scope of creating an EXE only using '1)' how do i access the private methods residing in '1)'. To do that i thought of using the base address to offset and locate the desired method or else use the name mangles and resolve.
now in this scenario how eil PE help me out. Just let me know how does my flow of work should be and where sould PE fit in
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
This is what you're trying to do but should not even consider:
#include "stdafx.h"
#include <windows.h>
class CMyClass
{
private:
void Private();
};
void CMyClass::Private()
{
MessageBox(NULL, "CMyClass::Private", NULL, MB_OK);
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
typedef void (CMyClass::*PMyClassMemFun)();
PMyClassMemFun pFunc;
*reinterpret_cast<ULONG_PTR*>(&pFunc) = 0x00401020;
CMyClass inst;
(inst.*pFunc)();
return 0;
}
Again I reiterate; this is perverse but that's code to do what you we're trying to do.
NOTE: You have to compile this code and then get the address from the map file. There is no guarantee your address is the same as mine. Any code changes and the address could change.
Steve
|
|
|
|
|
Stephen Hewitt wrote: *reinterpret_cast<ulong_ptr*>(&pFunc) = 0x00401020; // From map file
yes i too did use the address statically. I wanted to ask you if at all I can get the address while i'm building only. Remember I said I can't go for EXEs alone with source class set.\
Thanks anyways. Your help is really solicited.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
I mean all is adhering to my requirements only one thing that I'm using static address. Is there no method to get the address from mangled name
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
Theoretically even recompiling the EXE to update the address could change the address (although in practice this is unlikely). The best approach would be to read in the address at runtime from a file you produce after the build is complete by parsing the map file. Not that I approve of such things; private functions are private for a reason.
Steve
|
|
|
|
|
Exactly...what i thought ou too said.
I know how VC mangles the name so I can parse and read the Address. But now in this again i've a doubt. When I compile the files(source classes) then try to build it along with my classes. So the earlier one will generate a map file
Will the address remain the same when i rebuild the application along with my class(es)
Am i too ambiguous???
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
hi steve
your help has pulled me off a catastrophe. I did the tokenizing of the .map file and could retrieve the address. noe since the address is of a string type in the as 0x00401190 so now i need to convert it into a HEX format. then I can pass it as an address where earlier we were passing the constant adress.
So the dangling pointer error is removed. thanks for the immense help you have provided
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
I did a conversion for string type to unsigned long using strtoul() method. Now works fine
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
So when I could achieve it in VC now next comes in line is GCC where the name mangling starts with _Z and then few traits are there. Anyhow can you help me out in generating the map file for a GCC environment.
I mean a detailed help. I really am greatful to you for the help you extended hence looking forward for a next one;).
Thanks steve!
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
Hi to all
i m working on smtp in MFC environment i want to know the format of sending comand for authentication
when i give command EHLO
then i got
250-cm-ms5.globat.com
250-PIPELINING
250-SIZE 655360000
250-ETRN
250-STARTTLS
250-AUTH DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
250-AUTH=DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
250 8BITMIME
after this i issue AUTH CRAM-MD5
i get 334 PENCeUxFREJoU0NnbmhNWitOMjNGNndAZWx3b29kLmlubm9zb2Z0LmNvbT4=
But when i send user name and passward i get again 334 with some value like above
what should i do to get 235
Thanks in Advance
|
|
|
|
|
Hello there
I am trying to move my CE based application from wCE 3/4 to vs 2005. I found out that all my database handling code needs to go into the bin, and I need to start from scartch...
My question, what should I use now - fro Windows Mobile 2003 / ARM architecture, C++ within vs 2005. It seems all my desire to use ADO is getting me to a dead end...
Hope someone can help
Thanks
Alex
|
|
|
|
|
Hi All,
Can anyone tell me as how I convert from a 2-dimensional charater array to a CStringArray.
Thanks
Subramaniam S.V.
|
|
|
|
|
I would imagine that you can iterate over the outer array, and if the inner array is of strings, you can builds a CString from each and put it in your array.
I'd advocate using std::vector, I always prefer C++ to external libraries where possible. They're standard, and they are better.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
No it is giving junk value when I try to assign Char[] to a string
|
|
|
|
|
Hi.
How do you plot x-y graph using visual C++ 6?
|
|
|
|
|
You would create a CBitmap, then you'd select it into a CDC, then you'd draw lines on it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
UnknownBlue wrote: How do you plot x-y graph using visual C++ 6?
CDC::MoveTo and
CDC::LineTo
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Thanks. Can that method be applied given two arrays, one for x axis and the other for y axis to plot the graph?
|
|
|
|
|
You could also use a chart control from this website. I developed one myself: follow the link in my sig.
I think it will make you gain some time.
|
|
|
|
|
Hi...I have some batch files that I want to execute upon the press of a button on my GUI. The batch files run some executables that setup parameters on another computer. At this point I cannot incorporate these executables into my GUI or change the executable in anyway. I want the console to remain hidden after the batch file has run, however I would like to display the console output to an edit box on my GUI. I have researched this a little bit and everything I find seems really complicated. Is there an easy way to pipe the console to my application? Or what options might I have? Thanks!
Clint Smith
|
|
|
|
|
|
Hi,
I try to use variable=2^2 to get the answer 4. BUt actually do not work in MFC Visual C++.
Why?
|
|
|
|