Ir al contenido


Foto

convertir codigo c++ a delphi

delphi c++ embarcadero delphi convert convertir codigo c++ to delphi c++ a delphi

  • Por favor identifícate para responder
1 respuesta en este tema

#1 galaxys7

galaxys7

    Newbie

  • Miembros
  • Pip
  • 4 mensajes

Escrito 30 octubre 2020 - 12:17

Hola buenas, llevo muy poco tiempo en lo de delphi y c++. Se me presento este problema a la hora de convertir estas lineas de codigo de c++ a  delphi no entiendo muy bien como podría ser las funciones de 
template<typename ... Arg>auto funcion_nt = static_cast<uint64_t(_stdcall*)(Arg...)>(funcion_hook) en estas son dos partes tengo problemas no tengo ni idea, agradecería su ayuda.

cpp
  1. template<typename ... Arg>
  2. uint64_t nt_funcion_hook(const Arg ... args)
  3. {
  4. void* funcion_hook = GetProcAddress(LoadLibrary("ntdll.dll"), "ntprotectvirtualmemory");
  5.  
  6. auto funcion_nt = static_cast<uint64_t(_stdcall*)(Arg...)>(funcion_hook);
  7.  
  8. return funcion_nt(args ...);
  9. }

Solo llegue hasta aquí 

 


delphi
  1. function nt_funcion_hook(?):UInt64;
  2. var
  3. funcion_hook : Pointer;
  4. begin
  5. funcion_hook := GetProcAddress(LoadLibrary('ntdll.dll'), 'ntprotectvirtualmemory');
  6. end;

Gracias

 


  • 0

#2 Astimei

Astimei

    Newbie

  • Miembros
  • Pip
  • 2 mensajes

Escrito 25 abril 2025 - 09:57

Hola soy nuevo y no se muy bien como manejar esto, lo intentaré. Yo suelo utilizar la IA de Syntha y suele ir bien.


delphi
  1. function nt_funcion_hook(const args: array of const): UInt64;
  2. var
  3. funcion_hook: Pointer;
  4. funcion_nt: function(const args: array of const): UInt64 stdcall;
  5. begin
  6. funcion_hook := GetProcAddress(LoadLibrary('ntdll.dll'), 'ntprotectvirtualmemory');
  7. funcion_nt := function(const args: array of const): UInt64 stdcall(funcion_hook);
  8. Result := funcion_nt(args);
  9. end;

Espero te sirva.

 


  • 1





Etiquetado también con una o más de estas palabras: delphi, c++, embarcadero delphi, convert, convertir codigo, c++ to delphi, c++ a delphi

IP.Board spam blocked by CleanTalk.