Jump to content

Question

Posted

Hi,

I just wonder if it's possible to know the algorithm used for encryption/decryption if we know the real value of some encrypted numbers like in my case I know that 

1.545.691.265 = 0 Coins

1.545.691.300 = 37 Coins

1.545.691.494 = 487 Coins

etc..

10 answers to this question

Recommended Posts

  • 0
  • Moderators
Posted

Maybe with gdb. Set write watchpoint on the value. Then you'll get an offset related to the encryption. Assuming game is lib file and not dll.

  • 0
Posted
15 minutes ago, NoFear said:

Maybe with gdb. Set write watchpoint on the value. Then you'll get an offset related to the encryption. Assuming game is lib file and not dll.

Thanks for the quick answer but can you tell me how to do that or give me some useful link(s) ?

  • 0
Posted

It's xor-encryption with the key "1 545 691 265" (equal to value with 0 coins).

1 545 691 265 xor 37 = 1 545 691 300

1 545 691 265 xor 487 = 1 545 691 494

Therefore, to get encrypted value Y that corresponds to real value X, you need to use the following formula:

Y = 1 545 691 265 xor X

This will work, if the key is constant. If it is not, you will first need to find it out to be able to calculate encrypted values.

  • 0
  • Administrators
Posted

1.545.691.265 xor 0 = 1545691265

1.545.691.300 xor 37 = 1545691265

1.545.691.494 xor 487 = 1545691265

so it is simple xor with key = 1545691265

  • 0
  • Moderators
Posted

I think iosgods has lldb debugging guide for ios.

It's not too different than Android. Lldb only supports x64 on Android. So you may want to do the equivalent with gdb.

3 minutes ago, CmP said:

It's xor-encryption with the key "1 545 691 265" (equal to value with 0 coins).

1 545 691 265 xor 37 = 1 545 691 300

1 545 691 265 xor 487 = 1 545 691 494

Therefore, to get encrypted value Y that corresponds to real value X, you need to use the following formula:

Y = 1 545 691 265 xor X

This will work, if the key is constant. If it is not, you will first need to find it out to be able to calculate encrypted values.

Heh, didn't even think to try that first 😛

 

Edit: 

For more complex Encryption, debugging could help.

  • 0
Posted
4 hours ago, NoFear said:

Maybe with gdb. Set write watchpoint on the value. Then you'll get an offset related to the encryption. Assuming game is lib file and not dll.

gdb needs root?

  • 0
  • Moderators
Posted
56 minutes ago, nalcwap said:

you know any ap android for debug without root?

I think if you use ida on pc. You can debug without root that way.

I just prefer gdb, for I don't need pc to do it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.