|
Pablo_Escobar,
I wrote a program like this a couple of monthes ago, except that it wasn't supposed to remove the MS DOS stub,...it was just supposed to analyze the structure of the DLL or executable and write an enormous amount of data to text file. It was a very memory-intensive application. There are no standard Microsoft APIs to do this efficiently. And, what you want to do is definately possible, you're just going to have to read through the available documentation and write alot of code.
You will find this reference invaluable: Microsoft Portable Executable and Common Object File Format Specification[^].
...and, YES, read anything you can find that Ashkbiz Danehkar has written CodeProject Articles by Ashkbiz Danehkar[^], he's excellent.
|
|
|
|
|
i must finish a project that how to make football schedule..but i don't know how to develop or to coding this program..anyone can help me?? any example, post to mohdameirudin@yahoo.com
modified on Saturday, April 11, 2009 4:14 PM
|
|
|
|
|
|
extern "C" __declspec(dllexport) bool setHook(DWORD dwThreadId)
{
printf("set Hook!\n");
if (dwThreadId != 0)
{
hkprcSysMsg = GetMsgProc;
hHook = SetWindowsHookEx(WH_GETMESSAGE,hkprcSysMsg,hInst,dwThreadId);
if (hHook != NULL)
{
printf("OK\n");
return true;
}
else
{
int err=GetLastError();
return false;
}
}
return false;
}
LRESULT WINAPI GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam){
printf("Hook!\n");
PROC fpOri = GetProcAddress(GetModuleHandle(TEXT("Wsock32.DLL")),"connect");
HMODULE hmodCaller = GetModuleHandle(TEXT("OpenApplication.exe"));
fp5 connect5=connect1;
ReplaceIATEntryInOneMod("Wsock32.DLL", fpOri,(PROC)connect5, hmodCaller);
return (CallNextHookEx(hHook, nCode, wParam, lParam));
}
this is two functions in my dll file to inject my dll into iexplore, why the hook function GetMsgProc never be called, and when will the function be called?
who can share the complete code from DLL injection and replace my dll file instead of system dll file
|
|
|
|
|
What you're looking to do, is to replace functions, and not just hook to the message loop...
I think the easiest and fastest way to do so is to use easyhook.
Check out EasyHook (it's a project in codeplex.com, so you'll have the code).
It's an awesome framework for hooking. you can use it to replace the functions you want (Even works for kernel!).
|
|
|
|
|
We are happy to announce the release of NUI: http:/www.libnui.net[^]
NUI is a C++ application framework that runs on the iPhone, MacOSX (universal), Win32 and Linux.
Its main distinctive features is its use of 3D hardware to render the UI via OpenGL, GL Es and Direct3D.
Its features include:
- Low level abstraction: string, files, paths, streams, network, timers, threads, mutexes, etc.
- Widget layout engine
- Really many widgets: text, grids, boxes, collumn views, tree views, etc.
- Integrated widget tree visual introspection/debugging
- Web-like CSS engine
- Modern rendering and compositing engine
- Animations for widgets and their attributes
- Attributes to remote control widgets
- Audio IO and Audio file loading/saving (including compressed audio files decoding)
- Stable and proven lib: many applications have been released since 2001 with NUI at their core.
- ...
The lib is dual licensed under the GPL and commercial licensing for non free software developers.
Check out the website for more information: http://www.libnui.net[^]
Thank you very much,
Sebastien
modified on Saturday, April 11, 2009 6:23 AM
|
|
|
|
|
Sounds like pretty good stuff! But the link leads to a page saying: Bad Request (Invalid hostname)
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Woops, sorry, I fixed the URL!
Thanks for the heads up 
|
|
|
|
|
Looks nifty. I see myself using it in the near future.
I 5 voted your original post.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi,
Suppose if i have an test.msi in my machine and im executing it (by double clicking on it..)now the requirement is i need to get the path of the msi from where it"s getting executed...Please help me...and correct me if im wrong..
|
|
|
|
|
And what does it have to do with C++?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
i need to getpath from where msi is getting executed....
|
|
|
|
|
I said "And what does it have to do with C++"?
Again, which msi? A specific installer or any msi? You want to be notified of an msi file being executed, or you want your code to be within the msi file and be able to determine the path where it is being executed from?
If you are too lazy to explain your issue, then why do you think anyone should take their time to give you a decent answer? (not to mention without knowing what the query itself is.)
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Sorry for not being clesr....
i want my code(may be any script also..) to be within the msi file and be able to determine the path where it is being executed from...
|
|
|
|
|
Your query is not relevant here. Try the General IT issues[^] instead, or even better find out some setup and deployment community and ask your query there.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi,
did you got the solution for this?
how to get the .msi path means from which location we are installing?
if you got please share that code i really need that urgent
Thanks In Advance
--Naren
|
|
|
|
|
MFC, STUDIO 2008, MDI-project
Why can’t [impossible] to shift ( move ) dialog window?
|
|
|
|
|
Could be because you haven't read the guidelines.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hello all,
As you all probably know I am very new to programming. I am trying to understand the terminology involved with programming. So if you all do not mind, lets use the following example as I try and explain it. Please refer to the following link:
http://msdn.microsoft.com/en-us/library/aa446675(VS.85).aspx[LINK]
GetUserObjectSecurity is a function. Its function is a member of what?
does GetUserObjectSecurity have to be included in int main() ? If not can you please explain the reasoning?
If you look at the link I provided above, on the page it has a syntax block. In the syntax block, it is refering to BOOL. Now I have seen bool and BOOL and was wondering if this is included in your source code? I read that BOOL is the older version of bool? And all bool is for, is for true/false correct?
I also read that bool is a type of int, meaning could you use bool main() ? Obviously I am confused on this. Also when you use bool, is it required to be typed out in your source, or is it implied by some <header> file? How do you properly use bool? I also read that bool uses one (byte), versus BOOL uses 32(bits). Why is this?
When using GetUserObjectSecurity, what are the usages of the parameters? Can anyone provide an example with an explanation?
Thank you all so very much for your time and effort in helping me learn C++ and to continue my academic future.
V/R
Rob
|
|
|
|
|
rbwest86 wrote: GetUserObjectSecurity is a function. Its function is a member of what?
I don't quite get this. If you're asking "where" is this function located, then I would say it is within a DLL named User32.dll , and comes with a companion lib file named User32.lib (The prototype is defined in Winuser.h , which is in turn included by Windows.h ). So when you link to User32.lib , you could use the function like using a function that is within your code.
rbwest86 wrote: does GetUserObjectSecurity have to be included in int main()
You don't "include" a function, you call it. You can call this function, wherever you want to, given that you've included the relevant header file and linked to the relevant library, discussed above.
rbwest86 wrote: I read that BOOL is the older version of bool? And all bool is for, is for true/false correct?
BOOL is actually int , defined like this: typedef int BOOL; (I'm not sure about the file, just right click and select go to definition.) Also, Google for "BOOL vs bool".
rbwest86 wrote: Is BOOL older version of bool?
No.
rbwest86 wrote: And all bool is for, is for true/false correct?
Yes.
rbwest86 wrote: I also read that bool uses one (byte), versus BOOL uses 32(bits). Why is this?
BOOL uses 32 bits because it *is* an integer (discussed above). bool is limited to work with true and false . But with BOOL , you could use any integer. And this can come handy, if you're returning BOOL from a function and you could:
* return -1 to indicate that the function failed
* return 1 to indicate that the function succeeded
* return 5 to indicate that the something went wrong, but the error was handled. (A file wasn't existing, but it was created and written into)
* etc.,
rbwest86 wrote: Also when you use bool, is it required to be typed out in your source, or is it implied by some file? How do you properly use bool?
bool is an in-built datatype. You do not have to include any headerfile to use it. However, to use BOOL , you may have to include the headerfile, which defines it (right click on BOOL , select go to definition. That should show you the header file)
rbwest86 wrote: When using GetUserObjectSecurity, what are the usages of the parameters? Can anyone provide an example with an explanation?
The MSDN doc page what you gave us, has an example link for the same function at the bottom. It is here[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
HI,
can any body help me as i m trying to make a resource dll to provide multilingual support for my application, is it possible to create resource file with only string tables for different languages without adding dialog boxes to it.
Thanks in Advance
Varun Bhatt
|
|
|
|
|
And why do you think it is not possible?
To create a resource only DLL check out this link.
Creating a Resource-Only DLL[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I have a dialog based application named: basicreport
and created
one dialog called: CExternalDataDlg ,
3 property page called: CImportPage, COptionPage, CConfirmPage
and 1 property sheet named: CImportPropertySheet.
inside: BOOL CBasicReportApp::InitInstance()
BOOL CBasicReportApp::InitInstance(){
......
CExternalDataDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
return FALSE;
}
CExternalDataDlg displayed correctly, worked fine!
I have change above code to:
BOOL CBasicReportApp::InitInstance(){
......
CImportPropertySheet importWizardSheet(_T("Import Spreadsheet Wizard"));
CImportPage importpage;
COptionPage optionpage;
CConfirmPage confirmpage;
importWizardSheet.AddPage(&importpage);
importWizardSheet.AddPage(&optionpage);
importWizardSheet.AddPage(&confirmpage);
importWizardSheet.SetWizardMode();
m_pMainWnd = &importWizardSheet;
INT_PTR nWizardResponse = importWizardSheet.DoModal();
if(nWizardResponse == ID_WIZFINISH){
AfxMessageBox(_T("Importing..........."));
}
else if(nWizardResponse == IDCANCEL){
AfxMessageBox(_T("Cancel"));
}
else{
}
return FALSE;
}
CImportPropertySheet displayed correctly, worked fine!
but when i combinated the both above into once. It looked like
CExternalDataDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
CImportPropertySheet importWizardSheet(_T("Import Spreadsheet Wizard"));
CImportPage importpage;
COptionPage optionpage;
CConfirmPage confirmpage;
importWizardSheet.AddPage(&importpage);
importWizardSheet.AddPage(&optionpage);
importWizardSheet.AddPage(&confirmpage);
importWizardSheet.SetWizardMode();
INT_PTR nWizardResponse = importWizardSheet.DoModal();
if(nWizardResponse == ID_WIZFINISH){
AfxMessageBox(_T("Importing..........."));
}
else if(nWizardResponse == IDCANCEL){
AfxMessageBox(_T("Cancel"));
}
else{
}
}
else if (nResponse == IDCANCEL)
{
return FALSE;
}
return FALSE;
The ExternalDataDlg displayed, when i press OK button on ExternalDataDlg the CImportPropertySheet blink and the immediately disappear without any action by user.
i dont know why? Please kindly advise
modified on Saturday, April 11, 2009 9:16 AM
|
|
|
|
|
Image *pIm = bm.GetThumbnailImage(size.Width, size.Height);
ImageType imt = pIm->;GetType();
Bitmap *pBm = dynamic_cast<bitmap>(pIm);</bitmap>
I need an HBITMAP object, so I need a Bitmap first.
In this code, imt will be ImageTypeBitmap ,
but pBm will be NULL . What is the problem?
Though Graphcs::DrawImage can do the work, but it's better
to save a Graphcs object.
|
|
|
|
|
Hello,
Right now I am facing a program to program the program I'm willing to use in my project.I am using a at89s52 micro controller to trip a few relays as per my convenience. but the problem i am facing is to program my microcontroller i.e., in writing the source code for my micro controller...
hope I got the response..
vikram singh
|
|
|
|
|