Hola amigos, sigo con la misma clase la cual estaba hecha en C++builder 6 y conseguí hacer que funcione bien pero claro, al pasarlo a Rio la convertí a WideString porque ese proyecto me funcionaba bien pero si queria crear un nuevo proyecto me daba errores por ser en AnsiString. Pues bien, la he pasado a WideString todo lo que molestaba y ahora al compilar me suelta estos errores:
Código:
[ilink32 Error] Error: Unresolved external 'operator new(unsigned int, std::align_val_t)' referenced from C:\USERS\AGUSTIN\DESKTOP\PRUEBA ATACHEO CON CLASE TDEBUGGER X32 W10 BY AGUML__\WIN32\DEBUG\UNIT1.OBJ
[ilink32 Error] Error: Unresolved external 'operator delete(void *, std::align_val_t)' referenced from C:\USERS\AGUSTIN\DESKTOP\PRUEBA ATACHEO CON CLASE TDEBUGGER X32 W10 BY AGUML__\WIN32\DEBUG\UNIT1.OBJ
[ilink32 Error] Error: Unable to perform link
Los errores los da en estas lineas ya que si las comento ya compila pero no funciona, claro jejeje.
Código PHP:
Depurador = new TDebugger();
y:
Código PHP:
delete Depurador;
El caso es que el antiguo proyecto era de C++Builder 6 y lo converti a esta version al intentar abrirlo ya que me preguntó y le dije que si. Ahora lo que hice fue crear un nuevo proyecto y sustituir los archivos de proyecto del antiguo proyecto por los del nuevo y volví a añadir los archivos de la clase pero me da esos errores.
en TDebugger está así:
Código PHP:
class TDebugger
{
public:
// un poquito de orden aqui solo los métodos, las funciones abajo
TDebugger();
~TDebugger();
Código PHP:
TDebugger::TDebugger()
{
LPVOID hToken=NULL;
TOKEN_PRIVILEGES MisPrivilegios;
if(OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES,&hToken)== true){
if(LookupPrivilegeValue(NULL,L"SeDebugPrivilege",&MisPrivilegios.Privileges->Luid)==true){
MisPrivilegios.PrivilegeCount=1;
MisPrivilegios.Privileges->Attributes=SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken,false,&MisPrivilegios,0,NULL,NULL);
}
}
if( hToken != NULL){
CloseHandle(hToken);
}
// Inicialización para estar tranquilo
SetOnSystemBreakPoint(NULL);
SetOnAtachBreakPoint(NULL);
SetOnEntryPoint(NULL);
SetOnBPs(NULL);
SetOnException(NULL);
SetOnCreateProcess(NULL);
SetOnExitProcess(NULL);
SetOnCreateThread(NULL);
SetOnExitThread(NULL);
SetOnLoadDll(NULL);
SetOnUnLoadDll(NULL);
SetOnOutPutString(NULL);
SetOnRIP(NULL);
SetOnSingleStep(NULL);
SetOnHBPs(NULL);
SetOnMemoryBPs(NULL);
SetOnInitLoopDebug(NULL);
SetOnExitLoopDebug(NULL);
DebugExists = false; // variable que indica si se está en depuración
HiloDepuracion = NULL;
AntiAntiDebug = NULL;
}
//---------------------------------------------------------------------------
TDebugger::~TDebugger()
{
if(HiloDepuracion != NULL){
TerminateDebug();
}
//La memoria del evento debe de borrarse cuando ya no vayamos a usarlo para nada
//Este solo se le asigna memoria al iniciar la aplicacion
if(THiloDebugger::EventHiloArmado != NULL){
delete THiloDebugger::EventHiloArmado;
THiloDebugger::EventHiloArmado = NULL;
}
}
//---------------------------------------------------------------------------
¿Podeis ayudarme?