Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   ASM y Microcontroladores (https://www.clubdelphi.com/foros/forumdisplay.php?f=44)
-   -   Convertir código "asm" a código Delphi (https://www.clubdelphi.com/foros/showthread.php?t=90672)

Stringxpx 09-08-2016 23:04:12

Convertir código "asm" a código Delphi
 
Hola que tal, quisiera que me ayuden a pasar un codigo de ASM, hacia delphi aca les dejare el codigo para que lo revisen porfavor espero su ayuda ESTE ES EL CODIGO DE ASM !
Código PHP:

.386 
.model flat,stdcall 
option casemap
:none 

      
include windows.inc
      
include masm32.inc
      
include gdi32.inc
      
include user32.inc
      
include kernel32.inc
      
include Comctl32.inc
      
include comdlg32.inc
      
include shell32.inc
      
include oleaut32.inc
      
include dialogs.inc
      includelib masm32
.lib
      includelib gdi32
.lib
      includelib user32
.lib
      includelib kernel32
.lib
      includelib Comctl32
.lib
      includelib comdlg32
.lib
      includelib shell32
.lib
      includelib oleaut32
.lib



Funcion  PROTO 
Thread  PROTO

.data

Entities db    
"entitiesmp.dll",
Engine   db 
"engine.dll",0

FieldInfo    db 
"?GetFieldInfo@CPlayer@@QBEPAVFieldInfo@@XZ",0  
FDX db 
"?GetPlayerEntityByIndex@CPlayer@@QAEPAVCEntity@@E@Z",
LocalPlayer    db 
"?GetPlayer@FieldInfo@@QAEPAVCEntity@@E@Z",
FlyFire db 
"?FlyFire@CEnemyFly@@QAEHABVCEntityEvent@@@Z",0   

             
             
             
.code     
.data?
ThrdID dd ?
instance dd ?

.
code
Punto_de_Inicio proc hInstance
:HINSTANCEreason:DWORDreserved1:DWORD

.if reason==DLL_PROCESS_ATTACH
invoke MessageBox
,0,addr MsgTexto,addr MsgTitulo,MB_OK+MB_ICONWARNING

invoke CreateThread
,NULL,NULL,ADDR Thread ,NULL,NULL,NULL    

invoke CloseHandle
,eax

.elseif reason==DLL_PROCESS_DETACH

.elseif reason==DLL_THREAD_ATTACH


.elseif reason== DLL_THREAD_DETACH

.endif

mov eax,TRUE
ret
Punto_de_Inicio Endp 
Thread proc
tecla
:
invoke Sleep15

invoke GetAsyncKeyState
VK_F1
test eax
eax
jz tecla
invoke Funcion 
;Fear

jmp tecla
ret

Thread endp
Funcion proc
LOCAL listo
:DWORD
LOCAL pot
:DWORD
LOCAL Revenge
:DWORD
LOCAL jojo
:DWORD
LOCAL Estructura
:DWORD

   invoke GetModuleHandle
addr Entities
    invoke GetProcAddress
eaxaddr FDX
    mov jojo
,ebx
    call eax
    mov Revenge
,eax
    mov Estructura
,ebx

    invoke GetModuleHandle
addr Entities
    invoke GetProcAddress
eaxaddr FieldInfo
    call eax
    mov jojo
,ebx
    mov listo
,eax
    

    invoke GetModuleHandle
addr Engine
    invoke GetProcAddress
eaxaddr LocalPlayer
    mov jojo
,ebx
    mov ecx
listo
    call eax
    mov listo
,eax
    mov Estructura
,ebx

    invoke GetModuleHandle
addr Entities
    invoke GetProcAddress
eaxaddr FlyFire
    mov jojo
,ebx
    mov pot
,eax
    
    mov ebx
Estructura
    mov ebx
jojo
    mov ecx
listo
    mov edi
listo
    mov esi
jojo
    mov eax
pot
    call eax
    
    ret
    

Funcion endp
End Punto_de_Inicio 


ESTE ES EL CODIGO QUE ME TRANSPASARON HACE POCO, PERO ESTA EN PROBLEMAS, LES DEJARE PARA QUE TOMEN COMO EJEMPLO PORFAVOR ! LO QUE PASA ES QUE EL CODIGO DELPHI QUE VOY A MOSTRAR.
Código PHP:

library Project2;

uses
  classes
,
  
Dialogs,
  
Forms,
  
Windows;
var
  
getLocalPlayer:AnsiString;
  
UseFearPotion:AnsiString;
  
Entitez:AnsiString;
  
RetornoCardinal;

procedure Reserved1();
   var
   
pot:procedure;
GetLP:procedure;
begin
    pot 
:= GetProcAddress(GetModuleHandleA(PAnsiChar(Entitez)), PAnsiChar(UseFearPotion));
    
GetLP := GetProcAddress(GetModuleHandleA(PAnsiChar(Entitez)), PAnsiChar(getLocalPlayer));

while(
true) do begin
    Sleep
(40);
    if (
GetAsyncKeyState(VK_F1) <> 0then begin;
        
asm
        call GetLP
        mov ecx
eax
        mov edi
eax
        call pot
      end
;
    
end;
  
end;
  
end;


procedure DllMain(reasonInteger);
begin
  
if reason DLL_PROCESS_ATTACH then begin
      showmessage
('DLL');
    
getLocalPlayer := '?GetLocalPlayer@CPlayer@@QAEPAV1@XZ';
    
UseFearPotion := '?UseFearType1@CPlayer@@QAEXXZ';
    
Entitez := 'entitiesmp.dll';

    
CreateThread(nil,0,Pointer(@Reserved1),nil,0,Retorno);

  
end;
end;

begin
 DllProc 
:= DllMain;
 
DllMain(DLL_PROCESS_ATTACH);
end

Espero que me ayuden ,MUCHAS GRACIAS !:D

Casimiro Notevi 09-08-2016 23:09:00

Cita:

Empezado por Stringxpx (Mensaje 507534)
...

Bienvenido a clubdelphi, como siempre aconsejamos a los nuevos, no olvides leer nuestra guía de estilo, gracias por tu colaboración :)
No repitas hilos.
Ponlos en los foros adecuados, esto no es "Noticias" ni "Bibliotecas de código fuente". Ya lo he movido yo.

Stringxpx 09-08-2016 23:21:30

Okey gracias

Casimiro Notevi 09-08-2016 23:35:17

Cita:

Empezado por Stringxpx (Mensaje 507538)
Okey gracias

^\||/

A ver si alguien puede ayudarte, personalmente no he entendido bien el problema que tienes.

Stringxpx 09-08-2016 23:52:55

Algo simple !
 
SOLO YO QUIERO PASAR ESTE CODIGO DE ASM HACIA DELPHI
Código PHP:

.386  
.model flat,stdcall  
option casemap
:none  

      
include windows.inc 
      
include masm32.inc 
      
include gdi32.inc 
      
include user32.inc 
      
include kernel32.inc 
      
include Comctl32.inc 
      
include comdlg32.inc 
      
include shell32.inc 
      
include oleaut32.inc 
      
include dialogs.inc 
      includelib masm32
.lib 
      includelib gdi32
.lib 
      includelib user32
.lib 
      includelib kernel32
.lib 
      includelib Comctl32
.lib 
      includelib comdlg32
.lib 
      includelib shell32
.lib 
      includelib oleaut32
.lib 



Funcion  PROTO  
Thread  PROTO 

.data 

Entities db    
"entitiesmp.dll",0  
Engine   db 
"engine.dll",

FieldInfo    db 
"?GetFieldInfo@CPlayer@@QBEPAVFieldInfo@@XZ",0   
FDX db 
"?GetPlayerEntityByIndex@CPlayer@@QAEPAVCEntity@@E@Z",0  
LocalPlayer    db 
"?GetPlayer@FieldInfo@@QAEPAVCEntity@@E@Z",0  
FlyFire db 
"?FlyFire@CEnemyFly@@QAEHABVCEntityEvent@@@Z",0    

              
              
              
.code      
.data
ThrdID dd 
instance dd 

.
code 
Punto_de_Inicio proc hInstance
:HINSTANCEreason:DWORDreserved1:DWORD 

.if reason==DLL_PROCESS_ATTACH 
invoke MessageBox
,0,addr MsgTexto,addr MsgTitulo,MB_OK+MB_ICONWARNING 

invoke CreateThread
,NULL,NULL,ADDR Thread ,NULL,NULL,NULL     

invoke CloseHandle
,eax 

.elseif reason==DLL_PROCESS_DETACH 

.elseif reason==DLL_THREAD_ATTACH 


.elseif reason== DLL_THREAD_DETACH 

.endif 

mov eax,TRUE 
ret 
Punto_de_Inicio Endp  
Thread proc 
tecla

invoke Sleep15 

invoke GetAsyncKeyState
VK_F1 
test eax
eax 
jz tecla 
invoke Funcion 
;Fear 

jmp tecla 
ret 

Thread endp 
Funcion proc 
LOCAL listo
:DWORD 
LOCAL pot
:DWORD 
LOCAL Revenge
:DWORD 
LOCAL jojo
:DWORD 
LOCAL Estructura
:DWORD 

   invoke GetModuleHandle
addr Entities 
    invoke GetProcAddress
eaxaddr FDX 
    mov jojo
,ebx 
    call eax 
    mov Revenge
,eax 
    mov Estructura
,ebx 

    invoke GetModuleHandle
addr Entities 
    invoke GetProcAddress
eaxaddr FieldInfo 
    call eax 
    mov jojo
,ebx 
    mov listo
,eax 
     

    invoke GetModuleHandle
addr Engine 
    invoke GetProcAddress
eaxaddr LocalPlayer 
    mov jojo
,ebx 
    mov ecx
listo 
    call eax 
    mov listo
,eax 
    mov Estructura
,ebx 

    invoke GetModuleHandle
addr Entities 
    invoke GetProcAddress
eaxaddr FlyFire 
    mov jojo
,ebx 
    mov pot
,eax 
     
    mov ebx
Estructura 
    mov ebx
jojo 
    mov ecx
listo 
    mov edi
listo 
    mov esi
jojo 
    mov eax
pot 
    call eax 
     
    ret 
     

Funcion endp 
End Punto_de_Inicio 


Casimiro Notevi 09-08-2016 23:58:10

Veo que no has leido nuestra guía de estilo :mad:

mamcx 09-08-2016 23:58:45

Si como sospecho estas tratando hackear un exe, no vas a avanzar mucho si no entiendes assembler

Stringxpx 10-08-2016 00:05:26

Si lose soy novato, y no es .EXE
ES un juego "Rakion.bin" Te agradeceria si me recomendarias paginas en donde mejorar mi conocimiento en Delphi :)
Solo quiero que me transpasen el codigo nada mas, gracias !

Casimiro Notevi 10-08-2016 00:13:31

Cita:

Empezado por Stringxpx (Mensaje 507543)
Te agradeceria si me recomendarias paginas en donde mejorar mi conocimiento en Delphi :)

www.clubdelphi.com ;)
Cita:

Empezado por Stringxpx (Mensaje 507543)
Solo quiero que me transpasen el codigo nada mas, gracias !

Y yo que me digan los números del próximo sorteo de lotería, nada más :D

mamcx 10-08-2016 01:16:40

Cita:

Empezado por Stringxpx (Mensaje 507543)

Solo quiero que me transpasen el codigo nada mas, gracias !

Eso es trabajo que es tu responsabilidad. Es muy dificil ayudarte porque no has hecho una pregunta concreta. Lee la guia de estilo.

Stringxpx 10-08-2016 02:00:00

Convertir codigo de asm a codigo delphi !!!!
 
HOLA MIRA SERE ALGO RAPIDO !
QUIERO QUE ME AYUDEN A , CONVERTIR ESTE CODIGO DE ASM A UN CODIGO DELPHI !
Código PHP:

.386  
.model flat,stdcall  
option casemap
:none  

      
include windows.inc 
      
include masm32.inc 
      
include gdi32.inc 
      
include user32.inc 
      
include kernel32.inc 
      
include Comctl32.inc 
      
include comdlg32.inc 
      
include shell32.inc 
      
include oleaut32.inc 
      
include dialogs.inc 
      includelib masm32
.lib 
      includelib gdi32
.lib 
      includelib user32
.lib 
      includelib kernel32
.lib 
      includelib Comctl32
.lib 
      includelib comdlg32
.lib 
      includelib shell32
.lib 
      includelib oleaut32
.lib 



Funcion  PROTO  
Thread  PROTO 

.data 

Entities db    
"entitiesmp.dll",0  
Engine   db 
"engine.dll",

FieldInfo    db 
"?GetFieldInfo@CPlayer@@QBEPAVFieldInfo@@XZ",0   
FDX db 
"?GetPlayerEntityByIndex@CPlayer@@QAEPAVCEntity@@E@Z",0  
LocalPlayer    db 
"?GetPlayer@FieldInfo@@QAEPAVCEntity@@E@Z",0  
FlyFire db 
"?FlyFire@CEnemyFly@@QAEHABVCEntityEvent@@@Z",0    

              
              
              
.code      
.data
ThrdID dd 
instance dd 

.
code 
Punto_de_Inicio proc hInstance
:HINSTANCEreason:DWORDreserved1:DWORD 

.if reason==DLL_PROCESS_ATTACH 
invoke MessageBox
,0,addr MsgTexto,addr MsgTitulo,MB_OK+MB_ICONWARNING 

invoke CreateThread
,NULL,NULL,ADDR Thread ,NULL,NULL,NULL     

invoke CloseHandle
,eax 

.elseif reason==DLL_PROCESS_DETACH 

.elseif reason==DLL_THREAD_ATTACH 


.elseif reason== DLL_THREAD_DETACH 

.endif 

mov eax,TRUE 
ret 
Punto_de_Inicio Endp  
Thread proc 
tecla

invoke Sleep15 

invoke GetAsyncKeyState
VK_F1 
test eax
eax 
jz tecla 
invoke Funcion 
;Fear 

jmp tecla 
ret 

Thread endp 
Funcion proc 
LOCAL listo
:DWORD 
LOCAL pot
:DWORD 
LOCAL Revenge
:DWORD 
LOCAL jojo
:DWORD 
LOCAL Estructura
:DWORD 

   invoke GetModuleHandle
addr Entities 
    invoke GetProcAddress
eaxaddr FDX 
    mov jojo
,ebx 
    call eax 
    mov Revenge
,eax 
    mov Estructura
,ebx 

    invoke GetModuleHandle
addr Entities 
    invoke GetProcAddress
eaxaddr FieldInfo 
    call eax 
    mov jojo
,ebx 
    mov listo
,eax 
     

    invoke GetModuleHandle
addr Engine 
    invoke GetProcAddress
eaxaddr LocalPlayer 
    mov jojo
,ebx 
    mov ecx
listo 
    call eax 
    mov listo
,eax 
    mov Estructura
,ebx 

    invoke GetModuleHandle
addr Entities 
    invoke GetProcAddress
eaxaddr FlyFire 
    mov jojo
,ebx 
    mov pot
,eax 
     
    mov ebx
Estructura 
    mov ebx
jojo 
    mov ecx
listo 
    mov edi
listo 
    mov esi
jojo 
    mov eax
pot 
    call eax 
     
    ret 
     

Funcion endp 
End Punto_de_Inicio 

GRACIAS.

BDWONG 10-08-2016 02:18:46

Hola este tema ya lo has publicado antes :(
Viendo a simple vista el codigo parace funcionar similar como cuando se intenta inyectar una DLL dentro de un proceso, lo recomendable seria que le dieras una estudiada al lenguaje ensamblador.

Saludos..

Delphius 10-08-2016 03:02:16

Traducción: "Sólo quiero que me hagan este hack para el juego Rakion"

Ya ni disimulan... extraño a los pseudo hackers/lamers de antes. Al menos lo hacían aparentar que estaban estudiando como proteger sus propios sistemas.
Los de ahora ni eso. No saben poner un punto y coma y pretender hacer inyección de dll.

¿Cuanto más hace falta para cerrar el hilo?

Al González 10-08-2016 04:54:43

No lo cerremos. ¡Mejor hagamos fiesta! ||-|| :)

Cuando tenía unos 20 años, "jaquié" Prince of Persia sustituyendo bytes a lo bruto con un editor hexadecimal. Sin saber cómo conseguí que el príncipe atravesara las rejas sin necesidad de abrirlas. :D

En aquel entonces, mi conocimiento de ensamblador se limitaba a 2 instrucciones (ahora conozco unas ocho). :p

Casimiro Notevi 10-08-2016 12:35:56

Cita:

Empezado por Stringxpx (Mensaje 507547)
...

Si vuelves a publicar un mensaje incumpliendo las normas de los foros, serás baneado, son las reglas.

Delphius 10-08-2016 14:51:00

Hey Casi... ¿Qué dijo? ahora Ya me pica la curiosidad. Como dijo Al, ¡hagamos fiesta! Poné lo que dijo para ver si lo "atiendo" al muchachito este.
No me llegó notificación por correo de una respuesta de su parte.

Saludos

Stringxpx 10-08-2016 16:18:46

All
 
Por que se molestan ?
1. NO SOY LAMMER
2. ESE CODIGO ES ESTRUCTURADO POR MI
3. EL CODIGO ES MIO XD !
SOLO LO QUIERO PASAR A UN CODIGO DELPHI !
.... no tengo conocimientos en delphi , por eso digo.

Delphius 10-08-2016 16:25:33

Parece que alguien no entiende que significa "atender a alguien en los foros" :D :D :D

¡Sigue insistiendo!

Ñuño Martínez 11-08-2016 18:01:00

Cita:

Empezado por Stringxpx (Mensaje 507560)

3. EL CODIGO ES MIO XD !

Pues haber empezado por ahí. Explica qué es lo que hace el código (para los que no tenemos ese juego) y tal vez podamos guiarte (que no traducirte).

Casimiro Notevi 11-08-2016 18:12:57

Cerré el hilo porque no ha leído la guía de estilo, o la ha leído, pero ha seguido pasando totalmente de lo que le hemos aconsejado.


La franja horaria es GMT +2. Ahora son las 16:28:11.

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