LoaderTest.cpp

Go to the documentation of this file.
00001 /*==============================================================================
00002  * FILE:       LoaderTest.cc
00003  * OVERVIEW:   Provides the implementation for the LoaderTest class, which
00004  *              tests the BinaryFile and derived classes
00005  *============================================================================*/
00006 /*
00007  * $Revision: 1.12 $
00008  *
00009  * 05 Apr 02 - Mike: Created
00010  * 14 Jun 02 - Mike: Added windows test for calc.exe
00011  * 20 Jun 02 - Mike: Added test for microX86Dis
00012  * 08 Jul 02 - Mike: Test more exe file formats
00013  * 30 Sep 02 - Trent: split microDis tests
00014  * 30 Sep 02 - Trent: remove dependancy between microDis test1 and Elf loader
00015  * 05 Aug 05 - Mike: added borland test; check address of main (not just != NO_ADDRESS)
00016  */
00017 
00018 #define HELLO_SPARC     "test/sparc/hello"
00019 #define HELLO_PENTIUM   "test/pentium/hello"
00020 #define HELLO_HPPA      "test/hppa/hello"
00021 #define STARTER_PALM    "test/mc68328/Starter.prc"
00022 #define CALC_WINDOWS    "test/windows/calc.exe"
00023 #define CALC_WINXP      "test/windows/calcXP.exe"
00024 #define CALC_WIN2000    "test/windows/calc2000.exe"
00025 #define LPQ_WINDOWS     "test/windows/lpq.exe"
00026 #define SWITCH_BORLAND  "test/windows/switch_borland.exe"
00027 #define ELFBINFILE      "lib/libElfBinaryFile.so"
00028 
00029 #include "string"
00030 #include "LoaderTest.h"
00031 //#include "util.h"           // For str()
00032 #include <iostream>         // For cout
00033 #ifndef _WIN32
00034 #include <dlfcn.h>          // dlopen, dlsym
00035 #endif
00036 
00037 /*==============================================================================
00038  * FUNCTION:        LoaderTest::registerTests
00039  * OVERVIEW:        Register the test functions in the given suite
00040  * PARAMETERS:      Pointer to the test suite
00041  * RETURNS:         <nothing>
00042  *============================================================================*/
00043 #define MYTEST(name) \
00044 suite->addTest(new CppUnit::TestCaller<LoaderTest> ("LoaderTest", \
00045     &LoaderTest::name, *this))
00046 
00047 void LoaderTest::registerTests(CppUnit::TestSuite* suite) {
00048     MYTEST(testSparcLoad);
00049     MYTEST(testPentiumLoad);
00050     MYTEST(testHppaLoad);
00051     MYTEST(testPalmLoad);
00052     MYTEST(testWinLoad);
00053 
00054     MYTEST(testMicroDis1);
00055     MYTEST(testMicroDis2);
00056 
00057     MYTEST(testElfHash);
00058 }
00059 
00060 int LoaderTest::countTestCases () const
00061 { return 7; }   // ? What's this for?
00062 
00063 /*==============================================================================
00064  * FUNCTION:        LoaderTest::setUp
00065  * OVERVIEW:        Set up anything needed before all tests
00066  * NOTE:            Called before any tests
00067  * PARAMETERS:      <none>
00068  * RETURNS:         <nothing>
00069  *============================================================================*/
00070 void LoaderTest::setUp () {
00071 }
00072 
00073 /*==============================================================================
00074  * FUNCTION:        LoaderTest::tearDown
00075  * OVERVIEW:        Delete objects created in setUp
00076  * NOTE:            Called after all tests
00077  * PARAMETERS:      <none>
00078  * RETURNS:         <nothing>
00079  *============================================================================*/
00080 void LoaderTest::tearDown () {
00081 }
00082 
00083 /*==============================================================================
00084  * FUNCTION:        LoaderTest::testSparcLoad
00085  * OVERVIEW:        Test loading the sparc hello world program
00086  *============================================================================*/
00087 void LoaderTest::testSparcLoad () {
00088     std::ostringstream ost;
00089 
00090     // Load SPARC hello world
00091     BinaryFileFactory bff;
00092     BinaryFile* pBF = bff.Load(HELLO_SPARC);
00093     CPPUNIT_ASSERT(pBF != NULL);
00094     int n;
00095     SectionInfo* si;
00096     n = pBF->GetNumSections();
00097     ost << "Number of sections = " << std::dec << n << "\r\n\t";
00098     // Just use the first (real one) and last sections
00099     si = pBF->GetSectionInfo(1);
00100     ost << si->pSectionName << "\t";
00101     si = pBF->GetSectionInfo(n-1);
00102     ost << si->pSectionName;
00103     pBF->UnLoad();
00104     // Note: the string below needs to have embedded tabs. Edit with caution!
00105     std::string expected("Number of sections = 29\r\n\t"
00106         ".interp    .stab.indexstr");
00107     CPPUNIT_ASSERT_EQUAL(expected, ost.str());
00108     bff.UnLoad();
00109 }
00110 
00111 /*==============================================================================
00112  * FUNCTION:        LoaderTest::testPentiumLoad
00113  * OVERVIEW:        Test loading the pentium (Solaris) hello world program
00114  *============================================================================*/
00115 void LoaderTest::testPentiumLoad () {
00116     std::ostringstream ost;
00117 
00118     // Load Pentium hello world
00119     BinaryFileFactory bff;
00120     BinaryFile* pBF = bff.Load(HELLO_PENTIUM);
00121     CPPUNIT_ASSERT(pBF != NULL);
00122     int n;
00123     SectionInfo* si;
00124     n = pBF->GetNumSections();
00125     ost << "Number of sections = " << std::dec << n << "\r\n\t";
00126     si = pBF->GetSectionInfo(1);
00127     ost << si->pSectionName << "\t";
00128     si = pBF->GetSectionInfo(n-1);
00129     ost << si->pSectionName;
00130     pBF->UnLoad();
00131     // Note: the string below needs to have embedded tabs. Edit with caution!
00132     // (And slightly different string to the sparc test, e.g. rel vs rela)
00133     std::string expected("Number of sections = 34\r\n\t"
00134         ".interp    .strtab");
00135 
00136 
00137     CPPUNIT_ASSERT_EQUAL(expected, ost.str());
00138     bff.UnLoad();
00139 }
00140 
00141 /*==============================================================================
00142  * FUNCTION:        LoaderTest::testHppaLoad
00143  * OVERVIEW:        Test loading the sparc hello world program
00144  *============================================================================*/
00145 void LoaderTest::testHppaLoad () {
00146     std::ostringstream ost;
00147 
00148     // Load HPPA hello world
00149     BinaryFileFactory bff;
00150     BinaryFile* pBF = bff.Load(HELLO_HPPA);
00151     CPPUNIT_ASSERT(pBF != NULL);
00152     int n;
00153     SectionInfo* si;
00154     n = pBF->GetNumSections();
00155     ost << "Number of sections = " << std::dec << n << "\r\n";
00156     for (int i=0; i < n; i++) {
00157         si = pBF->GetSectionInfo(i);
00158         ost << si->pSectionName << "\t";
00159     }
00160     pBF->UnLoad();
00161     // Note: the string below needs to have embedded tabs. Edit with caution!
00162     std::string expected("Number of sections = 4\r\n"
00163         "$HEADER$   $TEXT$  $DATA$  $BSS$   ");
00164     CPPUNIT_ASSERT_EQUAL(expected, ost.str());
00165     bff.UnLoad();
00166 }
00167 
00168 /*==============================================================================
00169  * FUNCTION:        LoaderTest::testPalmLoad
00170  * OVERVIEW:        Test loading the Palm 68328 Starter.prc program
00171  *============================================================================*/
00172 void LoaderTest::testPalmLoad () {
00173     std::ostringstream ost;
00174 
00175     // Load Palm Starter.prc
00176     BinaryFileFactory bff;
00177     BinaryFile* pBF = bff.Load(STARTER_PALM);
00178     CPPUNIT_ASSERT(pBF != NULL);
00179     int n;
00180     SectionInfo* si;
00181     n = pBF->GetNumSections();
00182     ost << "Number of sections = " << std::dec << n << "\r\n";
00183     for (int i=0; i < n; i++) {
00184         si = pBF->GetSectionInfo(i);
00185         ost << si->pSectionName << "\t";
00186     }
00187     pBF->UnLoad();
00188     // Note: the string below needs to have embedded tabs. Edit with caution!
00189     std::string expected("Number of sections = 8\r\n"
00190         "code1  MBAR1000    tFRM1000    Talt1001    "
00191         "data0  code0   tAIN1000    tver1000    ");
00192     CPPUNIT_ASSERT_EQUAL(expected, ost.str());
00193     bff.UnLoad();
00194 }
00195 
00196 /*==============================================================================
00197  * FUNCTION:        LoaderTest::testWinLoad
00198  * OVERVIEW:        Test loading the Windows calc.exe program
00199  *============================================================================*/
00200 void LoaderTest::testWinLoad () {
00201     std::ostringstream ost;
00202 
00203     // Load Windows program calc.exe
00204     BinaryFileFactory bff;
00205     BinaryFile* pBF = bff.Load(CALC_WINDOWS);
00206     CPPUNIT_ASSERT(pBF != NULL);
00207     int n;
00208     SectionInfo* si;
00209     n = pBF->GetNumSections();
00210     ost << "Number of sections = " << std::dec << n << "\r\n";
00211     for (int i=0; i < n; i++) {
00212         si = pBF->GetSectionInfo(i);
00213         ost << si->pSectionName << "\t";
00214     }
00215 
00216     // Note: the string below needs to have embedded tabs. Edit with caution!
00217     std::string expected("Number of sections = 5\r\n"
00218         ".text  .rdata  .data   .rsrc   .reloc  ");
00219     std::string actual(ost.str());
00220     CPPUNIT_ASSERT_EQUAL(expected, actual);
00221 
00222     ADDRESS addr = pBF->GetMainEntryPoint();
00223     CPPUNIT_ASSERT(addr != NO_ADDRESS);
00224 
00225     // Test symbol table (imports)
00226     const char* s = pBF->SymbolByAddress(0x1292060U);
00227     if (s == 0)
00228         actual = "<not found>";
00229     else
00230         actual = std::string(s);
00231     expected = std::string("SetEvent");
00232     CPPUNIT_ASSERT_EQUAL(expected, actual);
00233 
00234     ADDRESS a = pBF->GetAddressByName("SetEvent");
00235     ADDRESS expectedAddr = 0x1292060;
00236     CPPUNIT_ASSERT_EQUAL(expectedAddr, a);
00237     pBF->UnLoad();
00238     bff.UnLoad();
00239 
00240     // Test loading the "new style" exes, as found in winXP etc
00241     pBF = bff.Load(CALC_WINXP);
00242     CPPUNIT_ASSERT(pBF != NULL);
00243     addr = pBF->GetMainEntryPoint();
00244     std::ostringstream ost1;
00245     ost1 << std::hex << addr;
00246     actual = ost1.str();
00247     expected = "1001f51";
00248     CPPUNIT_ASSERT_EQUAL(expected, actual);
00249     pBF->UnLoad();
00250     bff.UnLoad();
00251 
00252     // Test loading the calc.exe found in Windows 2000 (more NT based)
00253     pBF = bff.Load(CALC_WIN2000);
00254     CPPUNIT_ASSERT(pBF != NULL);
00255     expected = "1001680";
00256     addr = pBF->GetMainEntryPoint();
00257     std::ostringstream ost2;
00258     ost2 << std::hex << addr;
00259     actual = ost2.str();
00260     CPPUNIT_ASSERT_EQUAL(expected, actual);
00261     pBF->UnLoad();
00262     bff.UnLoad();
00263 
00264     // Test loading the lpq.exe program - console mode PE file
00265     pBF = bff.Load(LPQ_WINDOWS);
00266     CPPUNIT_ASSERT(pBF != NULL);
00267     addr = pBF->GetMainEntryPoint();
00268     std::ostringstream ost3;
00269     ost3 << std::hex << addr;
00270     actual = ost3.str();
00271     expected = "18c1000";
00272     CPPUNIT_ASSERT_EQUAL(expected, actual);
00273     pBF->UnLoad();
00274     bff.UnLoad();
00275 
00276     // Borland
00277     pBF = bff.Load(SWITCH_BORLAND);
00278     CPPUNIT_ASSERT(pBF != NULL);
00279     addr = pBF->GetMainEntryPoint();
00280     std::ostringstream ost4;
00281     ost4 << std::hex << addr;
00282     actual = ost4.str();
00283     expected = "401150";
00284     CPPUNIT_ASSERT_EQUAL(expected, actual);
00285     pBF->UnLoad();
00286     bff.UnLoad();
00287 }
00288 
00289 /*==============================================================================
00290  * FUNCTION:        LoaderTest::testMicroDis
00291  * OVERVIEW:        Test the micro disassembler
00292  *============================================================================*/
00293 extern "C" {
00294     int microX86Dis(void* p);
00295 }
00296 
00297 // The below lengths were derived from a quick and dirty program (called
00298 // quick.c) which used the output from a disassembly to find the lengths.
00299 // Best way to test, but of course this array is very dependent on the
00300 // exact booked in test program
00301 static char lengths[] = {
00302 2, 2, 2, 1, 5, 2, 2, 5, 5, 3, 5, 2, 2, 5, 5, 5, 3, 4, 6, 1,
00303 3, 1, 1, 5, 5, 5, 3, 1, 5, 2, 5, 7, 1, 1, 1, 2, 1, 5, 1, 6,
00304 2, 1, 1, 3, 6, 2, 2, 6, 3, 2, 6, 1, 5, 3, 1, 1, 1, 1, 1, 1,
00305 2, 1, 5, 1, 6, 3, 1, 1, 1, 1, 1, 1, 2, 1, 5, 1, 6, 6, 1, 6,
00306 1, 5, 3, 1, 1, 1, 2, 1, 5, 1, 6, 3, 1, 1, /* main */ 2, 3, 1, 5, 5, 3,
00307 2, 2, 1, /* label */ 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 3, 3, 1, 3, 2, 5, 2,
00308 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1,
00309 3, 7, 3, 1, 1, 1, 3, 1, 2, 5, 2, 3, 3, 2, 2, 2, 3, 2, 6, 2,
00310 5, 2, 3, 3, 3, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1,
00311 3, 3, 3, 3, 2, 2, 3, 1, 2, 3, 3, 4, 3, 3, 3, 2, 2, 2, 2, 3,
00312 2, 3, 3, 4, 3, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 3,
00313 2, 1, 1, 1, 4, 2, 4, 2, 1, 2, 2, 3, 4, 2, 2, 1, 1, 1, 1, 1,
00314 2, 3, 1, 1, 1, 5, 1, 6, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 1,
00315 1, 4, 2, 4, 2, 1, 1, 1, 3, 5, 3, 3, 3, 2, 3, 3, 3, 2, 3, 2,
00316 2, 3, 4, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1,
00317 1, 2, 3, 1, 1, 1, 5, 1, 6, 3, 3, 2, 2, 2, 7, 3, 2, 1, 1, 1,
00318 2, 5, 3, 3, 3, 3, 2, 2, 1, 3, 3, 5, 3, 3, 3, 3, 3, 3, 1, 5,
00319 2, 7, 2, 3, 3, 3, 3, 3, 2, 2, 2, 3, 2, 3, 3, 1, 1, 3, 3, 1,
00320 3, 1, 1, 2, 5, 3, 3, 3, 2, 2, 3, 1, 3, 1, 3, 1, 1, 3, 3, 5,
00321 3, 3, 3, 2, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1,
00322 1, 5, 1, 6, 6, 2, 2, 1, 3, 2, 1, 5, 3, 3, 2, 2, 3, 2, 3, 2,
00323 2, 2, 2, 2, 1, 3, 2, 1, 1, 1, 2, 3, 3, 2, 2, 3, 1, 3, 3, 2,
00324 2, 3, 3, 3, 3, 2, 3, 2, 1, 1, 1, 3, 3, 3, 2, 3, 3, 2, 2, 3,
00325 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 5, 1, 6, 3, 3, 5,
00326 2, 3, 3, 3, 2, 3, 6, 3, 5, 2, 1, 2, 2, 2, 3, 6, 5, 1, 2, 2,
00327 2, 4, 2, 2, 5, 1, 1, 1, 3, 2, 3, 2, 2, 2, 1, 5, 2, 2, 3, 4,
00328 3, 2, 1, 3, 3, 6, 3, 5, 1, 2, 2, 2, 3, 3, 3, 3, 3, 2, 1, 1,
00329 1, 3, 7, 3, 5, 1, 1, 5, 2, 3, 3, 1, 1, 5, 2, 3, 3, 3, 1, 2,
00330 3, 3, 2, 3, 1, 1, 5, 2, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1, 2, 3,
00331 1, 1, 1, 5, 1, 6, 3, 3, 3, 3, 1, 3, 2, 6, 3, 2, 5, 4, 2, 5,
00332 1, 1, 2, 2, 5, 3, 3, 1, 3, 5, 3, 3, 4, 3, 3, 3, 5, 3, 7, 3,
00333 4, 5, 1, 1, 2, 2, 5, 3, 3, 3, 4, 5, 1, 5, 6, 2, 7, 2, 1, 1,
00334 2, 2, 2, 2, 6, 2, 3, 2, 2, 4, 3, 2, 2, 2, 1, 2, 6, 2, 3, 2,
00335 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00336 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00337 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00338 2, 2, 2, 3, 2, 2, 6, 2, 3, 3, 5, 1, 1, 3, 3, 2, 1, 3, 5, 1,
00339 1, 1, 3, 3, 2, 3, 3, 5, 1, 2, 3, 2, 2, 3, 3, 5, 1, 1, 1, 1,
00340 3, 1, 3, 5, 3, 3, 1, 3, 5, 3, 3, 4, 3, 3, 3, 5, 3, 7, 3, 4,
00341 5, 1, 1, 1, 3, 1, 3, 5, 3, 3, 3, 5, 5, 1, 3, 1, 3, 5, 3, 3,
00342 1, 3, 5, 3, 3, 3, 5, 3, 7, 3, 4, 5, 1, 3, 1, 3, 5, 3, 3, 1,
00343 3, 5, 3, 3, 3, 4, 3, 3, 5, 1, 3, 1, 3, 5, 3, 3, 3, 4, 5, 1,
00344 1, 3, 1, 3, 5, 3, 3, 3, 3, 5, 1, 1, 1, 2, 5, 2, 2, 3, 2, 1,
00345 5, 2, 3, 3, 2, 3, 3, 2, 2, 2, 1, 5, 2, 1, 5, 2, 7, 1, 3, 3,
00346 5, 3, 7, 4, 3, 3, 2, 5, 2, 2, 1, 1, 3, 1, 3, 5, 3, 3, 3, 3,
00347 2, 1, 1, 5, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 5, 1,
00348 6, 3, 3, 3, 7, 6, 7, 7, 6, 3, 6, 3, 1, 1, 1, 2, 1, 5, 1, 6,
00349 3, 3, 3, 3, 7, 6, 7, 6, 3, 6, 3, 1, 1, 1, 2, 1, 5, 1, 6, 3,
00350 6, 7, 2, 1, 1, 2, 3, 2, 3, 2, 3, 2, 3, 5, 2, 1, 3, 4, 2, 5,
00351 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 6, 1, 1, 1, 5, 1, 6, 3, 5, 6,
00352 3, 2, 6, 3, 6, 1, 6, 5, 2, 3, 2, 6, 2, 2, 6, 6, 1, 5, 3, 4,
00353 3, 6, 3, 6, 3, 5, 2, 2, 2, 3, 2, 2, 6, 6, 6, 6, 1, 2, 6, 6,
00354 1, 5, 2, 3, 2, 2, 6, 3, 3, 3, 2, 6, 1, 1, 5, 2, 6, 3, 6, 2,
00355 3, 6, 3, 6, 2, 2, 6, 6, 3, 6, 2, 6, 3, 1, 6, 1, 1, 5, 2, 3,
00356 2, 2, 3, 6, 1, 5, 2, 3, 6, 1, 1, 1, 1, /* label */ 1, 2, 1, 2, 1, 1, 5, 1,
00357 6, 6, 3, 4, 2, 2, 2, 3, 3, 2, 3, 1, 1, 1, 1, 1, 1, 2, 1, 5,
00358 1, 6, 3, 1, 1
00359 };
00360 
00361 // text segment of hello pentium
00362 static char pent_hello_text[] = {
00363 0x6a, 0x00, 0x6a, 0x00, 0x8b, 0xec, 0x52, 0xb8, 0x80, 0x87, 0x04, 0x08, 0x85, 0xc0, 0x74, 0x0d,
00364 0x68, 0x80, 0x87, 0x04, 0x08, 0xe8, 0x66, 0xff, 0xff, 0xff, 0x83, 0xc4, 0x04, 0xb8, 0x44, 0xa4,
00365 0x04, 0x08, 0x85, 0xc0, 0x74, 0x05, 0xe8, 0x55, 0xff, 0xff, 0xff, 0x68, 0xe0, 0x93, 0x04, 0x08,
00366 0xe8, 0x4b, 0xff, 0xff, 0xff, 0x8b, 0x45, 0x08, 0x8d, 0x54, 0x85, 0x10, 0x89, 0x15, 0x0c, 0xaa,
00367 0x04, 0x08, 0x52, 0x8d, 0x55, 0x0c, 0x52, 0x50, 0xe8, 0x53, 0x0b, 0x00, 0x00, 0xe8, 0x3e, 0xff,
00368 0xff, 0xff, 0xe8, 0xb1, 0x00, 0x00, 0x00, 0x83, 0xc4, 0x0c, 0x50, 0xe8, 0x40, 0xff, 0xff, 0xff,
00369 0x6a, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0xf4, 0xc3,
00370 0x55, 0x8b, 0xec, 0x53, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x81, 0xc3, 0x8b, 0x1b, 0x00, 0x00,
00371 0xeb, 0x0f, 0x90, 0x90, 0x8d, 0x50, 0x04, 0x89, 0x93, 0xc8, 0x00, 0x00, 0x00, 0x8b, 0x00, 0xff,
00372 0xd0, 0x8b, 0x83, 0xc8, 0x00, 0x00, 0x00, 0x83, 0x38, 0x00, 0x75, 0xe8, 0x8d, 0x83, 0xdc, 0x00,
00373 0x00, 0x00, 0x50, 0xe8, 0xe8, 0x08, 0x00, 0x00, 0x8b, 0x5d, 0xfc, 0xc9, 0xc3, 0x90, 0x90, 0x90,
00374 0x55, 0x8b, 0xec, 0x53, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x81, 0xc3, 0x4b, 0x1b, 0x00, 0x00,
00375 0x8b, 0x5d, 0xfc, 0xc9, 0xc3, 0x90, 0x90, 0x90, 0x55, 0x8b, 0xec, 0x53, 0xe8, 0x00, 0x00, 0x00,
00376 0x00, 0x5b, 0x81, 0xc3, 0x33, 0x1b, 0x00, 0x00, 0x8d, 0x83, 0xdc, 0x05, 0x00, 0x00, 0x50, 0x8d,
00377 0x83, 0xdc, 0x00, 0x00, 0x00, 0x50, 0xe8, 0x19, 0x08, 0x00, 0x00, 0x8b, 0x5d, 0xfc, 0xc9, 0xc3,
00378 0x55, 0x8b, 0xec, 0x53, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x81, 0xc3, 0x0b, 0x1b, 0x00, 0x00,
00379 0x8b, 0x5d, 0xfc, 0xc9, 0xc3, 0x00, 0x00, 0x00, 0x55, 0x8b, 0xec, 0x68, 0xf8, 0x93, 0x04, 0x08,
00380 0xe8, 0x9b, 0xfe, 0xff, 0xff, 0x83, 0xc4, 0x04, 0x33, 0xc0, 0xeb, 0x00, 0xc9, 0xc3, 0x00, 0x00,
00381 0x55, 0x8b, 0xec, 0x57, 0x56, 0x33, 0xff, 0x8b, 0xf7, 0x90, 0x90, 0x90, 0x8b, 0x4d, 0x08, 0x0f,
00382 0xb6, 0x11, 0x41, 0x89, 0x4d, 0x08, 0x8b, 0xc2, 0x25, 0x7f, 0x00, 0x00, 0x00, 0x8b, 0xce, 0xd3,
00383 0xe0, 0x0b, 0xf8, 0x84, 0xd2, 0x7d, 0x05, 0x83, 0xc6, 0x07, 0xeb, 0xe0, 0x8b, 0x45, 0x0c, 0x89,
00384 0x38, 0x8b, 0x45, 0x08, 0x8d, 0x65, 0xf8, 0x5e, 0x5f, 0xc9, 0xc3, 0x90, 0x55, 0x8b, 0xec, 0x83,
00385 0xec, 0x04, 0x57, 0x56, 0x8b, 0x7d, 0x08, 0xc7, 0x45, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x4d,
00386 0xfc, 0x90, 0x90, 0x90, 0x0f, 0xb6, 0x37, 0x47, 0x8b, 0xc6, 0x25, 0x7f, 0x00, 0x00, 0x00, 0xd3,
00387 0xe0, 0x09, 0x45, 0xfc, 0x83, 0xc1, 0x07, 0x8b, 0xd6, 0x84, 0xd2, 0x7c, 0xe7, 0x83, 0xf9, 0x1f,
00388 0x77, 0x12, 0xf7, 0xc6, 0x40, 0x00, 0x00, 0x00, 0x74, 0x0a, 0xb8, 0xff, 0xff, 0xff, 0xff, 0xd3,
00389 0xe0, 0x09, 0x45, 0xfc, 0x8b, 0x45, 0x0c, 0x8b, 0x55, 0xfc, 0x89, 0x10, 0x8b, 0xc7, 0x8d, 0x65,
00390 0xf4, 0x5e, 0x5f, 0xc9, 0xc3, 0x90, 0x90, 0x90, 0x55, 0x8b, 0xec, 0x83, 0xec, 0x08, 0x57, 0x56,
00391 0x8b, 0x55, 0x0c, 0x8b, 0x45, 0x10, 0x8b, 0x75, 0x08, 0x89, 0x04, 0x96, 0x85, 0xd2, 0x74, 0x36,
00392 0x8d, 0x0c, 0x96, 0x90, 0x8b, 0x39, 0x89, 0x7d, 0xfc, 0x8b, 0x75, 0x08, 0x8b, 0x74, 0x96, 0xfc,
00393 0x89, 0x75, 0xf8, 0x8b, 0x46, 0x08, 0x8b, 0x77, 0x08, 0x2b, 0xf0, 0x8b, 0xc6, 0x85, 0xc0, 0x7d,
00394 0x15, 0x8b, 0x7d, 0xf8, 0x89, 0x39, 0x8b, 0x7d, 0xfc, 0x8b, 0x75, 0x08, 0x89, 0x7c, 0x96, 0xfc,
00395 0x83, 0xc1, 0xfc, 0x4a, 0x75, 0xce, 0x8d, 0x65, 0xf0, 0x5e, 0x5f, 0xc9, 0xc3, 0x90, 0x90, 0x90,
00396 0x55, 0x8b, 0xec, 0x8b, 0x55, 0x08, 0x33, 0xc9, 0x83, 0x3a, 0x00, 0x74, 0x1d, 0x90, 0x90, 0x90,
00397 0x83, 0x7a, 0x04, 0x00, 0x74, 0x07, 0x83, 0x7a, 0x08, 0x00, 0x74, 0x01, 0x41, 0x8b, 0xc2, 0x03,
00398 0x02, 0x8d, 0x50, 0x04, 0x83, 0x78, 0x04, 0x00, 0x75, 0xe6, 0x8b, 0xc1, 0xc9, 0xc3, 0x90, 0x90,
00399 0x55, 0x8b, 0xec, 0x83, 0xec, 0x08, 0x57, 0x56, 0x53, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x81,
00400 0xc3, 0xb6, 0x19, 0x00, 0x00, 0x8b, 0x75, 0x08, 0x8b, 0x55, 0x10, 0x8b, 0x3a, 0x8b, 0x4d, 0x14,
00401 0x8b, 0x09, 0x89, 0x4d, 0xfc, 0x8b, 0x55, 0x18, 0x8b, 0x12, 0x89, 0x55, 0xf8, 0x83, 0x3e, 0x00,
00402 0x74, 0x3f, 0x90, 0x90, 0x83, 0x7e, 0x04, 0x00, 0x74, 0x2a, 0x83, 0x7e, 0x08, 0x00, 0x74, 0x24,
00403 0x56, 0x57, 0x47, 0xff, 0x75, 0x0c, 0xe8, 0x2d, 0xff, 0xff, 0xff, 0x8b, 0x46, 0x08, 0x83, 0xc4,
00404 0x0c, 0x39, 0x45, 0xfc, 0x76, 0x03, 0x89, 0x45, 0xfc, 0x03, 0x46, 0x0c, 0x39, 0x45, 0xf8, 0x73,
00405 0x03, 0x89, 0x45, 0xf8, 0x8b, 0xc6, 0x03, 0x06, 0x8d, 0x70, 0x04, 0x83, 0x78, 0x04, 0x00, 0x75,
00406 0xc3, 0x8b, 0x4d, 0x10, 0x89, 0x39, 0x8b, 0x4d, 0xfc, 0x8b, 0x55, 0x14, 0x89, 0x0a, 0x8b, 0x4d,
00407 0xf8, 0x8b, 0x55, 0x18, 0x89, 0x0a, 0x8d, 0x65, 0xec, 0x5b, 0x5e, 0x5f, 0xc9, 0xc3, 0x90, 0x90,
00408 0x55, 0x8b, 0xec, 0x83, 0xec, 0x10, 0x57, 0x56, 0x53, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x81,
00409 0xc3, 0x26, 0x19, 0x00, 0x00, 0x8b, 0x55, 0x08, 0x8b, 0x42, 0x0c, 0x85, 0xc0, 0x74, 0x29, 0x8b,
00410 0xf0, 0xc7, 0x45, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x83, 0x3e, 0x00, 0x74, 0x2c, 0x90, 0x90, 0x90,
00411 0xff, 0x36, 0xe8, 0x09, 0xff, 0xff, 0xff, 0x01, 0x45, 0xf4, 0x83, 0xc4, 0x04, 0x83, 0xc6, 0x04,
00412 0x83, 0x3e, 0x00, 0x75, 0xeb, 0xeb, 0x12, 0x90, 0x8b, 0x55, 0x08, 0xff, 0x72, 0x08, 0xe8, 0xed,
00413 0xfe, 0xff, 0xff, 0x89, 0x45, 0xf4, 0x83, 0xc4, 0x04, 0x8b, 0x45, 0xf4, 0x8b, 0x55, 0x08, 0x89,
00414 0x42, 0x10, 0xc1, 0xe0, 0x02, 0x50, 0xe8, 0x85, 0xfc, 0xff, 0xff, 0x8b, 0xf8, 0xc7, 0x45, 0xf8,
00415 0xff, 0xff, 0xff, 0xff, 0x33, 0xc0, 0x89, 0x45, 0xfc, 0x89, 0x45, 0xf4, 0x83, 0xc4, 0x04, 0x8b,
00416 0x55, 0x08, 0x8b, 0x42, 0x0c, 0x85, 0xc0, 0x74, 0x2f, 0x8b, 0xf0, 0x83, 0x3e, 0x00, 0x74, 0x40,
00417 0x8d, 0x55, 0xfc, 0x89, 0x55, 0xf0, 0x90, 0x90, 0xff, 0x75, 0xf0, 0x8d, 0x45, 0xf8, 0x50, 0x8d,
00418 0x45, 0xf4, 0x50, 0x57, 0xff, 0x36, 0xe8, 0xc5, 0xfe, 0xff, 0xff, 0x83, 0xc4, 0x14, 0x83, 0xc6,
00419 0x04, 0x83, 0x3e, 0x00, 0x75, 0xe2, 0xeb, 0x18, 0x8d, 0x45, 0xfc, 0x50, 0x8d, 0x45, 0xf8, 0x50,
00420 0x8d, 0x45, 0xf4, 0x50, 0x57, 0x8b, 0x55, 0x08, 0xff, 0x72, 0x08, 0xe8, 0xa0, 0xfe, 0xff, 0xff,
00421 0x8b, 0x55, 0x08, 0x89, 0x7a, 0x0c, 0x8b, 0x45, 0xf8, 0x89, 0x02, 0x8b, 0x45, 0xfc, 0x89, 0x42,
00422 0x04, 0x8d, 0x65, 0xe4, 0x5b, 0x5e, 0x5f, 0xc9, 0xc3, 0x90, 0x90, 0x90, 0x55, 0x8b, 0xec, 0x83,
00423 0xec, 0x08, 0x57, 0x56, 0x53, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x81, 0xc3, 0x3a, 0x18, 0x00,
00424 0x00, 0x8b, 0xb3, 0xf4, 0x05, 0x00, 0x00, 0x85, 0xf6, 0x74, 0x74, 0x90, 0x83, 0x3e, 0x00, 0x75,
00425 0x09, 0x56, 0xe8, 0xe9, 0xfe, 0xff, 0xff, 0x83, 0xc4, 0x04, 0x8b, 0x4d, 0x08, 0x39, 0x0e, 0x77,
00426 0x05, 0x39, 0x4e, 0x04, 0x77, 0x07, 0x8b, 0x76, 0x14, 0x85, 0xf6, 0x75, 0xdf, 0x85, 0xf6, 0x75,
00427 0x0b, 0xeb, 0x4c, 0x90, 0x8b, 0x45, 0xf8, 0xeb, 0x48, 0x90, 0x90, 0x90, 0x33, 0xff, 0x8b, 0x4e,
00428 0x10, 0x89, 0x4d, 0xfc, 0x3b, 0xf9, 0x73, 0x37, 0x8b, 0x76, 0x0c, 0x90, 0x8b, 0x4d, 0xfc, 0x8d,
00429 0x04, 0x39, 0x8b, 0xd0, 0xd1, 0xea, 0x8b, 0x0c, 0x96, 0x89, 0x4d, 0xf8, 0x8b, 0x41, 0x08, 0x39,
00430 0x45, 0x08, 0x73, 0x08, 0x89, 0x55, 0xfc, 0xeb, 0x11, 0x90, 0x90, 0x90, 0x8b, 0x4du, 0xf8, 0x03,
00431 0x41, 0x0c, 0x39, 0x45, 0x08, 0x76, 0xbd, 0x8d, 0x7a, 0x01, 0x39, 0x7d, 0xfc, 0x77u, 0xcd, 0x33,
00432 0xc0, 0x8d, 0x65, 0xec, 0x5b, 0x5e, 0x5f, 0xc9, 0xc3, 0x90, 0x90, 0x90, 0x55, 0x8bu, 0xec, 0x83,
00433 0xec, 0x18, 0x57, 0x56, 0x53, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x81, 0xc3, 0x9au, 0x17, 0x00,
00434 0x00, 0x8b, 0x55, 0x08, 0x8b, 0x42, 0x04, 0x05, 0xfc, 0xff, 0xff, 0xff, 0x2b, 0xd0u, 0x8d, 0x72,
00435 0x09, 0x89, 0x75, 0xf4, 0x8b, 0x7d, 0x0c, 0x89, 0x37, 0x89, 0x75, 0xf8, 0x8d, 0x83u, 0xf9, 0xef,
00436 0xff, 0xff, 0x89, 0x45, 0xf0, 0xb9, 0x01, 0x00, 0x00, 0x00, 0x8b, 0xf8, 0xfc, 0xa8u, 0x00, 0xf3,
00437 0xa6, 0x74, 0x25, 0x8b, 0x75, 0xf4, 0x8d, 0xbb, 0xfa, 0xef, 0xff, 0xff, 0xb9, 0x03u, 0x00, 0x00,
00438 0x00, 0xfc, 0xa8, 0x00, 0xf3, 0xa6, 0x74, 0x10, 0x80, 0x7a, 0x09, 0x7a, 0x74, 0x0au, 0x33, 0xc0,
00439 0xe9, 0xa6, 0x00, 0x00, 0x00, 0x90, 0x90, 0x90, 0x8b, 0x45, 0x0c, 0x8b, 0x00, 0x89u, 0x45, 0xf0,
00440 0x8b, 0xd0, 0x8b, 0xfa, 0x33, 0xc0, 0xfc, 0xb9, 0xff, 0xff, 0xff, 0xff, 0xf2, 0xaeu, 0xf7, 0xd1,
00441 0x89, 0x4d, 0xf8, 0x8d, 0x44, 0x0a, 0xff, 0x89, 0x45, 0xf4, 0x8b, 0xd0, 0x42, 0x8bu, 0x75, 0xf0,
00442 0x89, 0x75, 0xf8, 0x8d, 0xbb, 0xfa, 0xef, 0xff, 0xff, 0x89, 0x7d, 0xf0, 0xb9, 0x03u, 0x00, 0x00,
00443 0x00, 0xfc, 0xa8, 0x00, 0xf3, 0xa6, 0x75, 0x14, 0x8b, 0x40, 0x01, 0x8b, 0x75, 0x0cu, 0x89, 0x46,
00444 0x04, 0x8b, 0x55, 0xf4, 0x83, 0xc2, 0x05, 0xeb, 0x0d, 0x90, 0x90, 0x90, 0x8b, 0x7du, 0x0c, 0xc7,
00445 0x47, 0x04, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x45, 0x0c, 0x05, 0x08, 0x00, 0x00, 0x00u, 0x50, 0x52,
00446 0xe8, 0xeb, 0xfb, 0xff, 0xff, 0x8b, 0xd0, 0x8b, 0x75, 0x0c, 0x83, 0xc6, 0x0c, 0x56u, 0x52, 0xe8,
00447 0x18, 0xfc, 0xff, 0xff, 0x8b, 0xd0, 0x0f, 0xb6, 0x02, 0x8b, 0x75, 0x0c, 0x89, 0x46u, 0x10, 0x42,
00448 0x8b, 0x3e, 0x83, 0xc4, 0x10, 0x80, 0x3f, 0x7a, 0x75, 0x0f, 0x8d, 0x45, 0xfc, 0x50u, 0x52, 0xe8,
00449 0xbc, 0xfb, 0xff, 0xff, 0x8b, 0xd0, 0x03, 0x55, 0xfc, 0x8b, 0xc2, 0x8d, 0x65, 0xdcu, 0x5b, 0x5e,
00450 0x5f, 0xc9, 0xc3, 0x90, 0x55, 0x8b, 0xec, 0x83, 0xec, 0x10, 0x57, 0x56, 0x53, 0xe8u, 0x00, 0x00,
00451 0x00, 0x00, 0x5b, 0x81, 0xc3, 0x82, 0x16, 0x00, 0x00, 0x8b, 0x7d, 0x10, 0x8b, 0x55u, 0x14, 0x8b,
00452 0x4d, 0x08, 0x0f, 0xb6, 0x01, 0x41, 0x89, 0x4d, 0x08, 0x8b, 0xf0, 0x81, 0xe6, 0x40u, 0x00, 0x00,
00453 0x00, 0x89, 0x75, 0xf0, 0x74, 0x12, 0x25, 0x3f, 0x00, 0x00, 0x00, 0x0f, 0xaf, 0x47u, 0x08, 0x01,
00454 0x02, 0xe9, 0x42, 0x03, 0x00, 0x00, 0x90, 0x90, 0x84, 0xc0, 0x7d, 0x44, 0x25, 0x3fu, 0x00, 0x00,
00455 0x00, 0x89, 0x45, 0xf8, 0x8d, 0x45, 0xfc, 0x50, 0xff, 0x75, 0x08, 0xe8, 0x50, 0xfbu, 0xff, 0xff,
00456 0x89, 0x45, 0x08, 0x8b, 0x45, 0xfc, 0x0f, 0xaf, 0x47, 0x0c, 0x89, 0x45, 0xfc, 0x8bu, 0x45, 0xf8,
00457 0x8b, 0x4d, 0x0c, 0xc6, 0x44, 0x08, 0x5c, 0x01, 0x8b, 0x75, 0xf8, 0x8d, 0x14, 0xb5u, 0x00, 0x00,
00458 0x00, 0x00, 0x8b, 0x45, 0xfc, 0x89, 0x44, 0x0a, 0x10, 0xe9, 0xfa, 0x02, 0x00, 0x00u, 0x90, 0x90,
00459 0xa8, 0xc0, 0x74, 0x18, 0x25, 0x3f, 0x00, 0x00, 0x00, 0x89, 0x45, 0xf8, 0x8a, 0x4du, 0xf0, 0x8b,
00460 0x75, 0x0c, 0x88, 0x4c, 0x30, 0x5c, 0xe9, 0xdd, 0x02, 0x00, 0x00, 0x90, 0x3d, 0x2eu, 0x00, 0x00,
00461 0x00, 0x0f, 0x87, 0xc9, 0x02, 0x00, 0x00, 0x8b, 0xcb, 0x2b, 0x8c, 0x83, 0x30, 0xeau, 0xff, 0xff,
00462 0xff, 0xe1, 0x90, 0x90, 0x0c, 0x13, 0x00, 0x00, 0x14, 0x15, 0x00, 0x00, 0x00, 0x15u, 0x00, 0x00,
00463 0xec, 0x14, 0x00, 0x00, 0xd8, 0x14, 0x00, 0x00, 0xc0, 0x14, 0x00, 0x00, 0x74, 0x14u, 0x00, 0x00,
00464 0x0c, 0x13, 0x00, 0x00, 0x0c, 0x13, 0x00, 0x00, 0x54, 0x14, 0x00, 0x00, 0xa0, 0x13u, 0x00, 0x00,
00465 0x80, 0x13, 0x00, 0x00, 0x14, 0x14, 0x00, 0x00, 0xe0, 0x13, 0x00, 0x00, 0xc0, 0x13u, 0x00, 0x00,
00466 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13u, 0x00, 0x00,
00467 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13u, 0x00, 0x00,
00468 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13u, 0x00, 0x00,
00469 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13u, 0x00, 0x00,
00470 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13u, 0x00, 0x00,
00471 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13u, 0x00, 0x00,
00472 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x14, 0x13u, 0x00, 0x00,
00473 0x14, 0x13, 0x00, 0x00, 0x14, 0x13, 0x00, 0x00, 0x64, 0x13, 0x00, 0x00, 0x30, 0x13u, 0x00, 0x00,
00474 0x8b, 0x75, 0x08, 0x8b, 0x06, 0x89, 0x02, 0x83, 0xc6, 0x04, 0x89, 0x75, 0x08, 0xe9u, 0xf6, 0x01,
00475 0x00, 0x00, 0x90, 0x90, 0x8b, 0x4d, 0x08, 0x0f, 0xb6, 0x01, 0x01, 0x02, 0x41, 0x89u, 0x4d, 0x08,
00476 0xe9, 0xe3, 0x01, 0x00, 0x00, 0x90, 0x90, 0x90, 0x8b, 0x75, 0x08, 0x0f, 0xb7, 0x06u, 0x01, 0x02,
00477 0x83, 0xc6, 0x02, 0x89, 0x75, 0x08, 0xe9, 0xcd, 0x01, 0x00, 0x00, 0x90, 0x8b, 0x02u, 0x8b, 0x4d,
00478 0x08, 0x03, 0x01, 0x89, 0x02, 0x83, 0xc1, 0x04, 0x89, 0x4d, 0x08, 0xe9, 0xb8, 0x01u, 0x00, 0x00,
00479 0x90, 0x90, 0x90, 0x90, 0x8d, 0x45, 0xf8, 0x50, 0xff, 0x75, 0x08, 0xe8, 0xd0, 0xf9u, 0xff, 0xff,
00480 0x89, 0x45, 0x08, 0x8d, 0x45, 0xfc, 0x50, 0xff, 0x75, 0x08, 0xe8, 0xc1, 0xf9, 0xffu, 0xff, 0x89,
00481 0x45, 0x08, 0x8b, 0x45, 0xfc, 0x0f, 0xaf, 0x47, 0x0c, 0x89, 0x45, 0xfc, 0x8b, 0x45u, 0xf8, 0x8b,
00482 0x75, 0x0c, 0xc6, 0x44, 0x30, 0x5c, 0x01, 0x8b, 0x4d, 0xf8, 0x8d, 0x14, 0x8d, 0x00u, 0x00, 0x00,
00483 0x00, 0x8b, 0x45, 0xfc, 0x89, 0x44, 0x32, 0x10, 0xe9, 0x6b, 0x01, 0x00, 0x00, 0x90u, 0x90, 0x90,
00484 0x8d, 0x45, 0xf8, 0x50, 0xff, 0x75, 0x08, 0xe8, 0x84, 0xf9, 0xff, 0xff, 0x89, 0x45u, 0x08, 0x8b,
00485 0x45, 0xf8, 0x8b, 0x75, 0x0c, 0xc6, 0x44, 0x30, 0x5c, 0x00, 0xe9, 0x49, 0x01, 0x00u, 0x00, 0x90,
00486 0x8d, 0x45, 0xf8, 0x50, 0xff, 0x75, 0x08, 0xe8, 0x64, 0xf9, 0xff, 0xff, 0x89, 0x45u, 0x08, 0x8d,
00487 0x45, 0xf4, 0x50, 0xff, 0x75, 0x08, 0xe8, 0x55, 0xf9, 0xff, 0xff, 0x89, 0x45, 0x08u, 0x8b, 0x45,
00488 0xf8, 0x8b, 0x4d, 0x0c, 0xc6, 0x44, 0x08, 0x5c, 0x02, 0x8b, 0x75, 0xf8, 0x8d, 0x14u, 0xb5, 0x00,
00489 0x00, 0x00, 0x00, 0x8b, 0x45, 0xf4, 0x89, 0x44, 0x0a, 0x10, 0xe9, 0x09, 0x01, 0x00u, 0x00, 0x90,
00490 0x8d, 0x45, 0xf8, 0x50, 0xff, 0x75, 0x08, 0xe8, 0x24, 0xf9, 0xff, 0xff, 0x89, 0x45u, 0x08, 0x8d,
00491 0x45, 0xfc, 0x50, 0xff, 0x75, 0x08, 0xe8, 0x15, 0xf9, 0xff, 0xff, 0x89, 0x45, 0x08u, 0x8b, 0x45,
00492 0xf8, 0x8b, 0x4d, 0x0c, 0x66, 0x89, 0x41, 0x58, 0x8b, 0x45, 0xfc, 0x89, 0x41, 0x08u, 0xe9, 0xd5,
00493 0x00, 0x00, 0x00, 0x90, 0x8d, 0x45, 0xf8, 0x50, 0xff, 0x75, 0x08, 0xe8, 0xf0, 0xf8u, 0xff, 0xff,
00494 0x89, 0x45, 0x08, 0x8b, 0x45, 0xf8, 0x8b, 0x75, 0x0c, 0x66, 0x89, 0x46, 0x58, 0xe9u, 0xb6, 0x00,
00495 0x00, 0x00, 0x90, 0x90, 0x8d, 0x45, 0xfc, 0x50, 0xff, 0x75, 0x08, 0xe8, 0xd0, 0xf8u, 0xff, 0xff,
00496 0x89, 0x45, 0x08, 0x8b, 0x45, 0xfc, 0x8b, 0x4d, 0x0c, 0x89, 0x41, 0x08, 0xe9, 0x97u, 0x00, 0x00,
00497 0x00, 0x90, 0x90, 0x90, 0x6a, 0x74, 0xe8, 0x55, 0xf7, 0xff, 0xff, 0x8b, 0xd0, 0x8bu, 0xfa, 0x8b,
00498 0x45, 0x0c, 0x8b, 0xf0, 0xfc, 0xb9, 0x1d, 0x00, 0x00, 0x00, 0xf3, 0xa5, 0x8b, 0x4du, 0x0c, 0x89,
00499 0x51, 0x70, 0xeb, 0x74, 0x8b, 0x75, 0x0c, 0x8b, 0x56, 0x70, 0x8b, 0xfe, 0x8b, 0xc2u, 0x8b, 0xf0,
00500 0xfc, 0xb9, 0x1d, 0x00, 0x00, 0x00, 0xf3, 0xa5, 0x52, 0xe8, 0x32, 0xf7, 0xff, 0xffu, 0xeb, 0x58,
00501 0xc7, 0x45, 0xf8, 0x10, 0x00, 0x00, 0x00, 0x90, 0x8b, 0x45, 0xf8, 0x8b, 0x4d, 0x0cu, 0xc6, 0x44,
00502 0x08, 0x5c, 0x01, 0x8b, 0x45, 0xf8, 0x8d, 0x14, 0x85, 0xc0, 0xff, 0xff, 0xff, 0x89u, 0x54, 0x81,
00503 0x10, 0x8d, 0x70, 0x01, 0x89, 0x75, 0xf8, 0x8b, 0xc6, 0x3d, 0x1f, 0x00, 0x00, 0x00u, 0x76, 0xd8,
00504 0xeb, 0x26, 0x90, 0x90, 0x8d, 0x45, 0xfc, 0x50, 0xff, 0x75, 0x08, 0xe8, 0x40, 0xf8u, 0xff, 0xff,
00505 0x89, 0x45, 0x08, 0x8b, 0x45, 0xfc, 0x8b, 0x4d, 0x0c, 0x89, 0x41, 0x0c, 0xeb, 0x0au, 0x90, 0x90,
00506 0xe8, 0xeb, 0xf6, 0xff, 0xff, 0x90, 0x90, 0x90, 0x8b, 0x45, 0x08, 0x8d, 0x65, 0xe4u, 0x5b, 0x5e,
00507 0x5f, 0xc9, 0xc3, 0x90, 0x55, 0x8b, 0xec, 0x53, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x5bu, 0x81, 0xc3,
00508 0xf7, 0x12, 0x00, 0x00, 0x8b, 0x45, 0x08, 0x8b, 0x55, 0x0c, 0x89, 0x42, 0x08, 0xc7u, 0x42, 0x04,
00509 0x00, 0x00, 0x00, 0x00, 0xc7, 0x02, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x42, 0x0c, 0x00u, 0x00, 0x00,
00510 0x00, 0xc7, 0x42, 0x10, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x83, 0xf4, 0x05, 0x00, 0x00u, 0x89, 0x42,
00511 0x14, 0x89, 0x93, 0xf4, 0x05, 0x00, 0x00, 0x8b, 0x5d, 0xfc, 0xc9, 0xc3, 0x55, 0x8bu, 0xec, 0x53,
00512 0xe8, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x81, 0xc3, 0xaf, 0x12, 0x00, 0x00, 0x8b, 0x45u, 0x08, 0x8b,
00513 0x55, 0x0c, 0x89, 0x42, 0x08, 0x89, 0x42, 0x0c, 0xc7, 0x42, 0x04, 0x00, 0x00, 0x00u, 0x00, 0xc7,
00514 0x02, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x42, 0x10, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x83u, 0xf4, 0x05,
00515 0x00, 0x00, 0x89, 0x42, 0x14, 0x89, 0x93, 0xf4, 0x05, 0x00, 0x00, 0x8b, 0x5d, 0xfcu, 0xc9, 0xc3,
00516 0x55, 0x8b, 0xec, 0x53, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x81, 0xc3, 0x6b, 0x12u, 0x00, 0x00,
00517 0x8b, 0x45, 0x08, 0x8d, 0x8b, 0xf4, 0x05, 0x00, 0x00, 0x83, 0xbb, 0xf4, 0x05, 0x00u, 0x00, 0x00,
00518 0x74, 0x27, 0x90, 0x90, 0x8b, 0x11, 0x39, 0x42, 0x08, 0x75, 0x15, 0x8b, 0x42, 0x14u, 0x89, 0x01,
00519 0x83, 0x3a, 0x00, 0x74, 0x1b, 0xff, 0x72, 0x0c, 0xe8, 0x03, 0xf6, 0xff, 0xff, 0xebu, 0x11, 0x90,
00520 0x8d, 0x4a, 0x14, 0x83, 0x7a, 0x14, 0x00, 0x75, 0xdb, 0xe8, 0x02, 0xf6, 0xff, 0xffu, 0x90, 0x90,
00521 0x8b, 0x5d, 0xfc, 0xc9, 0xc3, 0x90, 0x90, 0x90, 0x55, 0x8b, 0xec, 0x81, 0xec, 0xa8u, 0x00, 0x00,
00522 0x00, 0x57, 0x56, 0x53, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x81, 0xc3, 0x0b, 0x12u, 0x00, 0x00,
00523 0xff, 0x75, 0x08, 0xe8, 0xb4, 0xf9, 0xff, 0xff, 0x89, 0x85, 0x6c, 0xff, 0xff, 0xffu, 0x83, 0xc4,
00524 0x04, 0x85, 0xc0, 0x0f, 0x84, 0x2e, 0x01, 0x00, 0x00, 0x8d, 0x4d, 0xec, 0x89, 0x8du, 0x68, 0xff,
00525 0xff, 0xff, 0x51, 0xff, 0xb5, 0x6c, 0xff, 0xff, 0xff, 0xe8, 0x2e, 0xfa, 0xff, 0xffu, 0x8b, 0xf0,
00526 0x83, 0xc4, 0x08, 0x85, 0xf6, 0x0f, 0x84, 0x0c, 0x01, 0x00, 0x00, 0x6a, 0x74, 0x6au, 0x00, 0x8d,
00527 0x8d, 0x78, 0xff, 0xff, 0xff, 0x89, 0x8d, 0x64, 0xff, 0xff, 0xff, 0x51, 0xe8, 0x9fu, 0xf5, 0xff,
00528 0xff, 0x8b, 0x45, 0xfc, 0x66, 0x89, 0x45, 0xd2, 0x8b, 0x45, 0xf0, 0x89, 0x85, 0x7cu, 0xff, 0xff,
00529 0xff, 0x83, 0xc4, 0x0c, 0x8b, 0x8d, 0x6c, 0xff, 0xff, 0xff, 0x8b, 0x41, 0x04, 0x05u, 0xfc, 0xff,
00530 0xff, 0xff, 0x2b, 0xc8, 0x8b, 0xc1, 0x03, 0x00, 0x8d, 0x78, 0x04, 0x3b, 0xf7, 0x73u, 0x36, 0x8b,
00531 0x8d, 0x68, 0xff, 0xff, 0xff, 0x89, 0x8d, 0x60, 0xff, 0xff, 0xff, 0x8b, 0x8d, 0x64u, 0xff, 0xff,
00532 0xff, 0x89, 0x8d, 0x5c, 0xff, 0xff, 0xff, 0x90, 0x6a, 0x00, 0xff, 0xb5, 0x60, 0xffu, 0xff, 0xff,
00533 0xff, 0xb5, 0x5c, 0xff, 0xff, 0xff, 0x56, 0xe8, 0xc8, 0xfa, 0xff, 0xff, 0x8b, 0xf0u, 0x83, 0xc4,
00534 0x10, 0x3b, 0xf7, 0x72, 0xe3, 0x8b, 0xb5, 0x6c, 0xff, 0xff, 0xff, 0x83, 0xc6, 0x10u, 0x8b, 0x45,
00535 0xec, 0x80, 0x38, 0x7a, 0x75, 0x18, 0x8d, 0x85, 0x74, 0xff, 0xff, 0xff, 0x50, 0x56u, 0xe8, 0x4d,
00536 0xf6, 0xff, 0xff, 0x8b, 0xf0, 0x03, 0xb5, 0x74, 0xff, 0xff, 0xff, 0x83, 0xc4, 0x08u, 0x8b, 0x85,
00537 0x6c, 0xff, 0xff, 0xff, 0x03, 0x00, 0x8d, 0x78, 0x04, 0x8b, 0x8d, 0x6c, 0xff, 0xffu, 0xff, 0x8b,
00538 0x41, 0x08, 0x89, 0x85, 0x70, 0xff, 0xff, 0xff, 0x3b, 0xf7, 0x73, 0x37, 0x8d, 0x8du, 0x70, 0xff,
00539 0xff, 0xff, 0x89, 0x8d, 0x58, 0xff, 0xff, 0xff, 0x8b, 0x4d, 0x08, 0x39, 0x8d, 0x70u, 0xff, 0xff,
00540 0xff, 0x77, 0x20, 0xff, 0xb5, 0x58, 0xff, 0xff, 0xff, 0x8d, 0x45, 0xec, 0x50, 0x8du, 0x85, 0x78,
00541 0xff, 0xff, 0xff, 0x50, 0x56, 0xe8, 0x4a, 0xfa, 0xff, 0xff, 0x8b, 0xf0, 0x83, 0xc4u, 0x10, 0x3b,
00542 0xf7, 0x72, 0xd5, 0x8b, 0x7d, 0x0c, 0x8d, 0xb5, 0x78, 0xff, 0xff, 0xff, 0xfc, 0xb9u, 0x1c, 0x00,
00543 0x00, 0x00, 0xf3, 0xa5, 0x8b, 0x45, 0x0c, 0x8d, 0xa5, 0x4c, 0xff, 0xff, 0xff, 0x5bu, 0x5e, 0x5f,
00544 0xc9, 0xc3, 0x00, 0x00, 0x55, 0x8b, 0xec, 0x56, 0x53, 0xe8, 0x00, 0x00, 0x00, 0x00u, 0x5b, 0x81,
00545 0xc3, 0xa6, 0x10, 0x00, 0x00, 0x8d, 0x83, 0xd0, 0x00, 0x00, 0x00, 0x8d, 0x70, 0xfcu, 0x83, 0x78,
00546 0xfc, 0xff, 0x74, 0x0c, 0x8b, 0x06, 0xff, 0xd0, 0x83, 0xc6, 0xfc, 0x83, 0x3e, 0xffu, 0x75, 0xf4,
00547 0x8d, 0x65, 0xf8, 0x5b, 0x5e, 0xc9, 0xc3, 0x90, 0x55, 0x8b, 0xec, 0x53, 0xe8, 0x00u, 0x00, 0x00,
00548 0x00, 0x5b, 0x81, 0xc3, 0x73, 0x10, 0x00, 0x00, 0x8b, 0x5d, 0xfc, 0xc9, 0xc3 };
00549 
00550 void LoaderTest::testMicroDis1 () {
00551     std::ostringstream ost;
00552 
00553     int i;
00554     unsigned int n = sizeof(pent_hello_text);
00555     int totalSize = 0;
00556     void* p = pent_hello_text;
00557     i = 0;
00558     while (totalSize < (int)n) {
00559         int size = microX86Dis(p);
00560         if (size >= 0x40) {
00561             std::cout << "Not handled instruction at offset 0x" << std::hex <<
00562                 (ADDRESS)p - (ADDRESS)pent_hello_text << std::endl;
00563             CPPUNIT_ASSERT(size != 0x40);
00564             return;
00565         }
00566         int expected = lengths[i++];
00567         if (expected != size) {
00568             std::cout << "At offset 0x" << std::hex <<
00569                 (ADDRESS)p - (ADDRESS)pent_hello_text << " ("
00570                 << (int)*((unsigned char*)p) << " "
00571                 << (int)*((unsigned char*)p+1) << " " 
00572                 << (int)*((unsigned char*)p+2) << " " 
00573                 << (int)*((unsigned char*)p+3) << " " 
00574                 << ") expected " <<
00575                 std::dec << expected << ", actual " << size << std::endl;
00576             CPPUNIT_ASSERT_EQUAL(expected, size);
00577         }
00578         p = (void*) ((char*)p + size);
00579         totalSize += size;
00580     }
00581     CPPUNIT_ASSERT_EQUAL((int)n, totalSize);
00582 }
00583 
00584 void LoaderTest::testMicroDis2 () {
00585 
00586     // Now a special test:
00587     // 8048910:  0f be 00           movsbl (%eax),%eax
00588     // 8048913:  0f bf 00           movswl (%eax),%eax
00589 
00590     unsigned char movsbl[3] = {0x0f, 0xbe, 0x00};
00591     unsigned char movswl[3] = {0x0f, 0xbf, 0x00};
00592     int size = microX86Dis(movsbl);
00593     CPPUNIT_ASSERT_EQUAL(3, size);
00594     size = microX86Dis(movswl);
00595     CPPUNIT_ASSERT_EQUAL(3, size);
00596 }
00597 
00598 typedef unsigned (*elfHashFcn)(const char*);
00599 void LoaderTest::testElfHash () {
00600 #ifndef _WIN32
00601     void* dlHandle = dlopen(ELFBINFILE, RTLD_LAZY);
00602     CPPUNIT_ASSERT(dlHandle);
00603     // Use the handle to find the "elf_hash" function
00604     elfHashFcn pFcn = (elfHashFcn) dlsym(dlHandle, "elf_hash");
00605     CPPUNIT_ASSERT(pFcn);
00606     // Call the function with the string "main
00607     unsigned act = (*pFcn)("main");
00608     unsigned exp = 0x737fe;
00609     CPPUNIT_ASSERT_EQUAL(exp, act);
00610 #endif
00611 }

Generated on Tue Sep 19 21:18:24 2006 for Boomerang by  doxygen 1.4.6