c++ - LoadLibraryW doesn't work while LoadLibraryA does the job -


I wrote some sample programs and DLL to know the concept of DLL injection.

\ Path \\ from \\ my \\ DLL dll "); LPTHREAD_START_ROUTINE pLoadLibraryW = (Lpathred_ROTEN) GetProcAddress (hKernel32, "LoadLibraryW"); Int bytescified = wide-chromatomultibite (CP_UTF8, 0, DLCR_st (), DLL. Lamp (), zero, 0, zero, zero); Std :: vector & lt; Byte & gt; DllName (bytesNeeded); Wide-chartomultibite (CP_UTF8, 0, DLL, C.R.), DLL. Lamp (), (LPTR) and DLNmem [0], bytes, null, faucet); To simplify memory memory, memory is a class written by me // Constructor takes the desired permission Memory mem (Paid, False, True, False, True, False, False, False, False, False, True, True, False ); // ensures extinction of the allotted range // True / True / False = Read and write, no execution permission is std :: tr1 :: shared_ptr & lt; Void & gt; Allocated = mem.AllocateBytes (dllName.size (), true, true, false); Mem.WriteBytes ((unsigned int) allocated .get (), dllName); Mem.CreateThread (pLoadLibraryW, allocated .get); Memory :: CreateThread is as follows:

  Zero Memory :: CreateThread (LPTHREAD_START_ROUTINE address, LPVOID parameter) const {std :: tr1 :: shared_ptr & Lt; Zero & gt; HThread (CreateRemoteThread (m_hProcess.get (), NULL, 0, Address, Parameter, 0, NULL), CloseHandle; If (hThread.get () == NULL) {Study :: Runtime_Eer ("Memory :: CreatePath: CreateRemoteThreadFriday Failed "};} DWORD back = WaitForSingleObject (hThread.get), INFINITE; if (returned! = WAIT_OBJECT_0) {std :: runtime_error (" Memory :: Createthread: Remote Thread Not Finished correctly ")}}} < The problem is that the module is not loaded. However, when I get the second line  
  Lpithread / START_TRUTINE pLoadLibraryW = (LPTHREAD_START_ROUTINE) GetProcAddress (hKernel32, " LoadLibraryA ");   

This works (because the test does not have its Unicode characters in DLL).

How do LoadLibraryW ?

"<">

This takes a TCHAR - hence LoadLibraryW The logic should be a broad string; the above code passes through multi-byte form of logic, which is a form that LoadLibraryA wants.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -