Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef OMITBAD
- /* bad function declaration */
- void badSource(char * &data);
- void bad()
- {
- char * data;
- char dataBuffer[100] = "";
- data = dataBuffer;
- badSource(data);
- {
- HMODULE hModule;
- /* POTENTIAL FLAW: If the path to the library is not specified, an attacker may be able to
- * replace his own file with the intended library */
- hModule = LoadLibraryA(data);
- if (hModule != NULL)
- {
- FreeLibrary(hModule);
- printLine("Library loaded and freed successfully");
- }
- else
- {
- printLine("Unable to load library");
- }
- }
- }
- #endif /* OMITBAD */
Advertisement
Add Comment
Please, Sign In to add comment