View Single Post
  #1  
Old 09-11-2009, 10:02
MrGneissGuy's
 
Posts: n/a
Runtime Error R6002 - Floating point not loaded

Hello,

I just arrived and thought I'd start by sharing the a little discovery I made that REALLY helped a lot.

If a program uses any floating point operations and has been packed and then unpacked, this error might arise.

If a compiler links a C runtime library that references a read only section, the compiler will add a check to make
sure that the referenced section is still read only. If it's not readonly, it produces this error and proceeds to crash.

This has happened on a few apps of mine which required the use of FP numbers.

I did some searching and found a couple of suggestions.

One possible fix is to change the referenced section to readonly using a pe editor, but this can lead to results worse
than a crash at certain points.

Another "solution" I found would patch the exception, but that caused the program to fail on the FP call but not crash
(in the program I tested it with anyway).

But I found that recompressing the pe with UPX did the trick! The floating point operations run flawlessly as does everything else.

So right now you may be saying "But I JUST unpacked the thing!", and you're right. However, Floating Point operations
are seldomly used in programming, and I rarely see a serial verification algorithm that uses them. So you could leave the
PE unpacked while you're reversing it, then pack the fixed file in UPX to fix any errors that may occur in other areas of the program.

This worked with PECompact 2.x and Armadillo 3.x
Reply With Quote