Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 26-07-2017
SmgDoser SmgDoser is offline
Registrado
NULL
 
Registrado: jul 2017
Posts: 6
Poder: 0
SmgDoser Va por buen camino
Unhappy Problema con modulo de injeccion dll y variables

Hola que tal con todos, he aqui tengo un problema, al compilar mi injector en delphi xe , me da los siguientes errores :

"E2033 Types of actual and formal var parameters must be identical"

En versiones anteriores si compila y funciona perfectamente el codigo.

PD :Aca les dejo el codigo con el cual tengo error al compilarlo en delphi xe !

Código Delphi [-]
 function processName(exeFileName: string): string;
var
    ContinueLoop: BOOL;
    FSnapshotHandle: THandle;
    FProcessEntry32: TProcessEntry32;
     ProcessID : Cardinal;
  ProcessHandle : Cardinal;
  ModuleHandles : array[0..256] of DWORD;
  nBytes : Cardinal;
  ModuleName :array[0..259] of Char;
begin
    FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
    ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
    Result := '';
    while Integer(ContinueLoop) <> 0 do
    begin
      if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
        UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =
        UpperCase(ExeFileName))) then
      begin
        ProcessID := FProcessEntry32.th32ProcessID;
         ProcessHandle := OpenProcess(PROCESS_ALL_ACCESS, TRUE, ProcessID);
         EnumProcessModules(ProcessHandle, @ModuleHandles, 256 * 4, nBytes);
         GetModuleFileNameEx(ProcessHandle, ModuleHandles[0], ModuleName, 256);
          result := string(ModuleName);
      end;
      ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
    end;
    CloseHandle(FSnapshotHandle);
end;

function RandomPassword(PLen: Integer): string;
 var
   str: string;
 begin
   Randomize;
   //string with all possible chars
  str    := '1234567890QWERTYUIOP{}ASDFGHJKLZXCVBNM<>?abcdefghijklmnopqrstuvwxyz-@#&$@&!(';
   Result := '';
   repeat
     Result := Result + str[Random(Length(str)) + 1];
   until (Length(Result) = PLen)
 end;
 function ProcessExists(FProcess: string): Boolean;

const

  PROCESS_TERMINATE = $0001;

var

  ContinueLoop: BOOL;

  FSnapshotHandle: THandle;

  FProcessEntry32: TProcessEntry32;

begin

  Result := False;

  FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

  FProcessEntry32.dwSize := Sizeof(FProcessEntry32);

  ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);

  while Integer(ContinueLoop) <> 0 do

  begin

    if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) = UpperCase(FProcess))

      or (UpperCase(FProcessEntry32.szExeFile) = UpperCase(FProcess)))

    then

    begin

      Result := True;

      Break;

    end;

    ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);

  end;

  CloseHandle(FSnapshotHandle);

end;
function ModulInjectByDen(ModulePath: PAnsiChar; ProcessID: DWORD): Boolean;
var
  hSnapshot: THandle;
  ModuleEntry32: TModuleEntry32;
begin
  Result := False;
  hSnapshot := CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, ProcessID);
  if (hSnapshot <> -1) then
  begin
    ModuleEntry32.dwSize := SizeOf(TModuleEntry32);
    if (Module32First(hSnapshot, ModuleEntry32)) then
      repeat
        if string(ModuleEntry32.szExePath) = string(ModulePath) then
        begin
          Result := True;
          Break;
        end;
      until
        not Module32Next(hSnapshot, ModuleEntry32);
    CloseHandle(hSnapshot);
  end;
end;
function GetOSVersion: Cardinal;
var
  OSVersionInfo: TOSVersionInfo;
begin
  Result := 0;
  FillChar(OSVersionInfo, Sizeof(OSVersionInfo), 0);
  OSVersionInfo.dwOSVersionInfoSize := SizeOf(OSVersionInfo);
  if GetVersionEx(OSVersionInfo) then
  begin
    if OSVersionInfo.dwPlatformId = VER_PLATFORM_WIN32_NT then
    begin
      if OSVersionInfo.dwMajorVersion = 5 then
      begin
        if OSVersionInfo.dwMinorVersion = 0 then
          Result := 50//Windows 2000
        else if OSVersionInfo.dwMinorVersion = 2 then
          Result := 52//Windows 2003
        else if OSVersionInfo.dwMinorVersion = 1 then
          Result := 51//Windows XP
      end;
      if OSVersionInfo.dwMajorVersion = 6 then
      begin
        if OSVersionInfo.dwMinorVersion = 0 then
          Result := 60//Windows Vista
        else if OSVersionInfo.dwMinorVersion = 1 then
          Result := 61;//Windows 7
      end;
    end;
  end;
end;
function InjectIDMetod(ModulePath: PAnsiChar; ProcessID: DWORD): Boolean;
type
  TNtCreateThreadEx = function(
  ThreadHandle: PHANDLE;
  DesiredAccess: ACCESS_MASK;
  ObjectAttributes: Pointer;
  ProcessHandle: THANDLE;
  lpStartAddress: Pointer;
  lpParameter: Pointer;
  CreateSuspended: BOOL;
  dwStackSize: DWORD;
  Unknown1: Pointer;
  Unknown2: Pointer;
  Unknown3: Pointer): HRESULT; stdcall;
var
  lpStartAddress, lpParameter: Pointer;
  dwSize: Integer;
  hProcess, hThread, lpThreadId, lpExitCode, lpBytesWritten: Cardinal;
  NtCreateThreadEx: TNtCreateThreadEx;
begin
  Result := False;
  if ModulInjectByDen(ModulePath, ProcessID) = True then
    Exit;
  hProcess := 0;
  hProcess := OpenProcess(MAXIMUM_ALLOWED, False, ProcessID);
  if hProcess = 0 then
    Exit;
  dwSize := StrLen(ModulePath) + 1;
  lpParameter := VirtualAllocEx(hProcess, nil, dwSize, MEM_COMMIT, PAGE_READWRITE);
  if (lpParameter = nil) then
  begin
    if hProcess <> 0 then
      CloseHandle(hProcess);
    Exit;
  end;
  if GetOSVersion >= 60 then
    NtCreateThreadEx := GetProcAddress(GetModuleHandleW('ntdll'), 'NtCreateThreadEx');
  lpStartAddress := GetProcAddress(GetModuleHandleW('kernel32'), 'LoadLibraryA');
  if (lpStartAddress = nil) then
    Exit;
  if GetOSVersion >= 60 then
    if (@NtCreateThreadEx = nil) then
      Exit;
  lpBytesWritten := 0;
  if (WriteProcessMemory(hProcess, lpParameter, ModulePath, dwSize, lpBytesWritten) = False) then
  begin
    VirtualFreeEx(hProcess, lpParameter, 0, MEM_RELEASE);
    if hProcess <> 0 then
      CloseHandle(hProcess);
    Exit;
  end;
  hThread := 0;
  lpThreadId := 0;
  if GetOSVersion >= 60 then
    NtCreateThreadEx(@hThread, MAXIMUM_ALLOWED, nil, hProcess, lpStartAddress, lpParameter, false, 0, 0, 0, 0)
  else
    hThread := CreateRemoteThread(hProcess, nil, 0, lpStartAddress, lpParameter, 0, lpThreadId);
  if (hThread = 0) then
  begin
    VirtualFreeEx(hProcess, lpParameter, 0, MEM_RELEASE);
    CloseHandle(hProcess);
    Exit;
  end;
  GetExitCodeThread(hThread, lpExitCode);
  if hProcess <> 0 then
    CloseHandle(hProcess);
  if hThread <> 0 then
    CloseHandle(hThread);
  Result := True;
end;

Espero que puedan ayudarme, muchas gracias , saludos

Última edición por dec fecha: 26-07-2017 a las 08:53:47.
Responder Con Cita
  #2  
Antiguo 26-07-2017
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is online now
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.021
Poder: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi Tiene un aura espectacular
En el mensaje de error también te dirá dónde está el problema, seguramente la declaración de un procedure/fuction tiene tipos distintos a los que estás usando para llamarlos.
Responder Con Cita
  #3  
Antiguo 29-07-2017
SmgDoser SmgDoser is offline
Registrado
NULL
 
Registrado: jul 2017
Posts: 6
Poder: 0
SmgDoser Va por buen camino
Red face

Hola Casimiro, ya solucione el problema, el problema ha de estar en la declaracion de variables , tenia que modificar el tipo de variable, ya que existian cadenas pointer, Ya solucionado el problema, busque para editar o eliminar este post y no puedo.
Saludos
Responder Con Cita
  #4  
Antiguo 29-07-2017
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is online now
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.021
Poder: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi Tiene un aura espectacular
Cita:
Empezado por SmgDoser Ver Mensaje
Hola Casimiro, ya solucione el problema, el problema ha de estar en la declaracion de variables , tenia que modificar el tipo de variable, ya que existian cadenas pointer, Ya solucionado el problema, busque para editar o eliminar este post y no puedo.
Saludos
¿Y por qué ibas a querer eliminarlo?
¿Acaso no has visto todavía nuestra guía de estilo?
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Problema Variables de Session Aspx Cheswar .NET 0 12-11-2010 19:57:37
Problema con módulo web y conexiones ADO dentro de una DLL mamaro Conexión con bases de datos 2 11-11-2010 01:19:59
Problema con Variables de Session con IE6 Alexis De la Cr PHP 4 27-02-2009 18:28:22
Problema en consulta SQL con variables y format ilichhernandez SQL 6 14-11-2005 21:08:54
Problema al asignar variables Majo Varios 2 11-05-2004 17:56:58


La franja horaria es GMT +2. Ahora son las 21:38:24.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi