📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








Flag: Tornado! Hurricane!

 Forums >>  Brainstorms - General  >>  Understanding raw floating-point tables

Topic created on: July 3, 2009 04:24 CDT by maximumlust .

Hello crews,

I'm doing RE since years. Most of the time my research is targeting multimedia compression algorithms and formats. Most of them use some floating-point code. Its complexity may be ranging between very simply tasks and high-speed signal processing.
I often need to understand some piece of code were optimized up using hardcoded tables. Here an example of such a table:

0.0, 1.0, 1.414, 1.732, 2.0, 2.236, 2.449, 2.645, 2.828, 3.0 and so on

It's obvious that the table stores square root products. Then we can rewrite that to the following:

sqrt(0), sqrt(1), sqrt(2), sqrt(3), sqrt(4), sqrt(5), sqrt(6), sqrt(7), sqrt(8), sqrt(9) and so on...

This is more readable and helps to understand the code much easier...

Most often numbers stored in tables are sin/cos precalculations, exp products, log tables, linear prediction and so on...

NOW MY QUESTION:
Is there any possibility to analyse such tables (vector of numbers) mathematically in order to be able to extract an unknown function? Is there a tool/script can give an idea what kind of number it can be? I was always doing it using my knowledges/experience and some google help :))
The example above is very simple but programs in the real world will be surely much more complex...


Any help would be appreciated
Best regards
Maxim

  detlef   July 3, 2009 04:58.15 CDT
I don't know such a tool.

The basic concept is simple but the integration is not that easy.
Isn't it all about defining a range R, a resolution r and all possible other inputs I parameters for a method M and try to find similarities between the calculated M(x), x out of R,r for all I.
If you find similarities adjust your range and your solution till the your test set is similar to the reference set.
Iterate trough all methods and search for similar outputs.
That's how a mathematician would define the problem.

It's really difficult to integrate this approach in an efficently way if you do not have any restrictions. If you can limit the search space, it becomes easier and faster.

For me, this sounds like a good idea for an new open source project or something similar.

  monarch   July 6, 2009 09:23.36 CDT
Anything that isn't obvious after a few minutes of google, you may want to use Mathematica and plot the points.
Then a polynomial approximation will assist in getting a "look" at it. Its a picture matching game after that.

  wtbw     July 8, 2009 07:12.55 CDT
It may not be helpful in this particular case as they're floats, but the online integer sequence encyclopedia has been very useful for me in a number of cases:

http://www.research.att.com/~njas/sequences/

Note: Registration is required to post to the forums.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit