Modifier Help

Ok, I'm here to see if anyone could help me do a little assembly I'm really new to c# or any code other than web...

i need to edit the modifiers in the exe to handle my encryption, i just don't know how to find them in the exe.... so i asked a friend of mine and he told me this and i don't understand it...


In the client EXE. What's encrypted obviously must be decrypted...
The modifiers being the supposed key constants in your example.

What is he talking about with key constants?

I just don't know what im looking for or what to find and edit the exe, iv tried ollydbg and hexing, i really don't know what I'm looking to change lol.. So will any of you pleases help me iv been trying this for days now....



here's the real one that the exe use's


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

{
    using System;
    using System.IO;

    internal class EncryptionStandard : ITableEncryption
    {
        void ITableEncryption.Decode(ref byte[] data)
        {
            uint num = 0x816;
            for (int i = 0; i < data.Length; i++)
            {
                byte num3 = data[i];
                uint num4 = num;
                byte num5 = 0;
                num4 &= 0xff00;
                num4 = num4 >> 8;
                num5 = (byte) (num4 ^ num3);
                num4 = num3;
                num4 += num;
                num4 &= 0xffff;
                num4 *= 0x6081;
                num4 &= 0xffff;
                num4 += 0x1608;
                num4 &= 0xffff;
                num = num4;
                data[i] = num5;
            }
        }

        void ITableEncryption.Encode(FileStream stream)
        {
            int num = stream.ReadByte();
            uint num2 = 0x816;
            while (num != -1)
            {
                stream.Seek(-1L, SeekOrigin.Current);
                byte num3 = (byte) (num & 0xff);
                byte num4 = 0;
                uint num5 = num2;
                num5 &= 0xff00;
                num5 = num5 >> 8;
                num4 = (byte) (num5 ^ num3);
                num5 = num4;
                num5 += num2;
                num5 &= 0xffff;
                num5 *= 0x6081;
                num5 &= 0xffff;
                num5 += 0x1601;
                num5 &= 0xffff;
                num2 = num5;
                stream.WriteByte(num4);
                num = stream.ReadByte();
            }
        }

        string ITableEncryption.Details
        {
            get
            {
                return "The standard encryption method.";
            }
        }

        string ITableEncryption.Name
        {
            get
            {
                return "Standard";
            }
        }
    }
}



Below is what i edited to change the encryption to my own, its 35795145


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
 

{
    using System;
    using System.IO;

    internal class EncryptionStandard : ITableEncryption
    {
        void ITableEncryption.Decode(ref byte[] data)
        {
            uint num = 0x816;
            for (int i = 0; i < data.Length; i++)
            {
                byte num3 = data[i];
                uint num4 = num;
                byte num5 = 0;
                num4 &= 0xff00;
                num4 = num4 >> 35795145;
                num5 = (byte)(num4 ^ num3);
                num4 = num3;
                num4 += num;
                num4 &= 0xffff;
                num4 *= 0x6081;
                num4 &= 0xffff;
                num4 += 0x1608;
                num4 &= 0xffff;
                num = num4;
                data[i] = num5;
            }
        }

        void ITableEncryption.Encode(FileStream stream)
        {
            int num = stream.ReadByte();
            uint num2 = 0x816;
            while (num != -1)
            {
                stream.Seek(-1L, SeekOrigin.Current);
                byte num3 = (byte)(num & 0xff);
                byte num4 = 0;
                uint num5 = num2;
                num5 &= 0xff00;
                num5 = num5 >> 35795145;
                num4 = (byte)(num5 ^ num3);
                num5 = num4;
                num5 += num2;
                num5 &= 0xffff;
                num5 *= 0x6081;
                num5 &= 0xffff;
                num5 += 0x1601;
                num5 &= 0xffff;
                num2 = num5;
                stream.WriteByte(num4);
                num = stream.ReadByte();
            }
        }

        string ITableEncryption.Details
        {
            get
            {
                return "The standard encryption method.";
            }
        }

        string ITableEncryption.Name
        {
            get
            {
                return "Standard";
            }
        }
    }
}



What the above code is, its from a little program that encrypts table files that the client reads, and i made my own encryption that no one can hack since im running my own server, so i made my own table files with my encryption but now the exe wont read them since i changed the table encyption to my own.. so i have to change the exe to read it and that's where the modifiers come into play i don't know what im looking for

Iv also included the exe to see if any of u can find it for me :)

http://www.fileswap.com/dl/8JdKHJR9rX/Exe.rar.html

the exe is a false positive so no worries there..

so i hope to see if someone can explain to me what im looking to change in the exe to have it work
Last edited on
The code you posted is neither C++ nor Assembly.
That looks a lot like C#.

Sadly, I don't think we have many people who understand C# that well. I guess it is similar in many ways to Java, but it uses a very different standard library.

Hopefully you'll get it running, either with or without our help. :)

-Albatross
opps sorry its C# do believe and i also work on the code in Microsoft Visual Studio 2010

and the exe is c++ i just don't know how to patch it with this encryption

and thank you for the reply i hope i can get some help
Last edited on
num5 = num5 >> 35795145;
Hehe, good luck with that.
i just changed it, i was going to make it 32 possibly idk yet and i don't even now how that works
Last edited on
so would anyone suggest how to find the main encryption in the exe ? any idea at this point will work
Topic archived. No new replies allowed.