Basic Help need

Posts 1–9 of 9 · Page 1 of 1
Basic Help need
I'm new at Visual C++
So i want to find the idiot CShell:

Code:
DWORD FindCShell( )
{
    if( EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded))
    {
        for (int i = 0; i < (cbNeeded / sizeof(HMODULE)); i++ )
        {
            TCHAR szModName[MAX_PATH];
            // Get the full path to the module's file.
            if ( GetModuleFileNameEx( hProcess, hMods[i], szModName, sizeof(szModName) / sizeof(TCHAR)) != NULL)
            {
                std::string ModuleName;
                TcharToString(ModuleName,szModName);
                if ( EndWith(ModuleName, "CShell.dll")) return (DWORD)hMods[i];
            }
        }
    }
    return 0;
}
But i got this error:
Code:
error LNK2001: unresolved external symbol _EnumProcessModules@16
error LNK2001: unresolved external symbol _GetModuleFileNameExW@16
Anyone would help me, how to fix it ?
Try to ask pingo ...
Make sure you include Psapi.h and also the lib

Like this

Code:
#include<Psapi.h>
#pragma comment(lib, "Psapi")
Also why make it so complicated for yourself? If you want to do dump cshell just load cshell using LoadLibrary and attach olly to your program. If you need a handle to cshell for your hack you can also use the regular way. For instance

Code:
DWORD Cshell = (DWORD)GetModuleHandleA("Cshell.dll");
However you need to encrypt the cshell string. "Cshell.dll" will trigger xtrap detection.
Quote Originally Posted by ctpsolo View Post
Make sure you include Psapi.h and also the lib

Like this

Code:
#include<Psapi.h>
#pragma comment(lib, "Psapi")
Also why make it so complicated for yourself? If you want to do dump cshell just load cshell using LoadLibrary and attach olly to your program. If you need a handle to cshell for your hack you can also use the regular way. For instance

Code:
DWORD Cshell = (DWORD)GetModuleHandleA("Cshell.dll");
However you need to encrypt the cshell string. "Cshell.dll" will trigger xtrap detection.
So, thats why the idiot Xtrap detect... I thought its detect the GetModuleHandle...
Quote Originally Posted by rabir007 View Post
I'm new at Visual C++
So i want to find the idiot CShell:

Code:
DWORD FindCShell( )
{
    if( EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded))
    {
        for (int i = 0; i < (cbNeeded / sizeof(HMODULE)); i++ )
        {
            TCHAR szModName[MAX_PATH];
            // Get the full path to the module's file.
            if ( GetModuleFileNameEx( hProcess, hMods[i], szModName, sizeof(szModName) / sizeof(TCHAR)) != NULL)
            {
                std::string ModuleName;
                TcharToString(ModuleName,szModName);
                if ( EndWith(ModuleName, "CShell.dll")) return (DWORD)hMods[i];
            }
        }
    }
    return 0;
}
But i got this error:
Code:
error LNK2001: unresolved external symbol _EnumProcessModules@16
error LNK2001: unresolved external symbol _GetModuleFileNameExW@16
Anyone would help me, how to fix it ?
it will be detected
Quote Originally Posted by bandi12 View Post
it will be detected
I fixed with encrypting the "CShell.dll"


---------- Post added at 08:48 PM ---------- Previous post was at 08:47 PM ----------

Quote Originally Posted by giniyat101 View Post
add psapi.lib to your linked libraries :
#pragma comment(lib, "psapi.lib")
also, use #define PSAPI_VERSION 1 before including psapi.h.
I fixed the GetModuleHandle
add psapi.lib to your linked libraries :
#pragma comment(lib, "psapi.lib")
also, use #define PSAPI_VERSION 1 before including psapi.h.
So, is this fixed ?
Quote Originally Posted by Arcton View Post
So, is this fixed ?
Yep...
/msg2short
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us