|
If you want to exclude some functions in a DLL just hava a look at some articles on codeproject.com that describe how to develop a library.
|
|
|
|
|
Any info example or link with tutorial is welcome i searched google and didnt find nothing good.
I want to patch the call of the function so not do modify the original bytes of the function. I dunno if patching is same as redirection buth searched info for bouth didnt find anything. I want to redirect / patch a dll function return address to my addres ok thnx .
|
|
|
|
|
I don't really get what you're trying to do.
why don't you just get the original function's result, and add your calculation on its result then ?
|
|
|
|
|
Can ya do a example for me
|
|
|
|
|
nah1337 wrote: Can ya do a example for me
you're kidding, right ?
|
|
|
|
|
No im not see this
I want to redirect/ patch a call of the 10003DD7 function its addres is 0x0003DD7 and calls vsnprintf what addres is 0x0076533
int sub_10003DD7(char *Dest, size_t Count, char *Format, ...)
{
va_list va; // [sp+18h] [bp+10h]@1
int result; // eax@1
size_t v5; // esi@1
char *v6; // edi@1
va_start(va, Format);
v5 = Count;
v6 = Dest;
result = _vsnprintf(Dest, Count, Format, va);
v6[v5 - 1] = 0;
return result;
}
|
|
|
|
|
I think your best bet is to look up Matt Pietreck's various books and articles. He does that soort of thing on a regular basis.
Bram van Kampen
|
|
|
|
|
I know using the CWnd::SetIcon to set the icon for the program executing,
but how to make the exe file use the icon too in the explorer?
It always uses the default ugly MFC icon!
|
|
|
|
|
because you probably modified it, but didn't change every devices of the icon, did you ?
also, a possible error if you didn't modify the default icon but added yours to the project, is because the MFC default icon ID is smaller than your icon in the resource.h file...
check that out
|
|
|
|
|
Windows explorer will choose the first icon in the exe's icon list. So ensure that you icon have the smallest icon id.
1) Now insert your favorite icon to project,
2) edit the resource.h and assign the id of your icon as 128 (id of default MFC icon).
3) If any other Icon id have 128 as id, update them accordingly to avoid conflict. For instance,
#define IDR_MAINFRAME 129
#define IDI_EXE_ICON 128
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
wasn't it what I say ?
|
|
|
|
|
Actually i was preparing the reply for more than 1 hr by trialing in my HelloWorld project. After posting my reply i read yours. I admit that i was so late. I apologize mate.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
lol, nevermind, your answer was more clear than mind BTW...
|
|
|
|
|
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hey! There's no crying in programming
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for your reply.
But sorry for not working.
I change my fav icon id to 128. But not working.
These things always make me mad!(The things work fine with others, while not fine with me!)
Any reason?
|
|
|
|
|
1) I hope you've clean and rebuild it.
2) I hope there is no other icon id which have id 128.
3) if 1 & 2 is ok, then could you post the relevant section in resource.h?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Sorry for not cleaning the project.
Just rebuild the project!
Thanks, all guys!^_^
|
|
|
|
|
I hope you didn't just took 128 from the example but understood what you were doing, right ?
128 was just an example. You had to track back in resource.h first the ID of your own icon.
so, to start back from the beginning, how did you add your icon in your program ?
|
|
|
|
|
I create a dialog based project.
then do my jobs.
I notify I need a more beautiful icon for my dialog, then I import a new icon.
And use CWnd::SetIcon to set the icon for the dialog.
And then I modify resource.h exchange myiconID and IDR_MAINFRAME's ID number.
Don't say 128 is the default smallest icon id?
|
|
|
|
|
fantasy1215 wrote: but how to make the exe file use the icon too in the explorer?
It always uses the default ugly MFC icon!
By making sure that all icons in your project's .ico file are correct. You likely just changed one of them and left the other one (or two) as default.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
I am having this push_back error, this is my struct:
struct RMUpdates {
RMUpdates(): prdName(L""), nameVer(L""), link(L""), savePath(L"") {};
wstring prdName;
wstring nameVer;
wstring link;
wstring savePath;
};
struct RMproduct
{
RMproduct(){};
RMproduct(wstring szName, wstring serv, wstring version){m_Name = szName; m_serviceKey = serv; m_versionKey = version;};
wstring m_serviceKey;
wstring m_versionKey;
wstring m_Name;
wstring m_SerialNo;
wstring m_VersionNo;
wstring m_SiteCode;
vector<RMUpdates*>* updateList;
~RMproduct()
{
if (updateList !=NULL) {
vector<RMUpdates*>::iterator Iter;
Iter = updateList->begin();
for (; Iter < updateList->end(); Iter++)
delete *Iter;
updateList->clear();
}
delete updateList;
}
};
Now when i perform this:
RMproduct* prd
RMUpdates* update = new RMUpdates;
update->prdName = prd->m_Name.c_str();
update->nameVer = prd->m_Name.c_str();
update->nameVer.append(L" ");
update->nameVer.append(std::wstring(A2W(pDoGetLatestProductResponse->DoGetLatestProductResult->Version->c_str())));
update->link = DOWNLOADLINK;
update->savePath = SetDestination(update->link.c_str());
prd->updateList->push_back(update);
Then I will get an error here:
size_type size() const
{
return (_Myfirst == 0 ? 0 : _Mylast - _Myfirst);
}
Any advise?
thanks,
Jayjay
|
|
|
|
|
The member RMproduct::updateList is a vector pointer and you are not allocating it nor initializing it anywhere in your constructors.
Allocate updateList in both constructors - RMproduct() and RMproduct(wstring szName, wstring serv, wstring version) will solve the problem.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
What do you mean exactly?
here are the values passed:
update->prdName = prd->m_Name.c_str() Point
Point 4.3.1.54
update->nameVer = prd->m_Name.c_str();
update->nameVer.append(L" ");
update->nameVer.append(std::wstring(A2W(pDoGetLatestProductResponse->DoGetLatestProductResult->Version->c_str())));
update->link http:
update->savePath
C:\DOCUME~1\JONATH~1\LOCALS~1\Temp\ManagePoint431InstallerBuild_54.zip
Unhandled exception at 0x00496f56 in UpdateService.exe: 0xC0000005: Access violation reading location 0xcdcdcdd5.
Can you explain further what i need to do?
Thanks,
jayjay
|
|
|
|
|
Do you mean something like this:
prd->updateList = new vector<RMUpdates*>;
|
|
|
|