Jump to content
  • 0

Decrypt values


Dark-Yox
 Share

Question

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..

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0
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) ?

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0
  • Moderators

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.

Link to comment
Share on other sites

  • 0
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?

Link to comment
Share on other sites

  • 0
  • Moderators
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.

Link to comment
Share on other sites

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
 Share

×
×
  • 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.