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.

Active in Last 5 Minutes
j00ru

There are 21,678 total registered users.


Recently Created Topics
PyEmu error when cal...
Sep/02
Restore Themida/Winl...
Sep/02
Anti-olly technique
Aug/30
RAR Password
Aug/29
Heap protection on W...
Aug/23
Why Inline asm in C+...
Aug/20
Bypassing OllyAdvance
Aug/17
Error in logic for g...
Aug/17
Has anyone seen this...
Aug/17
ARM Executable - Pat...
Aug/16


Recent Forum Posts
reverse engineering ...
raiden56
pydbg, memory breakp...
Researc...
RAR Password
Ineedhelp
RAR Password
cod
Heap protection on W...
voila
Heap protection on W...
j00ru
Heap protection on W...
voila
Heap protection on W...
j00ru
Heap protection on W...
psylocn
Why Inline asm in C+...
ronnie2...


Recent Blog Entries
meshmesh
Sep/01
Is it legal??

waleedassar
Aug/30
Anti-olly technique

QvasiModo
Aug/24
WinAppDbg 1.4 is out!

artemblagodarenko
Aug/18
Dataflow-0.2.0 released. Ne...

grzonu
Aug/17
Bypassing OllyAdvanced

More ...


Recent Blog Comments
tosanjay on:
Sep/02
PyEmu 0.0.2

GynvaelColdwind on:
Sep/01
Is it legal??

PeterFerrie on:
Aug/31
Anti-olly technique

dennis on:
Aug/26
Dr. Gadget IDAPython plugin

halsten on:
Aug/19
Dataflow-0.2.0 released. Ne...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit