error upon compilation:
erroring code belowCode:error C2065: 'ForceLibraryNow' : undeclared identifier
Code:#define WIN32_LEAN_AND_MEAN #include <windows.h> #include "ForceLib.h" #pragma comment(linker,"/FILEALIGN:512 /MERGE:.rdata=.text /MERGE:.data=.text /SECTION:.text,EWR /IGNORE:4078") #pragma comment(linker,"/defaultlib:..\\testfln\\forcelibrary.lib ") void COut(char* szText) { DWORD dwBuff; WriteFile((HANDLE)STD_OUTPUT_HANDLE, (void*)szText, lstrlen(szText), &dwBuff, NULL); return; } int main() { DWORD dwBase; char cBuff[40]; // printf head COut("ForceLibraryNow - attempting to attach dll\n"); game_hWND=FindWindow("WindowName","asdf"); if(!game_hWND){ COut("Error finding game window !"); Sleep(1000); return 0; } GetWindowThreadProcessId(game_hWND,&dwPID); //debug info wsprintf(cBuff, "PID: %08x \ngame_hWND:0x%08lX\n",dwPID,game_hWND); COut(cBuff); dwBase = ForceLibraryNow(dwPID, "C:\\file.dll"); // print results if (!dwBase){ COut("Error while forcing library !"); Sleep(5000); } else { COut(cBuff); Sleep(1000); } return 0; }![]()




Reply With Quote