Raised This Month: $ Target: $400
 0% 

ASM2SMA - Codificador experimental de AMXX Assembly


  
 
 
Thread Tools Display Modes
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-12-2012 , 21:17   Re: ASM2SMA Log
#21

Muchas gracias luqas me animan mucho a seguir con esto y me motiva bastante :$ Yo tampoco tengo unos conocimientos maravillosos de C++(es mas, suelo mezclar C y C++) pero bueno, el hacer este programa me esta enseñando bastante. Y aunque solo tenga este poquito hecho, a mi ya me ahorra tiempo, es un rollo tener q tipear todas las funciones y cabeceras.
Y con lo de salir algo bueno de aqui, esperemos que asi sea, porque parece que somos los monos de feria del resto de AM...
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.

Last edited by S34Qu4K3; 08-12-2012 at 21:17.
S34Qu4K3 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-12-2012 , 21:30   Re: ASM2SMA Log
#22

Asi es lamentablemente , Una pregunta , reconoce plugins que utilizen bits ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-12-2012 , 21:35   Re: ASM2SMA Log
#23

No solo aqui, nos tratan asi en todos lls sitios a los hispano hablantes?
Bitsums? Al estilo menukeys y eso o a que te refieres sino?
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-12-2012 , 22:30   Re: ASM2SMA Log
#24

Em si algo por el estilo , algo asi me refiero.

Code:
#include <amxmodx> new bit public client_authorized( id )     bit |= ( 1 << ( id % 32 ) )     public client_disconnect( id )     bit &= ~( 1 << ( id % 32 ) )     public clcmd_hooksomethinghere( id ) {     if( bit & ( 1 << ( id % 32 ) ) )         client_print( id , print_chat, "Sos admin" ) }
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Old 08-12-2012, 22:30
lucas_7_94
This message has been deleted by lucas_7_94.
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 08-13-2012 , 00:35   Re: ASM2SMA Log
#25

Agrégame a msn(mi firma) @S34Qu4K3, quizás pueda ayudarte más en tu proyecto.
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).

gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-13-2012 , 08:13   Re: ASM2SMA Log
#26

Lo compruebo hoy luqas
Gladius, ya casi no me conecto al msn pero bueno, [email protected]
sino, steam, que lo acabo de meter en el movil
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.

Last edited by S34Qu4K3; 08-13-2012 at 10:31.
S34Qu4K3 is offline
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-13-2012 , 12:54   Re: ASM2SMA Log
#27

Dump de tu plugin luqas:
PHP Code:
No module data detected.
nativeclient_print
0x000000BC 
public clcmd_hooksomethinghere(id)
0x00000008 public client_authorized(id)
0x00000060 public client_disconnect(id)
codestart  codeend    address    type         name
0x00000008 0x00000060 0x0000000C local    val id
0x00000060 0x000000BC 0x0000000C local    val id
0x000000BC 0x00000148 0x0000000C local    val id
0x00000008 0x00000148 0x00000000 
global   val bit
0x000000BC 0x00000148 0x000000BC 
public       clcmd_hooksomethinghere
0x00000008 0x00000060 0x00000008 
public       client_authorized
0x00000060 0x000000BC 0x00000060 
public       client_disconnect
0x00000000 
new bit

0x8                        PROC              
; public client_authorized(id)
0xC                       BREAK              ; bits_luqas.sma:4
0x10                      
BREAK              ; bits_luqas.sma:5
0x14                   LOAD
.pri  0x0         bit
0x1C                   PUSH
.pri
0x20                  
CONST.pri  0x20        "in"
0x28                 LOAD.S.alt  0xC         id
0x30                   SDIV
.alt
0x34                   MOVE
.pri
0x38                  
CONST.alt  0x1         0x53000000 (1392508928.00000)
0x40                       XCHG
0x44                        SHL  0x2B
0x4C                         
OR
0x50                   STOR.pri  0x0         bit
0x58                   ZERO
.pri
0x5C                       RETN
0x60                       PROC              
; public client_disconnect(id)
0x64                      BREAK              ; bits_luqas.sma:7
0x68                      
BREAK              ; bits_luqas.sma:8
0x6C                   LOAD
.pri  0x0         bit
0x74                   PUSH
.pri
0x78                  
CONST.pri  0x20        "in"
0x80                 LOAD.S.alt  0xC         id
0x88                   SDIV
.alt
0x8C                   MOVE
.pri
0x90                  
CONST.alt  0x1         0x53000000 (1392508928.00000)
0x98                       XCHG
0x9C                        SHL  0x56
0xA4                    POP
.alt
0xA8                        
AND
0xAC                   STOR.pri  0x0         bit
0xB4                   ZERO
.pri
0xB8                       RETN
0xBC                       PROC              
; public clcmd_hooksomethinghere(id
)
0xC0                      BREAK              ; bits_luqas.sma:11
0xC4                      
BREAK              ; bits_luqas.sma:13
0xC8                   LOAD
.pri  0x0         bit
0xD0                   PUSH
.pri
0xD4                  
CONST.pri  0x20        "in"
0xDC                 LOAD.S.alt  0xC         id
0xE4                   SDIV
.alt
0xE8                   MOVE
.pri
0xEC                  
CONST.alt  0x1         0x53000000 (1392508928.00000)
0xF4                       XCHG
0xF8                        SHL  0x2B
0x100                       
AND
0x104                      JZER  0x140       jump_0
0x10C                     
BREAK              ; bits_luqas.sma:14
0x110                    PUSH
.C  0x4         "Sos admin"
0x118                    PUSH.C  0x3         0x5300
0x120                    PUSH
.S  0xC         id
0x128                    PUSH
.C  0xC
0x130                  SYSREQ
.C  0x0         client_print
0x138                     STACK  0x10        
free 4 cells
0x140                  ZERO
.pri              target:jump_0
0x144                      RETN 
Parece complicadito asi que estoy planeando dejar el soporte para bits para el final, asi que al principio habra que aguantarse un poco porque no habra soporte para ellos :S

@Gladius
parse_gvars.cpp
PHP Code:
#include "main.h"

using namespace std;

void parse_gvars(char *afilechar *output_file)
{
    
char buffer[LINE_LEN] = "";
    
char *substring_pointer NULL;

    
ifstream gstream(afile);
    
fstream input(output_fileios::app); //ios::app writes to the end of the file

    
printf("----------------------------------------------------\n");
    
printf("Parsing global vars...\n");

    while(!
gstream.eof())
    {
        
erase_array(buffer);

        
gstream.getline(bufferLINE_LEN);

        if(
strncmp(buffer,"0x0"3) == 0//If strncmp retuns 0, there are equal
        
{
            if(
substring_pointer strstr(buffer,"new")) 
            {
                for(
int i=11i<LINE_LENi++)//Skip the 11 first characters (hex and space)
                
{
                    if(
buffer[i] != '\0')
                    {
                        
cout<<buffer[i];
                        
input<<buffer[i];
                    }
                }
                
cout<<endl;
                
input<<endl;
            }
        }
        else if(
substring_pointer strstr(buffer,"0x8")) //0x8  PROC (start of the first function)
            
break;
    }

    
cout<<endl;
    
input<<endl;
    
printf("!!Global vars parsing finished!!\n\n");
    
printf("----------------------------------------------------\n");

    
gstream.close();

Los otros son similares, cualquier cosa que veas que se pueda mejorar, solo dimelo =)
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.

Last edited by S34Qu4K3; 08-13-2012 at 12:55.
S34Qu4K3 is offline
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-13-2012 , 15:37   Re: ASM2SMA Log
#28

*UPDATE*
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 08-13-2012 , 22:53   Re: ASM2SMA Log
#29

Quote:
Originally Posted by lucas_7_94 View Post
Em si algo por el estilo , algo asi me refiero.

Code:
#include <amxmodx> new bit public client_authorized( id )     bit |= ( 1 << ( id % 32 ) )     public client_disconnect( id )     bit &= ~( 1 << ( id % 32 ) )     public clcmd_hooksomethinghere( id ) {     if( bit & ( 1 << ( id % 32 ) ) )         client_print( id , print_chat, "Sos admin" ) }
Quote:
Originally Posted by S34Qu4K3 View Post
Dump de tu plugin luqas:
PHP Code:
No module data detected.
nativeclient_print
0x000000BC 
public clcmd_hooksomethinghere(id)
0x00000008 public client_authorized(id)
0x00000060 public client_disconnect(id)
codestart  codeend    address    type         name
0x00000008 0x00000060 0x0000000C local    val id
0x00000060 0x000000BC 0x0000000C local    val id
0x000000BC 0x00000148 0x0000000C local    val id
0x00000008 0x00000148 0x00000000 
global   val bit
0x000000BC 0x00000148 0x000000BC 
public       clcmd_hooksomethinghere
0x00000008 0x00000060 0x00000008 
public       client_authorized
0x00000060 0x000000BC 0x00000060 
public       client_disconnect
0x00000000 
new bit

0x8                        PROC              
; public client_authorized(id)
0xC                       BREAK              ; bits_luqas.sma:4
0x10                      
BREAK              ; bits_luqas.sma:5
0x14                   LOAD
.pri  0x0         bit
0x1C                   PUSH
.pri
0x20                  
CONST.pri  0x20        "in"
0x28                 LOAD.S.alt  0xC         id
0x30                   SDIV
.alt
0x34                   MOVE
.pri
0x38                  
CONST.alt  0x1         0x53000000 (1392508928.00000)
0x40                       XCHG
0x44                        SHL  0x2B
0x4C                         
OR
0x50                   STOR.pri  0x0         bit
0x58                   ZERO
.pri
0x5C                       RETN
0x60                       PROC              
; public client_disconnect(id)
0x64                      BREAK              ; bits_luqas.sma:7
0x68                      
BREAK              ; bits_luqas.sma:8
0x6C                   LOAD
.pri  0x0         bit
0x74                   PUSH
.pri
0x78                  
CONST.pri  0x20        "in"
0x80                 LOAD.S.alt  0xC         id
0x88                   SDIV
.alt
0x8C                   MOVE
.pri
0x90                  
CONST.alt  0x1         0x53000000 (1392508928.00000)
0x98                       XCHG
0x9C                        SHL  0x56
0xA4                    POP
.alt
0xA8                        
AND
0xAC                   STOR.pri  0x0         bit
0xB4                   ZERO
.pri
0xB8                       RETN
0xBC                       PROC              
; public clcmd_hooksomethinghere(id
)
0xC0                      BREAK              ; bits_luqas.sma:11
0xC4                      
BREAK              ; bits_luqas.sma:13
0xC8                   LOAD
.pri  0x0         bit
0xD0                   PUSH
.pri
0xD4                  
CONST.pri  0x20        "in"
0xDC                 LOAD.S.alt  0xC         id
0xE4                   SDIV
.alt
0xE8                   MOVE
.pri
0xEC                  
CONST.alt  0x1         0x53000000 (1392508928.00000)
0xF4                       XCHG
0xF8                        SHL  0x2B
0x100                       
AND
0x104                      JZER  0x140       jump_0
0x10C                     
BREAK              ; bits_luqas.sma:14
0x110                    PUSH
.C  0x4         "Sos admin"
0x118                    PUSH.C  0x3         0x5300
0x120                    PUSH
.S  0xC         id
0x128                    PUSH
.C  0xC
0x130                  SYSREQ
.C  0x0         client_print
0x138                     STACK  0x10        
free 4 cells
0x140                  ZERO
.pri              target:jump_0
0x144                      RETN 
Parece complicadito asi que estoy planeando dejar el soporte para bits para el final, asi que al principio habra que aguantarse un poco porque no habra soporte para ellos :S

@Gladius
parse_gvars.cpp
PHP Code:
#include "main.h"

using namespace std;

void parse_gvars(char *afilechar *output_file)
{
    
char buffer[LINE_LEN] = "";
    
char *substring_pointer NULL;

    
ifstream gstream(afile);
    
fstream input(output_fileios::app); //ios::app writes to the end of the file

    
printf("----------------------------------------------------\n");
    
printf("Parsing global vars...\n");

    while(!
gstream.eof())
    {
        
erase_array(buffer);

        
gstream.getline(bufferLINE_LEN);

        if(
strncmp(buffer,"0x0"3) == 0//If strncmp retuns 0, there are equal
        
{
            if(
substring_pointer strstr(buffer,"new")) 
            {
                for(
int i=11i<LINE_LENi++)//Skip the 11 first characters (hex and space)
                
{
                    if(
buffer[i] != '\0')
                    {
                        
cout<<buffer[i];
                        
input<<buffer[i];
                    }
                }
                
cout<<endl;
                
input<<endl;
            }
        }
        else if(
substring_pointer strstr(buffer,"0x8")) //0x8  PROC (start of the first function)
            
break;
    }

    
cout<<endl;
    
input<<endl;
    
printf("!!Global vars parsing finished!!\n\n");
    
printf("----------------------------------------------------\n");

    
gstream.close();

Los otros son similares, cualquier cosa que veas que se pueda mejorar, solo dimelo =)
Acerca del plugin de Lucas lo único que pude ver de los bits solo puedo determinar a cuántos bits representa, si es de player o de entidades o solo 1. Pero saber si setea, quita o compara es difícil ya que no da resultados correctos siempre, probé con otros bits y me daba algunos valores y otros no por ende no supe como deducir que era. Lo mejor es preguntarle a Bailopan a ver si puede ayudar en los bits.

Con respecto al code que me dejaste, te dejo este en C++

Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

void parse_gvars(string input_file, string output_file)
{    
    fstream outfile(output_file.c_str(), fstream::out | fstream::app); //ios::app writes to the end of the file
    fstream infile(input_file.c_str(), fstream::in);

    cout << "----------------------------------------------------" << endl;
    cout << "Parsing global vars..." << endl;
    
    string szBuffer;
    //size_t piSubString;

    while(infile.eof() == 0)
    {
        szBuffer.clear();
        
        getline(infile, szBuffer);
        if(szBuffer.compare(szBuffer.begin(), 3, "0x0") == 0) //If strncmp retuns 0, there are equal
        {
            //if((piSubString = szBuffer.find("new")) != string::npos)

            // string::npos = -1
            if(szBuffer.find("new") != string::npos)
            {
                szBuffer.assign(szBuffer.begin() + 11, szBuffer.end()); //Skip the 11 first characters (hex and space)
                
                cout << szBuffer << endl;                  
                outfile << szBuffer << endl;
            }
        }
        // string::npos = -1
        else if((piSubString = szBuffer.find("0x8")) != string::npos) //0x8  PROC (start of the first function)
        {
            break;
        }
    }
    
    cout << endl << "!!Global vars parsing finished!!" << endl << endl;
    cout << "----------------------------------------------------" << endl;
    
    outfile << endl;

    outfile.close();
    infile.close();
}
Esto te puede servir acerca de Ficheros(Archivos).
http://www.cplusplus.com/reference/iostream/fstream
http://www.cplusplus.com/reference/iostream/ofstream
http://www.cplusplus.com/reference/iostream/ifstream

Cuando usar el primero o separarlos en los 2 siguientes depende de lo que hagas.

También te adjunto algo de Strings.
http://www.cplusplus.com/reference/string/string
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).


Last edited by gladius; 08-24-2012 at 18:24.
gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-14-2012 , 11:05   Re: ASM2SMA Log
#30

No puedo ver bien el code desde el movil, pero basicamente usas strings no? Es mas rapifo?
Al principio, lo hice con strings pero pasaba lo q te decia en desvirtue, hacian lo que le daba la gana.
Cuando llegue a casa le echo un ojo ;)
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode