Hi,
I have an Exe which accepts a 6 digit number and produces an output of another 6 digit number.
It is using hexa decimal conversion and it is a 32 bit signed Integer. It has 40 steps to produce an output and with shift left next number is calculated. Once the sum reaches the maximum limit,(Overflow Happens). At this place, the logic is changed. Instead of using shift left, some other process is used to max the result into a valid number(Falls in the range).
Any kind of help to sort out this is preferable.

Ex/.
If I enter Input as 1,
2 0
4 1
8 2
10 3
20 4
40 5
80 6
100 7
200 8
400 9
800 a
1000 b
2000 c
4000 d
8000 e
10000 f
20000 10
40000 11
80000 12
100000 13
200000 14
400000 15
800000 16
1000000 17
2000000 18
4000000 19
8000000 1a
10000000 1b
20000000 1c
40000000 1d
80000000 1e
77982990 1f
ef305320 20
a9f88fd0 21
24693630 22
48d26c60 23
91a4d8c0 24
54d19810 25
a9a33020 26
24de49d0 27

the output generated is, 547664(convert the 27th result into decimal, and the last 6 digits are taken as output).

Note : upto 1e, the sum is under the Integer range, once it is out of range, the algorithm changes and the number become positive, again shift left till overflow.

Kavitha
Posted on 2003-10-20 23:03:41 by gkavi_tha
Sounds like you're cracking. Where are the board operators? I feel threatened...
Posted on 2003-10-21 06:51:55 by comrade
Click the link "Report this post to a moderator" in his post, and notify the moderators.
Posted on 2003-10-21 07:26:46 by scientica
Healthy paranoia? :grin:
Posted on 2003-10-21 09:51:59 by Homer
gkavi_tha, at a very far leap of the imagination I could assume your talking about your own code and you have a question about it not functioning correctly -- even though we all are aware that what your doing is called reverse engineering. We know this because you didn't post any source code with this question. Let me see the algorithm your trying to diagnose and convince us that your goals are honourable.
Posted on 2003-10-21 21:24:29 by bitRAKE
Hi All,
Ya, the exe is mine and the person who wrote is not with us. This is working perfect with the defined logic. THere is no mistakes in it. Thats why I want to extend this..
Posted on 2003-10-21 23:29:34 by gkavi_tha
Can you please post the source code of the algorithm so we can help answer the question?
Posted on 2003-10-22 06:34:13 by bitRAKE
Hi BitRake,
I dont have source code with me. May be I can help you to give some more examples. Attached doc will give you more details.

We have to trace based on the sequence of numbers generated before getting the output.

27 th s.no will give the output. Hex. have to convert to decimal and the last 6 digits are the result.

Posted on 2003-10-22 07:46:27 by gkavi_tha
gkavi_tha, if the program is yours then this is the wrong way to approach the problem. It would be much easier to look at the source code to the algorithm. It is a waste of time to look at input<-->output dumps and I will not assist in that regaurd. The rules of this board do not allow reverse engineering. Just because you can see some linear correlation in the algorithm does not mean the algorithm is completely linear - you are wasting your time.
Posted on 2003-10-22 08:29:10 by bitRAKE
Hi
>>>>if the program is yours then this is the wrong way to approach the problem. It would be much easier to look at the source code to the algorithm. <<<

Yes the program is mine(as I m responsible),but the person who wrote this is not with us and this was written long back. So no source code/documentation available as well as no clue about the algorithm. But we are using this.
Now due to extensibility of the exe, I am in position to implement the same algorithm. This is confidential exe and so I am not in position to post the exe too.

If I have the source code with me, I am knowlegde enough to understand it.

GK
Posted on 2003-10-23 05:27:11 by gkavi_tha

If I have the source code with me, I am knowlegde enough to understand it.
Then look at the EXE in a debugger and you are done. :grin: It is not my intent to insult you, but to inform you of my inablity to assist you without code. I can understand your position of having to support a program which you have no documentation for - not a position I would ever put myself in and would talk myself out of.

Good luck on finding a solution.
Posted on 2003-10-23 08:15:41 by bitRAKE
To be honest, if you know enough assembly to understand source, then you should be able to re-create the exe yourself.

From the sounds of it it's not difficult, bar the definition of the second function its all simple code.

``````
mov eax, TheNumber
bsr ecx, eax
; jnz TheNumberIsZero
inc cl
ror eax, cl

; Insert your second function here

xor eax, eax
div eax, 1000000

; edx holds the result.
``````

What more is there to it than that. If you give us any more information on the second function, then your private executable is pretty much public, there's not much more to tell us!

Mirno
Posted on 2003-10-23 16:55:14 by Mirno
Hi All,
I solved my problem..