 Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   Find the Algorithm (https://forum.exetools.com/showthread.php?t=19425)

 mcr4ck 01-13-2020 05:15

Find the Algorithm

I would like to see some of my friends take the algorithm out of these formulas
They all count on one algorithm

0101=70f5
de50=2c8c
0102=dde2
ffff-5967

 chants 01-14-2020 02:49

An infinite number of mathematical or algorithmic mappings are possible. Probably you need to be more specific on what operations are allowed and maximum number of ops as well as maybe more values. Otherwise easy enough:
(x&0xf==1)*0x70f5+(x&0xf==0)*0x2c8c+(x&0xf==2)*0xdde2+(x&0xf==0xf)*0x5967

Technically speaking that one liner is an algorithm upon which they all rely. I'm not sure how to properly mathematically phrase what I feel you ar asking, as doubtlessly not my silly example, but it's interesting in how hard the question might be to exactly specify. I would think something like the minimal kolmogorov complexity but even then maybe this formula is simpler with a mere 4 cases. I would like to see not only the intended answer but how are we to ask in a way which excludes all the endless wrong ones ;)

 mcr4ck 01-14-2020 04:26

I didn't understand anything from the formula
I think it's flawed
On the other hand, the numbers that are written together are calculated by a formula
That is, they are separate
0101=70f5
or
de50=2c8c
or
0102=dde2
or
ffff=5967

Here's the formula for calculating this
That is to say, if we give an input to these numbers, give me an output according to the numbers above.

for example:

in 0101 ==> out 70f5
or

in de50 ==> out 2c8c

or
in 0102 ==> out dde2

 chants 01-14-2020 04:36

My formula used bit wise and &, equality comparison ==, implicit cast of true/false to 1/0 and integer multiplication *, and integer addition +. It should work in C or Javascript or what have you. x is the input, the result is the output. Exactly as you specify it.

This works since the last digits are all unique. By bitwise and with 0xf, we get the last digit of the input and compare with each unique last digit. If equal it will result in 1 times the correct output value otherwise 0. Then summed all together maps them properly.

Any one to one mapping can be done without the bitwise and, using only the other 4 operations. Of course it will only work for individual inputs then and will always be zero for not yet seen numbers. Currently it works for individual input last digits that match and is 0 for all other inputs.

 mcr4ck 01-14-2020 15:41

I didn't really understand what you meant
Can you give an example
It means giving in and taking out

 chants 01-17-2020 06:35

Just open a Python 3.7 console:
Code:

```>>> x=0x0101 >>> hex((x&0xf==1)*0x70f5+(x&0xf==0)*0x2c8c+(x&0xf==2)*0xdde2+(x&0xf==0xf)*0x5967) '0x70f5' >>> x=0xde50 >>> hex((x&0xf==1)*0x70f5+(x&0xf==0)*0x2c8c+(x&0xf==2)*0xdde2+(x&0xf==0xf)*0x5967) '0x2c8c' >>> x=0x0102 >>> hex((x&0xf==1)*0x70f5+(x&0xf==0)*0x2c8c+(x&0xf==2)*0xdde2+(x&0xf==0xf)*0x5967) '0xdde2' >>> x=0xffff >>> hex((x&0xf==1)*0x70f5+(x&0xf==0)*0x2c8c+(x&0xf==2)*0xdde2+(x&0xf==0xf)*0x5967) '0x5967'```
The formula is
Code:

`f(x)=(x&0xf==1)*0x70f5+(x&0xf==0)*0x2c8c+(x&0xf==2)*0xdde2+(x&0xf==0xf)*0x5967`
You should learn how and why this works and try to understand the basic code. Its not the solution you are looking for but simply asking for a mapping function with a few points is pretty generic. Without having some white box information or a lot of values or some obvious pattern, my answer could be as good as any.

 mcr4ck 01-18-2020 18:29

Too many codes I just cited, for example
You should not relate to each other
Because I want to get the output
Now if I change the input the output will change too
I want a single formula that matches the input and output I gave
That means the number of entries is too high, and I only said eight
You have included all four outputs in the calculation

in 0202===> out ?

What chants is saying, is that you can't derive the algorithm from 4 challenge-response combinations.
Even if you had a lot more combinations of challenge-response codes, it would probably be difficult to deduce the formula.

The formula chants provided works with the four combinations you provided. It does not mean that it is the formula that originally gave them. This means that if you had a fifth pair of challenge-response codes, the output derived from chant's formula would almost certainly mismatch the responce code of your black-box.

 mcr4ck 01-25-2020 18:06

hi

for more example:

3300 -> 729C
3301 -> BEF5
3302 -> 4BE2
3303 -> 111B
3304 -> 2750
3305 -> 7DA9
3306 -> 21A6
3307 -> AEDF
3308 -> E594
3309 -> 77ED
330A -> 805A
330B -> 4993
330C -> A148
330D -> D121
330E -> B6DE
330F -> 31D7
3310 -> 2DCC
3311 -> 5FA5
3312 -> 6352
3313 -> F40B
3315 -> B999
3316 -> C356
3317 -> 610F
3318 -> 2804
3319 -> 5A9D
331A -> 348A
331B -> 9403
331C -> 6DF8
331D -> 9851

Can we make an algorithm for these?

 mcr4ck 01-25-2020 18:08

hi

for more example:

3300 -> 729C
3301 -> BEF5
3302 -> 4BE2
3303 -> 111B
3304 -> 2750
3305 -> 7DA9
3306 -> 21A6
3307 -> AEDF
3308 -> E594
3309 -> 77ED
330A -> 805A
330B -> 4993
330C -> A148
330D -> D121
330E -> B6DE
330F -> 31D7
3310 -> 2DCC
3311 -> 5FA5
3312 -> 6352
3313 -> F40B
3315 -> B999
3316 -> C356
3317 -> 610F
3318 -> 2804
3319 -> 5A9D
331A -> 348A
331B -> 9403
331C -> 6DF8
331D -> 9851

Can we make an algorithm for these?

 niculaita 01-26-2020 21:57

yes, obligate/set anytine 331D as enter values and you will know anytime the answer :)

 mcr4ck 01-27-2020 05:27

Can you explain by example
I want to find the algorithm constant
That is, give the input high numbers and deliver the output that is written in front of it.
for example:
in out
3300 ==> 729C
or
3301==>BEF5
or
3302==>4BE2

 chants 01-27-2020 11:36

Well the last bit of numbers never change so
Odd -> odd, even -> even, in fact even last 2 bits are constant, so modulo 4 constant and simple mapping of the other 2 bits.
Also the last 4 bits are easy one to one mapping
0 to C
1 to 5
2 to 2
3 to B
4 to 0
5 to 9
6 to 6
7 to F
8 to 4
9 to D
A to A
B to 3
C to 8
D to 1
E to E
F to 7
So remainder 2 stays same, remainder 0 adds C, remainder 1 adds 4, remainder 3 adds 8, all of these modulo 16, to keep 4 bits. Easy to write as a formula in a variety of ways from boolean equations to division and modulo or doing some bit twiddling.

I don't see how the first 12 bits are derived though

 mcr4ck 01-27-2020 23:12

I did not catch

 chants 01-30-2020 16:50

Its the formula for the last hex digit. I don't know how the first 3 digits are computed.
Code:

`((input%16)+((input%4)<=1)*4+(((input-1)%4)>=2)*8)%16`
So 25% of the answer at least. It works for all values you have given and should work for any possible value.

All times are GMT +8. The time now is 15:27.