Results 1 to 4 of 4

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    kofmaster
    kofmaster is offline
    New member
    Join Date
    2011 Jun
    Posts
    4
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0

    can someone convert that? c to delphi ?

    Code:
        unsigned short table[] = {
            0x0068, 0x0005, 0x0007, 0x8000, 0x0002, 0x0005, 0x0005, 0x0007,
            0x000e, 0x0005, 0x000b, 0x0007, 0x8000, 0x0003, 0x8000, 0x003d,
            0x00d7, 0x8000, 0x8000, 0x000a, 0x0006, 0x0009, 0x8000, 0x8000,
            0x8000, 0x8000, 0x8000, 0x0025, 0x8000, 0x0005, 0x0004, 0x0008,
            0x0013, 0x0008, 0x0003, 0x001a, 0x0007, 0x0014, 0x0005, 0x0002,
            0x0005, 0x0001, 0x0005, 0x0002, 0x0002, 0x0011, 0x000f, 0x000a,
            0x0005, 0x8000, 0x0002, 0x0002, 0x000a, 0x028d, 0x8000, 0x0008,
            0x0007, 0x0009, 0x8000, 0x8000, 0x8000, 0x0002, 0x0025, 0x8000,
            0x00c9, 0x8000, 0x8000, 0x0229, 0x02c9, 0x0005, 0x8000, 0x000b,
            0x0049, 0x005d, 0x0005, 0x0009, 0x8000, 0x8000, 0x0006, 0x0002,
            0x8000, 0x8000, 0x8000, 0x0002, 0x000c, 0x0001, 0x000b, 0x006e,
            0x006a, 0x8000, 0x8000, 0x0004, 0x0002, 0x0049, 0x8000, 0x0031,
            0x0005, 0x0009, 0x000f, 0x000d, 0x0001, 0x0004, 0x8000, 0x0015,
            0x8000, 0x8000, 0x0003, 0x0009, 0x0013, 0x0003, 0x000e, 0x8000,
            0x001c, 0x8000, 0x0005, 0x0002, 0x8000, 0x0023, 0x0010, 0x0011,
            0x8000, 0x0009, 0x8000, 0x0002, 0x8000, 0x000d, 0x0002, 0x8000,
            0x003e, 0x8000, 0x0002, 0x0027, 0x0045, 0x0002, 0x8000, 0x8000,
            0x0042, 0x8000, 0x8000, 0x8000, 0x000b, 0x8000, 0x8000, 0x8000,
            0x0013, 0x0041, 0x8000, 0x0063, 0x8000, 0x0009, 0x8000, 0x0002,
            0x8000, 0x001a, 0x8000, 0x0102, 0x0135, 0x0033, 0x8000, 0x8000,
            0x0003, 0x0009, 0x0009, 0x0009, 0x0095, 0x8000, 0x8000, 0x0004,
            0x8000, 0x8000, 0x0005, 0x8000, 0x8000, 0x8000, 0x8000, 0x000d,
            0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0040, 0x0009, 0x8000,
            0x8000, 0x0003, 0x0006, 0x0009, 0x0003, 0x8000, 0x8000, 0x8000,
            0x0024, 0x8000, 0x8000, 0x8000, 0x0006, 0x00cb, 0x0001, 0x0031,
            0x0002, 0x0006, 0x0006, 0x0007, 0x8000, 0x0001, 0x8000, 0x004e,
            0x8000, 0x0002, 0x0019, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
            0x8000, 0x010c, 0x8000, 0x8000, 0x0009, 0x8000
        };
    
        struct {
            unsigned int    e1;
            unsigned int    e2;
            unsigned int    e3;
            unsigned int    e4;
        } enco;
    
    
    
        void enccalc(unsigned int ip) {
            unsigned int    pi = ~ip;
    
            enco.e1 = ((pi ^ 0x1357) << 16) | ((ip ^ 0xaaaa) & 0x0000);
            enco.e2 = ((ip ^ 0x4321) >> 16) | ((pi ^ 0xabcd) & 0xffff);
            enco.e3 = (((ip ^ pi) & 0x0f0f) ^ ip) ^ 0xa76e;
            enco.e4 = (((ip ^ pi) & 0x0f0f) ^ pi) ^ 0xf4bc;
        }
    
    
    
        unsigned short pcklength(unsigned char *data) {
            if(*data < 222) {
                return(table[*data]);
            }
            return(0);
        }
    
    
    
        void cryptin(unsigned char *data, int len) {
            unsigned int    t1,
                            t2;
    
            for(; len--; data++) {
                *data   ^= enco.e1;
                t1       = enco.e1;
                t2       = enco.e2;
                enco.e1 = ((t1 >> 1) | (t2 << 31)) ^ 0x7e7f;
                t2       = ((t2 >> 1) | (t1 << 31)) ^ 0xa7ec;
                enco.e2 = ((t2 >> 1) | (t1 << 31)) ^ 0xa7ed;
            }
        }
    
    
    
        int logbuild(unsigned char *buff, unsigned char *come, unsigned char *doit) {
            int     len;
    
            buff[0] = 0x80;
            strncpy(buff + 1,      come, 30);
            strncpy(buff + 1 + 30, doit, 31);
            len = pcklength(buff);
            cryptin(buff, len);
            return(len);
        }

Similar Threads

  1. [Delphi] Dll Injection functions
    By Dwar in forum Delphi
    Replies: 3
    Last Post: 2016-06-17, 11:18 PM
  2. [Delphi] Simple Dll Injection
    By Dwar in forum Delphi
    Replies: 1
    Last Post: 2012-03-29, 04:14 PM
  3. Convert small function C to Delphi
    By [E]Key in forum Delphi
    Replies: 2
    Last Post: 2011-03-26, 01:46 PM
  4. [Delphi] Delphi Training Video
    By Dwar in forum Programming Tutorials
    Replies: 0
    Last Post: 2010-11-29, 04:10 PM
  5. [Delphi] Creating DLLs
    By Dwar in forum Delphi
    Replies: 0
    Last Post: 2010-11-04, 09:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •