Hello, I am trying to make some very elementary thing that will cycle through every possible permutation of an array.
Really this is being done in assembly, but I'll explain it in C.
Basically, say we have an array uint8_t *data=malloc(10);
I want to create an algorithm that will print every possible combination of the bytes in the array data
.
Yes, I know it will be slow(and there are many values), and I'm not asking for really a complex optimized version.. I'm just looking for something that I can leave running on my computer as a sort of brute-force type thing to find certain values that obey certain conditions..
(note, I say permutation because [0,1,2] should not be counted the same as [2,1,0])
edit: Also, try not to use too many libc functions because I will be converting this to a freestanding bootloader with only 512 bytes.
I know I know how to do this but for the life of me I just can not make the algorithm work in my head!