1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627
|
#ifndef __ODBG_PLUGIN_H #define __ODBG_PLUGIN_H
#define PLUGIN_VERSION 0x02010001
#if !defined(_UNICODE) && !defined(UNICODE) #error This version must be compiled with UNICODE on #endif
#ifdef __BORLANDC__ #pragma option -a1 #pragma option -K #undef MAKELONG #define MAKELONG(lo,hi) ((LONG)(((WORD)(lo))|(((DWORD)((WORD)(hi)))<<16))) #endif
#ifdef _MSC_VER #pragma pack(1) #ifndef _CHAR_UNSIGNED #error Please set default char type to unsigned (option /J) #endif #endif
#ifdef __MINGW32__ #pragma pack(1) #ifndef __CHAR_UNSIGNED__ #error Please set default char type to unsigned (option -funsigned-char) #endif #endif
#ifndef _export #define _export __declspec(dllexport) #endif
#ifndef _import #define _import __declspec(dllimport) #endif
#ifndef _USERENTRY #define _USERENTRY __cdecl #endif
#define MAKEWP(lo,hi) ((WPARAM)MAKELONG(lo,hi)) #define MAKELP(lo,hi) ((LPARAM)MAKELONG(lo,hi))
#define LOINT(l) ((signed short)((WORD)(l))) #define HIINT(l) ((signed short)(((DWORD)(l)>>16) & 0xFFFF))
#ifndef MAXPATH #define MAXPATH MAX_PATH #endif
#ifndef FIELD_OFFSET #define FIELD_OFFSET(type,field) ((LONG)&(((type *)0)->field)) #endif
#ifndef arraysize #define arraysize(x) (sizeof(x)/sizeof(x[0])) #endif
#define TEXTLEN 256 #define DATALEN 4096 #define ARGLEN 1024 #define MAXMULTIPATH 8192 #define SHORTNAME 32
typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong;
#ifdef __cplusplus #define extc extern "C" _export #define stdapi(type) extern "C" type __cdecl #define varapi(type) extern "C" type __cdecl #define oddata(type) extern "C" const _import type #define pentry(type) extern "C" _export type __cdecl #else #define extc extern _export #define stdapi(type) extern type __cdecl #define varapi(type) extern type __cdecl #define oddata(type) extern const _import type #define pentry(type) extern _export type __cdecl #endif
struct t_table; struct t_module; struct t_dump;
#define PLAINASCII 0x01 #define DIACRITICAL 0x02 #define RAREASCII 0x10
#define REPORT 0x0000 #define SILENT 0x0001 #define ZEROINIT 0x0002
#define CONT_BROADCAST 0x0000 #define STOP_BROADCAST 0x1234
#define DM_VALID 0x00000001 #define DM_INMOD 0x00000002 #define DM_SAMEMOD 0x00000004 #define DM_SYMBOL 0x00000008 #define DM_NONTRIVIAL 0x00000010
#define DM_BINARY 0x00000100 #define DM_DIFBIN 0x00000200 #define DM_WIDEFORM 0x00000400 #define DM_CAPITAL 0x00000800 #define DM_OFFSET 0x00001000 #define DM_JUMPIMP 0x00002000 #define DM_DYNAMIC 0x00004000 #define DM_ORDINAL 0x00008000
#define DM_NOMODNAME 0x00000000 #define DM_DIFFMODNAME 0x00010000 #define DM_MODNAME 0x00020000
#define DM_STRING 0x00100000 #define DM_STRPTR 0x00200000 #define DM_FOLLOW 0x00400000 #define DM_ENTRY 0x00800000 #define DM_EFORCE 0x01000000 #define DM_DIFFMOD 0x02000000 #define DM_RELOFFS 0x04000000 #define DM_ANALYSED 0x08000000
#define DM_COMMENT (DM_STRING|DM_STRPTR|DM_FOLLOW|DM_ENTRY|DM_ANALYSED)
#define ADDR_SYMMASK 0x00000003 #define ADDR_HEXSYM 0x00000000 #define ADDR_SYMHEX 0x00000001 #define ADDR_SINGLE 0x00000002 #define ADDR_HEXONLY 0x00000003 #define ADDR_MODNAME 0x00000004 #define ADDR_FORCEMOD 0x00000008 #define ADDR_GRAYHEX 0x00000010 #define ADDR_HILSYM 0x00000020 #define ADDR_NODEFMEP 0x00000100 #define ADDR_BREAK 0x00000200 #define ADDR_CONDBRK 0x00000400 #define ADDR_DISBRK 0x00000800 #define ADDR_EIP 0x00001000 #define ADDR_CHECKEIP 0x00002000 #define ADDR_SHOWNULL 0x00004000
#define BRO_MODEMASK 0xF0000000 #define BRO_FILE 0x00000000 #define BRO_EXE 0x10000000 #define BRO_TEXT 0x20000000 #define BRO_GROUP 0x30000000 #define BRO_MULTI 0x40000000 #define BRO_SAVE 0x08000000 #define BRO_SINGLE 0x00800000 #define BRO_MULTIPLE 0x00400000 #define BRO_APPEND 0x00080000 #define BRO_ACTUAL 0x00040000 #define BRO_TABS 0x00020000 #define BRO_GROUPMASK 0x000000FF #define BRO_GROUP1 0x00000001 #define BRO_GROUP2 0x00000002 #define BRO_GROUP3 0x00000004 #define BRO_GROUP4 0x00000008
#define DS_DIR 0 #define DS_ASM 1 #define DS_C 2
varapi (void) Error(wchar_t *format,...); varapi (void) Conderror(int *cond,wchar_t *title,wchar_t *format,...); varapi (int) Condyesno(int *cond,wchar_t *title,wchar_t *format,...); stdapi (int) Stringfromini(wchar_t *section,wchar_t *key,wchar_t *s, int length); stdapi (int) Filefromini(wchar_t *key,wchar_t *name,wchar_t *defname); varapi (int) Getfromini(wchar_t *file,wchar_t *section,wchar_t *key, wchar_t *format,...); varapi (int) Writetoini(wchar_t *file,wchar_t *section,wchar_t *key, wchar_t *format,...); stdapi (int) Filetoini(wchar_t *key,wchar_t *name); stdapi (void) Deleteinisection(wchar_t *file,wchar_t *section); stdapi (int) Getfromsettings(wchar_t *key,int defvalue); stdapi (void) Addtosettings(wchar_t *key,int value); stdapi (void) Replacegraphs(int mode,wchar_t *s,uchar *mask, int select,int n); stdapi (int) Unicodetoascii(const wchar_t *w,int nw,char *s,int ns); stdapi (int) Asciitounicode(const char *s,int ns,wchar_t *w,int nw); stdapi (int) Unicodetoutf(const wchar_t *w,int nw,char *t,int nt); stdapi (int) Utftounicode(const char *t,int nt,wchar_t *w,int nw); stdapi (HGLOBAL) Unicodebuffertoascii(HGLOBAL hunicode); stdapi (int) Iszero(void *data,int n); stdapi (int) Guidtotext(uchar *guid,wchar_t *s); varapi (int) Swprintf(wchar_t *s,wchar_t *format,...); stdapi (void *) Memalloc(ulong size,int flags); stdapi (void) Memfree(void *data); stdapi (void *) Mempurge(void *data,int count,ulong itemsize,int *newcount); stdapi (void *) Memdouble(void *data,int *pcount,ulong itemsize, int *failed,int flags); stdapi (void *) Virtalloc(ulong size,int flags); stdapi (void) Virtfree(void *data); stdapi (int) Broadcast(UINT msg,WPARAM wp,LPARAM lp); stdapi (int) Browsefilename(wchar_t *title,wchar_t *name,wchar_t *args, wchar_t *currdir,wchar_t *defext,HWND hwnd,int mode); stdapi (int) Browsedirectory(HWND hw,wchar_t *comment,wchar_t *dir); stdapi (void) Relativizepath(wchar_t *path); stdapi (void) Absolutizepath(wchar_t *path); stdapi (int) Confirmoverwrite(wchar_t *path); stdapi (int) Labeladdress(wchar_t *text,ulong addr,ulong reladdr,int relreg, int index,uchar *mask,int *select,ulong mode); stdapi (int) Simpleaddress(wchar_t *text,ulong addr, uchar *mask,int *select); stdapi (void) Heapsort(void *data,const int count,const int size, int (_USERENTRY *compare)(const void *,const void *)); stdapi (void) Heapsortex(void *data,const int count,const int size, int (_USERENTRY *compareex)(const void *,const void *,ulong), ulong lp); stdapi (uchar *) Readfile(wchar_t *path,ulong fixsize,ulong *psize); stdapi (int) Devicenametodosname(wchar_t *devname,wchar_t *dosname); stdapi (int) Filenamefromhandle(HANDLE hfile,wchar_t *path); stdapi (void) Quicktimerstart(int timer); stdapi (void) Quicktimerstop(int timer); stdapi (void) Quicktimerflush(int timer);
varapi (int) StrcopyA(char *dest,int n,const char *src); varapi (int) StrcopyW(wchar_t *dest,int n,const wchar_t *src); varapi (int) StrlenA(const char *src,int n); varapi (int) StrlenW(const wchar_t *src,int n); varapi (int) HexprintA(char *s,ulong u); varapi (int) HexprintW(wchar_t *s,ulong u); varapi (int) Hexprint4A(char *s,ulong u); varapi (int) Hexprint4W(wchar_t *s,ulong u); varapi (int) Hexprint8A(char *s,ulong u); varapi (int) Hexprint8W(wchar_t *s,ulong u); varapi (int) SignedhexA(char *s,ulong u); varapi (int) SignedhexW(wchar_t *s,ulong u); varapi (void) Swapmem(void *base,int size,int i1,int i2); varapi (int) HexdumpA(char *s,uchar *code,int n); varapi (int) HexdumpW(wchar_t *s,uchar *code,int n); varapi (int) Bitcount(ulong u);
varapi (char *) SetcaseA(char *s); varapi (wchar_t *) SetcaseW(wchar_t *s); varapi (int) StrcopycaseA(char *dest,int n,const char *src); varapi (int) StrcopycaseW(wchar_t *dest,int n,const wchar_t *src); varapi (int) StrnstrA(char *data,int ndata, char *pat,int npat,int ignorecase); varapi (int) StrnstrW(wchar_t *data,int ndata, wchar_t *pat,int npat,int ignorecase); varapi (int) StrcmpW(const wchar_t *s1,const wchar_t *s2); varapi (ulong) Div64by32(ulong low,ulong hi,ulong div); varapi (ulong) CRCcalc(uchar *datacopy,ulong datasize); varapi (int) Getcpuidfeatures(void); varapi (void) Maskfpu(void); varapi (void) Clearfpu(void);
stdapi (ulong) Compress(uchar *bufin,ulong nbufin, uchar *bufout,ulong nbufout); stdapi (ulong) Getoriginaldatasize(uchar *bufin,ulong nbufin); stdapi (ulong) Decompress(uchar *bufin,ulong nbufin, uchar *bufout,ulong nbufout);
#define MI_SIGNATURE 0x00646F4DL #define MI_VERSION 0x7265560AL #define MI_FILENAME 0x6C69460AL #define MI_FILEINFO 0x7263460AL #define MI_DATA 0x7461440AL #define MI_CALLBRA 0x7262430AL #define MI_LOOPBRA 0x72624C0AL #define MI_PROCDATA 0x6372500AL #define MI_INT3BREAK 0x336E490AL #define MI_MEMBREAK 0x6D70420AL #define MI_HWBREAK 0x6870420AL #define MI_ANALYSIS 0x616E410AL #define MI_SWITCH 0x6977530AL #define MI_CASE 0x7361430AL #define MI_MNEMO 0x656E4D0AL #define MI_JMPDATA 0x74644A0AL #define MI_NETSTREAM 0x74734E0AL #define MI_METADATA 0x74644D0AL #define MI_BINSAV 0x7673420AL #define MI_MODDATA 0x61624D0AL #define MI_PREDICT 0x6472500AL #define MI_LASTSAV 0x61734C0AL #define MI_SAVEAREA 0x7661530AL #define MI_RTCOND 0x6374520AL #define MI_RTPROT 0x7074520AL #define MI_WATCH 0x6374570AL #define MI_LOADDLL 0x64644C0AL #define MI_PATCH 0x7461500AL #define MI_PLUGIN 0x676C500AL #define MI_END 0x646E450AL
#ifdef FILE
typedef struct t_fileinfo { ulong size; FILETIME filetime; ulong crc; int issfx; ulong sfxentry; } t_fileinfo;
typedef struct t_tagfile { FILE *f; ulong filesize; ulong offset; ulong tag; ulong recsize; } t_tagfile;
stdapi (FILE *) Createtaggedfile(wchar_t *name,char *signature,ulong version); stdapi (int) Savetaggedrecord(FILE *f,ulong tag,ulong size,void *data); stdapi (int) Savepackedrecord(FILE *f,ulong tag,ulong size,void *data); stdapi (void) Finalizetaggedfile(FILE *f); stdapi (int) Opentaggedfile(t_tagfile *tf,wchar_t *name,char *signature); stdapi (int) Gettaggedrecordsize(t_tagfile *tf,ulong *tag,ulong *size); stdapi (ulong) Gettaggedfiledata(t_tagfile *tf,void *buf,ulong bufsize); stdapi (void) Closetaggedfile(t_tagfile *tf);
#endif
typedef struct t_nameinfo { ulong offs; uchar type; } t_nameinfo;
typedef struct t_uddsave { void *file; ulong uddprefix; } t_uddsave;
stdapi (int) Pluginsaverecord(t_uddsave *psave,ulong tag, ulong size,void *data); stdapi (int) Pluginpackedrecord(t_uddsave *psave,ulong tag, ulong size,void *data); stdapi (void) Pluginmodulechanged(ulong addr); stdapi (int) Plugingetuniquedatatype(void); stdapi (int) Plugintempbreakpoint(ulong addr,ulong type,int forceint3); stdapi (void) Pluginshowoptions(struct t_control *options);
#define SMODE_UPCASE 0x00000001 #define SMODE_NOEOL 0x00000010 #define SMODE_NOSPEC 0x00000020 #define SMODE_EXTKEY 0x00000040 #define SMODE_NOUSKEY 0x00000080 #define SMODE_NODEC 0x00000100 #define SMODE_NOFLOAT 0x00000200 #define SMODE_RADIX10 0x00000400 #define SMODE_ANGLES 0x00000800 #define SMODE_MASK 0x00001000
#define SCAN_EOF 0 #define SCAN_EOL 1 #define SCAN_KEY 2 #define SCAN_TEXT 3 #define SCAN_INT 4 #define SCAN_FLOAT 5 #define SCAN_OP 6 #define SCAN_INVALID 7 #define SCAN_SYNTAX 8 #define SCAN_USER 10
typedef struct t_scan { ulong mode; wchar_t *src; ulong length; ulong caret; int line; union { int ival; ulong uval; }; ulong mask; long double fval; wchar_t text[TEXTLEN]; int ntext; wchar_t errmsg[TEXTLEN]; int type; } t_scan;
stdapi (int) Skipspaces(t_scan *ps); stdapi (void) Scan(t_scan *ps); stdapi (int) Optostring(wchar_t *s,int op);
#define MENU_VERIFY 0 #define MENU_EXECUTE 1
#define MENU_ABSENT 0 #define MENU_NORMAL 1 #define MENU_CHECKED 2 #define MENU_CHKPARENT 3 #define MENU_GRAYED 4 #define MENU_SHORTCUT 5
#define MENU_NOREDRAW 0 #define MENU_REDRAW 1
#define KK_KEYMASK 0x0000FFFF #define KK_CHAR 0x00010000 #define KK_SHIFT 0x00020000 #define KK_CTRL 0x00040000 #define KK_ALT 0x00080000 #define KK_WIN 0x00100000 #define KK_NOSH 0x00200000 #define KK_UNUSED 0x7FC00000 #define KK_DIRECT 0x80000000
#define K_NONE 0
#define K_OPENNEW 100 #define K_SETARGS 101 #define K_ATTACH 102 #define K_DETACH 103 #define K_EXIT 104
#define K_LOGWINDOW 110 #define K_MODULES 111 #define K_MEMORY 112 #define K_WINDOWS 113 #define K_THREADS 114 #define K_CPU 115 #define K_WATCHES 116 #define K_SEARCHES 117 #define K_RTRACE 118 #define K_PATCHES 119 #define K_BPOINTS 120 #define K_BPMEM 121 #define K_BPHARD 122 #define K_SOURCES 123 #define K_FILE 124
#define K_RUN 130 #define K_RUNTHREAD 131 #define K_PAUSE 132 #define K_STEPIN 133 #define K_STEPOVER 134 #define K_TILLRET 135 #define K_TILLUSER 136 #define K_CALLDLL 137 #define K_RESTART 138 #define K_CLOSE 139 #define K_AFFINITY 140
#define K_OPENTRACE 150 #define K_CLOSETRACE 151 #define K_ANIMIN 152 #define K_ANIMOVER 153 #define K_TRACEIN 154 #define K_TRACEOVER 155 #define K_RUNHIT 156 #define K_STOPHIT 157 #define K_RTCOND 158 #define K_RTLOG 159
#define K_OPTIONS 170 #define K_PLUGOPTIONS 171 #define K_SHORTCUTS 172
#define K_TOPMOST 180 #define K_CASCADE 181 #define K_TILEHOR 182 #define K_TILEVER 183 #define K_ICONS 184 #define K_CLOSEMDI 185 #define K_RESTORE 186 #define K_PREVMDI 187 #define K_NEXTMDI 188
#define K_ABOUT 190
#define K_PREVFRAME 200 #define K_NEXTFRAME 201 #define K_UPDATE 202 #define K_COPY 203 #define K_COPYALL 204 #define K_CUT 205 #define K_PASTE 206 #define K_TOPMOSTMDI 207 #define K_AUTOUPDATE 208 #define K_SHOWBAR 209 #define K_HSCROLL 210 #define K_DEFCOLUMNS 211
#define K_SEARCHAGAIN 220 #define K_SEARCHREV 221
#define K_BACKUP 240 #define K_SHOWBKUP 241
#define K_UNDO 250 #define K_COPYADDR 251 #define K_COPYHEX 252 #define K_PASTEHEX 253 #define K_EDITITEM 254 #define K_EDIT 255 #define K_FILLZERO 256 #define K_FILLNOP 257 #define K_FILLFF 258 #define K_SELECTALL 259 #define K_SELECTPROC 260 #define K_COPYTOEXE 261 #define K_ZERODUMP 262 #define K_LABEL 263 #define K_ASSEMBLE 264 #define K_COMMENT 265 #define K_SAVEFILE 266
#define K_BREAK 280 #define K_CONDBREAK 281 #define K_LOGBREAK 282 #define K_RUNTOSEL 283 #define K_ENABLEBRK 284 #define K_MEMBREAK 285 #define K_MEMLOGBREAK 286 #define K_MEMENABLE 287 #define K_MEMDEL 288 #define K_HWBREAK 289 #define K_HWLOGBREAK 290 #define K_HWENABLE 291 #define K_HWDEL 292
#define K_NEWORIGIN 300 #define K_FOLLOWDASM 301 #define K_ORIGIN 302 #define K_GOTO 303 #define K_JMPTOSEL 304 #define K_SWITCHCASE 305 #define K_PREVHIST 306 #define K_NEXTHIST 307 #define K_PREVTRACE 308 #define K_NEXTTRACE 309 #define K_PREVPROC 310 #define K_NEXTPROC 311 #define K_PREVREF 312 #define K_NEXTREF 313 #define K_FOLLOWEXE 314
#define K_DECODESTR 330 #define K_DECODESPTR 331
#define K_NAMES 380 #define K_FINDCMD 381 #define K_FINDCMDSEQ 382 #define K_FINDCONST 383 #define K_FINDBIN 384 #define K_FINDMOD 385 #define K_ALLCALLS 386 #define K_ALLCMDS 387 #define K_ALLCMDSEQ 388 #define K_ALLCONST 389 #define K_ALLMODS 390 #define K_ALLSTRS 391 #define K_ALLGUIDS 392 #define K_ALLCOMMENTS 393 #define K_ALLSWITCHES 394 #define K_ALLFLOATS 395 #define K_LASTRTREC 396
#define K_REFERENCES 410
#define K_ABSADDR 420 #define K_RELADDR 421 #define K_BASEADDR 422
#define K_COMMSRC 430 #define K_SHOWPROF 431
#define K_ANALYSE 440 #define K_REMANAL 441 #define K_REMANMOD 442
#define K_HELPCMD 450 #define K_HELPAPI 451
#define K_DUMPHA16 460 #define K_DUMPHA8 461 #define K_DUMPHU16 462 #define K_DUMPHU8 463 #define K_DUMPA64 464 #define K_DUMPA32 465 #define K_DUMPU64 466 #define K_DUMPU32 467 #define K_DUMPU16 468 #define K_DUMPISHORT 469 #define K_DUMPUSHORT 470 #define K_DUMPXSHORT 471 #define K_DUMPILONG 472 #define K_DUMPULONG 473 #define K_DUMPXLONG 474 #define K_DUMPADR 475 #define K_DUMPADRA 476 #define K_DUMPADRU 477 #define K_DUMPF32 478 #define K_DUMPF64 479 #define K_DUMPF80 480 #define K_DUMPDA 481 #define K_DUMPSTRUCT 482
#define K_LOCKSTK 490 #define K_PUSH 491 #define K_POP 492 #define K_STACKINDASM 493 #define K_GOTOESP 494 #define K_GOTOEBP 495 #define K_ESPADDR 496 #define K_EBPADDR 497
#define K_INCREMENT 500 #define K_DECREMENT 501 #define K_ZERO 502 #define K_SET1 503 #define K_MODIFY 504 #define K_UNDOREG 505 #define K_PUSHFPU 506 #define K_POPFPU 507 #define K_REGINDASM 508 #define K_REGINDUMP 509 #define K_REGINSTACK 510 #define K_VIEWFPU 511 #define K_VIEWMMX 512 #define K_VIEW3DNOW 513 #define K_HELPREG 514
#define K_EDITOP 520 #define K_INFOINDASM 521 #define K_INFOINDUMP 522 #define K_INFOINSTACK 523 #define K_LISTJUMPS 524 #define K_LISTCASES 525 #define K_INFOSRC 526
#define K_LOGINDASM 530 #define K_LOGINDUMP 531 #define K_LOGINSTACK 532 #define K_LOGCLEAR 533 #define K_LOGTOFILE 534 #define K_STOPLOG 535
#define K_MODINDASM 540 #define K_MODDATA 541 #define K_MODEXE 542 #define K_MODNAMES 543 #define K_GLOBNAMES 544 #define K_MODCALLS 545 #define K_MODANALYSE 546 #define K_SAVEUDD 547 #define K_LOADUDD 548
#define K_MEMBACKUP 550 #define K_MEMINDASM 551 #define K_MEMINDUMP 552 #define K_DUMP 553 #define K_SEARCHMEM 554 #define K_MEMBPACCESS 555
#define K_WININDASM 560 #define K_CLSINDASM 561
#define K_THRINCPU 570 #define K_THRTIB 571 #define K_REGISTERS 572 #define K_THRSUSPEND 573 #define K_THRRESUME 574 #define K_THRKILL 575
#define K_ADDWATCH 580 #define K_EDITWATCH 581 #define K_DELWATCH 582 #define K_WATCHUP 583 #define K_WATCHDN 584 #define K_EDITCONT 585 #define K_WATCHINDASM 586 #define K_WATCHINDUMP 587 #define K_WATCHINSTACK 588
#define K_SEARCHINDASM 600 #define K_PREVSEARCH 601 #define K_NEXTSEARCH 602 #define K_FINDTEXT 603 #define K_BREAKALL 604 #define K_CONDBPALL 605 #define K_LOGBPALL 606 #define K_DELBPALL 607 #define K_BREAKCALLS 608 #define K_CONDBPCALLS 609 #define K_LOGBPCALLS 610 #define K_DELBPCALLS 611
#define K_RTPREV 620 #define K_RTNEXT 621 #define K_TRACEINDASM 622 #define K_CLRTRACE 623 #define K_REGMODE 624 #define K_MARKTRACE 625 #define K_FINDTRADDR 626 #define K_PREVMARK 627 #define K_NEXTMARK 628 #define K_CLEARMARK 629 #define K_PROFILE 630 #define K_GLOBPROFILE 631 #define K_SAVETRACE 632 #define K_STOPSAVETR 633
#define K_PROFINDASM 640 #define K_PREVPROF 641 #define K_NEXTPROF 642 #define K_PROFMARK 643
#define K_PATCHINDASM 650 #define K_PREVPATCH 651 #define K_NEXTPATCH 652 #define K_APPLYPATCH 653 #define K_RESTOREPT 654 #define K_DELPATCH 655
#define K_DELETEBP 660 #define K_ENABLEBP 661 #define K_BPINDASM 662 #define K_BPINDUMP 663 #define K_DISABLEALLBP 664 #define K_ENABLEALLBP 665
#define K_SOURCEINDASM 670
#define K_VIEWSRC 680
#define K_FOLLOWIMP 690 #define K_NAMEINDASM 691 #define K_NAMEINDUMP 692 #define K_NAMEREFS 693 #define K_NAMEHELPAPI 694
#define K_0 1008 #define K_1 1009 #define K_2 1010 #define K_3 1011 #define K_4 1012 #define K_5 1013 #define K_6 1014 #define K_7 1015 #define K_8 1016 #define K_9 1017 #define K_A 1018 #define K_B 1019 #define K_C 1020 #define K_D 1021 #define K_E 1022 #define K_F 1023
#define PWM_ATTACH L"ATTACH" #define PWM_BPHARD L"BPHARD" #define PWM_BPMEM L"BPMEM" #define PWM_BPOINT L"BPOINT" #define PWM_DISASM L"DISASM" #define PWM_DUMP L"DUMP" #define PWM_INFO L"INFO" #define PWM_LOG L"LOG" #define PWM_MAIN L"MAIN" #define PWM_MEMORY L"MEMORY" #define PWM_MODULES L"MODULES" #define PWM_NAMELIST L"NAMELIST" #define PWM_PATCHES L"PATCHES" #define PWM_PROFILE L"PROFILE" #define PWM_REGISTERS L"REGISTERS" #define PWM_SEARCH L"SEARCH" #define PWM_SOURCE L"SOURCE" #define PWM_SRCLIST L"SRCLIST" #define PWM_STACK L"STACK" #define PWM_THREADS L"THREADS" #define PWM_TRACE L"TRACE" #define PWM_WATCH L"WATCH" #define PWM_WINDOWS L"WINDOWS"
typedef int MENUFUNC(struct t_table *,wchar_t *,ulong,int);
typedef struct t_menu { wchar_t *name; wchar_t *help; int shortcutid; MENUFUNC *menufunc; struct t_menu *submenu; union { ulong index; HMENU hsubmenu; }; } t_menu;
stdapi (int) Callmenufunction(struct t_table *pt,t_menu *pm, MENUFUNC *menufunc,ulong index);
typedef enum t_status { STAT_IDLE, STAT_LOADING, STAT_ATTACHING, STAT_RUNNING, STAT_RUNTHR, STAT_STEPIN, STAT_STEPOVER, STAT_ANIMIN, STAT_ANIMOVER, STAT_TRACEIN, STAT_TRACEOVER, STAT_SFXRUN, STAT_SFXHIT, STAT_SFXKNOWN, STAT_TILLRET, STAT_OVERRET, STAT_TILLUSER, STAT_PAUSING, STAT_PAUSED, STAT_FINISHED, STAT_CLOSING } t_status;
varapi (void) Info(wchar_t *format,...); varapi (void) Message(ulong addr,wchar_t *format,...); varapi (void) Tempinfo(wchar_t *format,...); varapi (void) Flash(wchar_t *format,...); varapi (void) Progress(int promille,wchar_t *format,...); stdapi (void) Moveprogress(int promille); stdapi (void) Setstatus(t_status newstatus);
#define NM_NONAME 0x00 #define DT_NONE 0x00 #define NM_LABEL 0x21 #define NM_EXPORT 0x22 #define NM_DEEXP (NM_EXPORT+1) #define DT_EORD (NM_EXPORT+2) #define NM_ALIAS (NM_EXPORT+3) #define NM_IMPORT 0x26 #define NM_DEIMP (NM_IMPORT+1) #define DT_IORD (NM_IMPORT+2) #define NM_DEBUG 0x29 #define NM_DEDEBUG (NM_DEBUG+1) #define NM_ANLABEL 0x2B #define NM_COMMENT 0x30 #define NM_ANALYSE 0x31 #define NM_MARK 0x32 #define NM_CALLED 0x33 #define DT_ARG 0x34 #define DT_NARG 0x35 #define NM_RETTYPE 0x36 #define NM_MODCOMM 0x37 #define NM_TRICK 0x38 #define DT_SWITCH 0x40 #define DT_CASE 0x41 #define DT_MNEMO 0x42 #define NM_DLLPARMS 0x44 #define DT_DLLDATA 0x45
#define DT_DBGPROC 0x4A
#define NM_INT3BASE 0x51 #define NM_INT3COND (NM_INT3BASE+0) #define NM_INT3EXPR (NM_INT3BASE+1) #define NM_INT3TYPE (NM_INT3BASE+2) #define NM_MEMBASE 0x54 #define NM_MEMCOND (NM_MEMBASE+0) #define NM_MEMEXPR (NM_MEMBASE+1) #define NM_MEMTYPE (NM_MEMBASE+2) #define NM_HARDBASE 0x57 #define NM_HARDCOND (NM_HARDBASE+0) #define NM_HARDEXPR (NM_HARDBASE+1) #define NM_HARDTYPE (NM_HARDBASE+2)
#define NM_LABELSAV 0x60 #define NM_ASMSAV 0x61 #define NM_ASRCHSAV 0x62 #define NM_COMMSAV 0x63 #define NM_WATCHSAV 0x64 #define NM_GOTOSAV 0x65 #define DT_BINSAV 0x66 #define NM_CONSTSAV 0x67 #define NM_STRSAV 0x68 #define NM_ARGSAV 0x69 #define NM_CURRSAV 0x6A
#define NM_SEQSAV 0x6F
#define NM_RTCOND1 0x70 #define NM_RTCOND2 0x71 #define NM_RTCOND3 0x72 #define NM_RTCOND4 0x73 #define NM_RTCMD1 0x74 #define NM_RTCMD2 0x75 #define NM_RANGE0 0x76 #define NM_RANGE1 0x77
#define DT_ANYDATA 0xFF
#define NMOFS_COND 0 #define NMOFS_EXPR 1 #define NMOFS_TYPE 2
typedef struct dt_iord { ulong ord; wchar_t modname[SHORTNAME]; } dt_iord;
#define NSWEXIT 256 #define NSWCASE 128
#define CASE_CASCADED 0x00000001 #define CASE_HUGE 0x00000002 #define CASE_DEFAULT 0x00000004 #define CASE_TYPEMASK 0x00000070 #define CASE_ASCII 0x00000010 #define CASE_MSG 0x00000020 #define CASE_EXCPTN 0x00000040 #define CASE_SIGNED 0x00000080
typedef struct dt_switch { ulong casemin; ulong casemax; ulong type; int nexit; ulong exitaddr[NSWEXIT]; } dt_switch;
typedef struct dt_case { ulong swbase; ulong type; int ncase; ulong value[NSWCASE]; } dt_case;
#define MF_JZ 0x01 #define MF_JC 0x02
typedef struct dt_mnemo { uchar flags; } dt_mnemo;
stdapi (int) Insertdata(ulong addr,int type,void *data,ulong datasize); stdapi (ulong) Finddata(ulong addr,int type,void *data,ulong datasize); stdapi (void *) Finddataptr(ulong addr,int type,ulong *datasize); stdapi (void) Startnextdata(ulong addr0,ulong addr1,int type); stdapi (ulong) Findnextdata(ulong *addr,void *data,ulong datasize); stdapi (void) Startnextdatalist(ulong addr0,ulong addr1,int *list,int n); stdapi (int) Findnextdatalist(ulong *addr,int *type, void *data,ulong datasize); stdapi (int) Isdataavailable(ulong addr,int type1,int type2,int type3); stdapi (int) Isdatainrange(ulong addr0,ulong addr1, int type1,int type2,int type3); stdapi (void) Deletedatarange(ulong addr0,ulong addr1, int type1,int type2,int type3); stdapi (void) Deletedatarangelist(ulong addr0,ulong addr1,int *list,int n); stdapi (int) Quickinsertdata(ulong addr,int type, void *data,ulong datasize); stdapi (void) Mergequickdata(void); stdapi (int) DemanglenameW(wchar_t *name,wchar_t *undecorated,int recurs); stdapi (int) InsertnameW(ulong addr,int type,wchar_t *s); stdapi (int) QuickinsertnameW(ulong addr,int type,wchar_t *s); stdapi (int) FindnameW(ulong addr,int type,wchar_t *name,int nname); stdapi (int) FindnextnameW(ulong *addr,wchar_t *name,int nname); stdapi (void) Startnextnamelist(ulong addr0,ulong addr1,int *list,int n); stdapi (int) FindnextnamelistW(ulong *addr,int *type, wchar_t *name,int nname); stdapi (int) Findlabel(ulong addr,wchar_t *name,int firsttype); stdapi (int) FindaddressW(wchar_t *name,struct t_module *pmod, ulong *addr,wchar_t *errtxt);
typedef struct t_simple { uchar *heap; ulong itemsize; int maxitem; int nitem; int sorted; } t_simple;
stdapi (void) Destroysimpledata(t_simple *pdat); stdapi (int) Createsimpledata(t_simple *pdat,ulong itemsize); stdapi (int) Addsimpledata(t_simple *pdat,void *data); stdapi (void) Sortsimpledata(t_simple *pdat); stdapi (void *) Findsimpledata(t_simple *pdat,ulong addr); stdapi (int) Getsimpledataindexbyaddr(t_simple *pdat,ulong addr); stdapi (void *) Getsimpledatabyindex(t_simple *pdat,int index); stdapi (void) Deletesimpledatarange(t_simple *pdat,ulong addr0,ulong addr1);
#define PRED_SHORTSP 0x8000 #define PRED_SHORTBP 0x4000 #define PRED_ESPRET 0x0400 #define PRED_ESPOK 0x0200 #define PRED_EBPOK 0x0100 #define PRED_REL 0x0080 #define PRED_RESMASK 0x003F #define PRED_VALID 0x0020 #define PRED_ADDR 0x0010 #define PRED_ORIG 0x0008 #define PRED_OMASK 0x0007
#define PRED_ESPKNOWN (PRED_ESPRET|PRED_ESPOK)
typedef struct sd_pred { ulong addr; ushort mode; long espconst; long ebpconst; ulong resconst; } sd_pred;
#define SDM_INDEXED 0x00000001 #define SDM_EXTADDR 0x00000002 #define SDM_NOSIZE 0x00000004 #define SDM_NOEXTEND 0x00000008
#define TY_AEXTMASK 0x000000FF
#define TY_NEW 0x00000100 #define TY_CONFIRMED 0x00000200 #define TY_EXTADDR 0x00000400 #define TY_SELECTED 0x00000800
#define MOD_MAIN 0x00010000 #define MOD_SFX 0x00020000 #define MOD_SFXDONE 0x00040000 #define MOD_RUNDLL 0x00080000 #define MOD_SYSTEMDLL 0x00100000 #define MOD_SUPERSYS 0x00200000 #define MOD_DBGDATA 0x00400000 #define MOD_ANALYSED 0x00800000 #define MOD_NODATA 0x01000000 #define MOD_HIDDEN 0x02000000 #define MOD_NETAPP 0x04000000 #define MOD_RESOLVED 0x40000000
#define MEM_ANYMEM 0x0FFFF000 #define MEM_CODE 0x00001000 #define MEM_DATA 0x00002000 #define MEM_SFX 0x00004000 #define MEM_IMPDATA 0x00008000 #define MEM_EXPDATA 0x00010000 #define MEM_RSRC 0x00020000 #define MEM_RELOC 0x00040000 #define MEM_STACK 0x00080000 #define MEM_STKGUARD 0x00100000 #define MEM_THREAD 0x00200000 #define MEM_HEADER 0x00400000 #define MEM_DEFHEAP 0x00800000 #define MEM_HEAP 0x01000000 #define MEM_NATIVE 0x02000000 #define MEM_GAP 0x08000000 #define MEM_SECTION 0x10000000 #define MEM_GUARDED 0x40000000 #define MEM_TEMPGUARD 0x80000000
#define THR_MAIN 0x00010000 #define THR_NETDBG 0x00020000 #define THR_ORGHANDLE 0x00100000
#define WN_UNICODE 0x00010000
#define PD_CALLBACK 0x00001000 #define PD_RETSIZE 0x00010000 #define PD_TAMPERRET 0x00020000 #define PD_NORETURN 0x00040000 #define PD_PURE 0x00080000 #define PD_ESPALIGN 0x00100000 #define PD_ARGMASK 0x07E00000 #define PD_FIXARG 0x00200000 #define PD_FORMATA 0x00400000 #define PD_FORMATW 0x00800000 #define PD_SCANA 0x01000000 #define PD_SCANW 0x02000000 #define PD_COUNT 0x04000000 #define PD_GUESSED 0x08000000 #define PD_NGUESS 0x10000000 #define PD_VARGUESS 0x20000000 #define PD_NPUSH 0x40000000 #define PD_VARPUSH 0x80000000
#define PR_PUSHBP 0x00010000 #define PR_MOVBPSP 0x00020000 #define PR_SETSEH 0x00040000 #define PR_RETISJMP 0x00100000 #define PR_DIFFRET 0x00200000 #define PR_JMPTORET 0x00400000 #define PR_TAMPERRET 0x00800000 #define PR_BADESP 0x01000000 #define PR_RET 0x02000000 #define PR_STEPINTO 0x10000000
#define BP_BASE 0x0000F000 #define BP_MANUAL 0x00001000 #define BP_ONESHOT 0x00002000 #define BP_TEMP 0x00004000 #define BP_TRACE 0x00008000 #define BP_SET 0x00010000 #define BP_DISABLED 0x00020000 #define BP_COND 0x00040000 #define BP_PERIODICAL 0x00080000 #define BP_ACCESSMASK 0x00E00000 #define BP_READ 0x00200000 #define BP_WRITE 0x00400000 #define BP_EXEC 0x00800000 #define BP_BREAKMASK 0x03000000 #define BP_NOBREAK 0x00000000 #define BP_CONDBREAK 0x01000000 #define BP_BREAK 0x03000000 #define BP_LOGMASK 0x0C000000 #define BP_NOLOG 0x00000000 #define BP_CONDLOG 0x04000000 #define BP_LOG 0x0C000000 #define BP_ARGMASK 0x30000000 #define BP_NOARG 0x00000000 #define BP_CONDARG 0x10000000 #define BP_ARG 0x30000000 #define BP_RETMASK 0xC0000000 #define BP_NORET 0x00000000 #define BP_CONDRET 0x40000000 #define BP_RET 0xC0000000 #define BP_MANMASK (BP_PERIODICAL|BP_BREAKMASK|BP_LOGMASK|BP_ARGMASK|BP_RETMASK) #define BP_CONFIRM TY_CONFIRMED
#define SE_ORIGIN 0x00010000 #define SE_STRING 0x00020000 #define SE_FLOAT 0x00040000 #define SE_GUID 0x00080000 #define SE_CONST 0x01000000
#define SRC_ABSENT 0x00010000
#define NL_EORD 0x00010000 #define NL_IORD 0x00020000
typedef struct t_sorthdr { ulong addr; ulong size; ulong type; } t_sorthdr;
typedef struct t_sorthdr_nosize { ulong addr; } t_sorthdr_nosize;
typedef int SORTFUNC(const t_sorthdr *,const t_sorthdr *,const int); typedef void DESTFUNC(t_sorthdr *);
#define AUTOARRANGE ((SORTFUNC *)1)
#define NBLOCK 2048 #define BLOCKSIZE 1048576
typedef struct t_sorted { int n; int nmax; ulong itemsize; int mode; void *data; void **block; int nblock; ulong version; void **dataptr; int selected; ulong seladdr; ulong selsubaddr; SORTFUNC *sortfunc; DESTFUNC *destfunc; int sort; int sorted; int *sortindex; } t_sorted;
stdapi (void) Destroysorteddata(t_sorted *sd); stdapi (int) Createsorteddata(t_sorted *sd,ulong itemsize,int nexp, SORTFUNC *sortfunc,DESTFUNC *destfunc,int mode); stdapi (void) Deletesorteddata(t_sorted *sd,ulong addr,ulong subaddr); stdapi (int) Deletesorteddatarange(t_sorted *sd,ulong addr0,ulong addr1); stdapi (void *) Addsorteddata(t_sorted *sd,void *item); stdapi (int) Replacesorteddatarange(t_sorted *sd,void *data,int n, ulong addr0,ulong addr1); stdapi (void) Renumeratesorteddata(t_sorted *sd); stdapi (int) Confirmsorteddata(t_sorted *sd,int confirm); stdapi (int) Deletenonconfirmedsorteddata(t_sorted *sd); stdapi (void) Unmarknewsorteddata(t_sorted *sd); stdapi (void *) Findsorteddata(t_sorted *sd,ulong addr,ulong subaddr); stdapi (void *) Findsorteddatarange(t_sorted *sd,ulong addr0,ulong addr1); stdapi (int) Findsortedindexrange(t_sorted *sd,ulong addr0,ulong addr1); stdapi (void *) Getsortedbyindex(t_sorted *sd,int index); stdapi (int) Sortsorteddata(t_sorted *sd,int sort); stdapi (void *) Getsortedbyselection(t_sorted *sd,int index); stdapi (int) Issortedinit(t_sorted *sd);
#define NBAR 17
#define BAR_FLAT 0x00000000 #define BAR_BUTTON 0x00000001 #define BAR_SORT 0x00000002 #define BAR_DISABLED 0x00000004 #define BAR_NORESIZE 0x00000008 #define BAR_SHIFTSEL 0x00000010 #define BAR_WIDEFONT 0x00000020 #define BAR_SEP 0x00000040 #define BAR_ARROWS 0x00000080 #define BAR_PRESSED 0x00000100 #define BAR_SPMASK 0x0000F000 #define BAR_SPSTD 0x00000000 #define BAR_SPASM 0x00001000 #define BAR_SPEXPR 0x00002000 #define BAR_SPEXACT 0x00003000 #define BAR_SPELL 0x00004000 #define BAR_SPHEX 0x00005000 #define BAR_SPNONE 0x0000F000
typedef struct t_bar { int nbar; int visible; wchar_t *name[NBAR]; wchar_t *expl[NBAR]; int mode[NBAR]; int defdx[NBAR]; int dx[NBAR]; int captured; int active; int scrollvx; int scrollvy; int prevx; int prevy; } t_bar;
#define TABLE_USERDEF 0x00000001 #define TABLE_STDSCR 0x00000002 #define TABLE_SIMPLE 0x00000004 #define TABLE_DIR 0x00000008 #define TABLE_COLSEL 0x00000010 #define TABLE_BYTE 0x00000020 #define TABLE_FASTSEL 0x00000040 #define TABLE_RIGHTSEL 0x00000080 #define TABLE_RFOCUS 0x00000100 #define TABLE_NOHSCR 0x00000200 #define TABLE_NOVSCR 0x00000400 #define TABLE_NOBAR 0x00000800 #define TABLE_STATUS 0x00001000 #define TABLE_MMOVX 0x00002000 #define TABLE_MMOVY 0x00004000 #define TABLE_WANTCHAR 0x00008000 #define TABLE_SAVEAPP 0x00010000 #define TABLE_SAVEPOS 0x00020000 #define TABLE_SAVECOL 0x00040000 #define TABLE_SAVESORT 0x00080000 #define TABLE_SAVECUST 0x00100000 #define TABLE_GRAYTEXT 0x00200000 #define TABLE_NOGRAY 0x00400000 #define TABLE_UPDFOCUS 0x00800000 #define TABLE_AUTOUPD 0x01000000 #define TABLE_SYNTAX 0x02000000 #define TABLE_PROPWID 0x04000000 #define TABLE_INFRAME 0x10000000 #define TABLE_BORDER 0x20000000 #define TABLE_KEEPOFFS 0x80000000
#define TABLE_MOUSEMV (TABLE_MMOVX|TABLE_MMOVY) #define TABLE_SAVEALL (TABLE_SAVEAPP|TABLE_SAVEPOS|TABLE_SAVECOL|TABLE_SAVESORT)
#define DRAW_COLOR 0x0000001F
#define DRAW_NORMAL 0x00000000 #define DRAW_HILITE 0x00000001 #define DRAW_GRAY 0x00000002 #define DRAW_EIP 0x00000003 #define DRAW_BREAK 0x00000004 #define DRAW_COND 0x00000005 #define DRAW_BDIS 0x00000006 #define DRAW_IPBREAK 0x00000007 #define DRAW_AUX 0x00000008 #define DRAW_SELUL 0x00000009
#define DRAW_PLAIN 0x0000000C #define DRAW_JUMP 0x0000000D #define DRAW_CJMP 0x0000000E #define DRAW_PUSHPOP 0x0000000F #define DRAW_CALL 0x00000010 #define DRAW_RET 0x00000011 #define DRAW_FPU 0x00000012 #define DRAW_SUSPECT 0x00000013 #define DRAW_FILL 0x00000014 #define DRAW_MOD 0x00000015
#define DRAW_IREG 0x00000018 #define DRAW_FREG 0x00000019 #define DRAW_SYSREG 0x0000001A #define DRAW_STKMEM 0x0000001B #define DRAW_MEM 0x0000001C #define DRAW_MCONST 0x0000001D #define DRAW_CONST 0x0000001E #define DRAW_APP 0x00000060 #define DRAW_TEXT 0x00000000 #define DRAW_ULTEXT 0x00000020 #define DRAW_GRAPH 0x00000060 #define DRAW_SELECT 0x00000080 #define DRAW_MASK 0x00000100 #define DRAW_VARWIDTH 0x00000200 #define DRAW_EXTSEL 0x00000800 #define DRAW_TOP 0x00001000 #define DRAW_BOTTOM 0x00002000 #define DRAW_INACTIVE 0x00004000 #define DRAW_RAWDATA 0x00008000 #define DRAW_NEW 0x00010000
typedef struct t_drawheader { int line; int n; ulong nextaddr; ulong addr; uchar s[TEXTLEN]; } t_drawheader;
#define MOVETOP 0x8000 #define MOVEBOTTOM 0x7FFF
#define DF_CACHESIZE (-4) #define DF_FILLCACHE (-3) #define DF_FREECACHE (-2) #define DF_NEWROW (-1)
#define TSC_KEY 1 #define TSC_MOUSE 2 #define TSC_CALL 3
typedef long TABFUNC(struct t_table *,HWND,UINT,WPARAM,LPARAM); typedef int UPDATEFUNC(struct t_table *); typedef int DRAWFUNC(wchar_t *,uchar *,int *,struct t_table *, t_sorthdr *,int,void *); typedef void TABSELFUNC(struct t_table *,int,int);
typedef struct t_table { wchar_t name[SHORTNAME]; int mode; t_sorted sorted; int subtype; t_bar bar; int bottomspace; int minwidth; TABFUNC *tabfunc; UPDATEFUNC *updatefunc; DRAWFUNC *drawfunc; TABSELFUNC *tableselfunc; t_menu *menu; ulong custommode; void *customdata; HWND hparent; HWND hstatus; HWND hw; HWND htooltip; int font; int scheme; int hilite; int hscroll; int xshift; int offset; int colsel; ulong version; ulong timerdraw; RECT rcprev; int rtback; } t_table;
#define GWL_USR_TABLE 0
#define WM_USER_CREATE (WM_USER+100) #define WM_USER_HSCR (WM_USER+101) #define WM_USER_VSCR (WM_USER+102) #define WM_USER_MOUSE (WM_USER+103) #define WM_USER_VINC (WM_USER+104) #define WM_USER_VPOS (WM_USER+105) #define WM_USER_VBYTE (WM_USER+106) #define WM_USER_SETS (WM_USER+107) #define WM_USER_CNTS (WM_USER+108) #define WM_USER_MMOV (WM_USER+109) #define WM_USER_MOVS (WM_USER+110) #define WM_USER_KEY (WM_USER+111) #define WM_USER_BAR (WM_USER+112) #define WM_USER_DBLCLK (WM_USER+113) #define WM_USER_SELXY (WM_USER+114) #define WM_USER_FOCUS (WM_USER+115) #define WM_USER_UPD (WM_USER+116) #define WM_USER_MTAB (WM_USER+117)
#define WM_USER_CHGALL (WM_USER+132) #define WM_USER_CHGCPU (WM_USER+133) #define WM_USER_CHGMEM (WM_USER+134) #define WM_USER_BKUP (WM_USER+135) #define WM_USER_FILE (WM_USER+136) #define WM_USER_NAMES (WM_USER+137) #define WM_USER_SAVE (WM_USER+138) #define WM_USER_CLEAN (WM_USER+139) #define WM_USER_HERE (WM_USER+140) #define WM_USER_CLOSE (WM_USER+141)
#define KEY_ALT 0x04 #define KEY_CTRL 0x02 #define KEY_SHIFT 0x01
#define ALIGN_MASK 0xC000 #define ALIGN_LEFT 0x0000 #define ALIGN_RIGHT 0x4000 #define ALIGN_WIDTH 0x8000 #define ALIGN_IDMASK 0x0FFF
stdapi (void) Processwmmousewheel(HWND hw,WPARAM wp); stdapi (int) Getcharacterwidth(t_table *pt,int column); stdapi (void) Defaultbar(t_table *pt); stdapi (int) Linecount(t_table *pt); stdapi (int) Gettabletext(t_table *pt,int row,int column, wchar_t *text,uchar *tmask,int *tselect); stdapi (int) Gettableselectionxy(t_table *pt,int column,POINT *coord); stdapi (int) Maketableareavisible(t_table *pt,int column, int x0,int y0,int x1,int y1); stdapi (int) Movetableselection(t_table *pt,int n); stdapi (int) Settableselection(t_table *pt,int selected); stdapi (int) Removetableselection(t_table *pt); stdapi (void) Updatetable(t_table *pt,int force); stdapi (void) Delayedtableredraw(t_table *pt); stdapi (void) Setautoupdate(t_table *pt,int autoupdate); stdapi (HGLOBAL) Copytableselection(t_table *pt,int column); stdapi (HGLOBAL) Copywholetable(t_table *pt,int compatible); stdapi (HWND) Createottablewindow(HWND hparent,t_table *pt,RECT *rpos); stdapi (HWND) Createtablewindow(t_table *pt,int nrow,int ncolumn, HINSTANCE hi,wchar_t *icon,wchar_t *title); stdapi (HWND) Activatetablewindow(t_table *pt); stdapi (HWND) Createtablechild(t_table *pt,wchar_t *classname,wchar_t *name, wchar_t *help,ulong style,int x,int y,int dx,int dy, int idalign);
#define BLK_NONE 0 #define BLK_HDIV 1 #define BLK_VDIV 2 #define BLK_TABLE 3
typedef struct t_block { int index; int type; int percent; int offset; struct t_block *blk1; int minp1; int maxc1; struct t_block *blk2; int minp2; int maxc2; t_table *table; wchar_t tabname[SHORTNAME]; wchar_t title[TEXTLEN]; wchar_t status[TEXTLEN]; } t_block;
typedef struct t_frame { wchar_t name[SHORTNAME]; int herebit; int mode; t_block *block; t_menu *menu; int scheme; HWND hw; HWND htab; WNDPROC htabwndproc; int capturedtab; HWND hstatus; t_block *active; t_block *captured; int captureoffset; int capturex; int capturey; wchar_t title[TEXTLEN]; } t_frame;
stdapi (HWND) Createframewindow(t_frame *pf,wchar_t *icon,wchar_t *title); stdapi (void) Updateframe(t_frame *pf,int redrawnow); stdapi (t_table *) Getactiveframe(t_frame *pf);
stdapi (int) Updatetabs(t_frame *pf); stdapi (HWND) Createtabwindow(t_frame *pf,wchar_t *icon,wchar_t *title); stdapi (t_table *) Getactivetab(t_frame *pf); stdapi (int) Gettabcount(t_frame *pf,int *index); stdapi (int) Setactivetab(t_frame *pf,int index);
#define FIXEDFONT 0 #define TERMINAL6 1 #define FIXEDSYS 2 #define COURIERFONT 3 #define LUCIDACONS 4 #define FONT5 5 #define FONT6 6 #define FONT7 7
#define NFIXFONTS 8
#define BLACKWHITE 0 #define BLUEGOLD 1 #define SKYWIND 2 #define NIGHTSTARS 3 #define SCHEME4 4 #define SCHEME5 5 #define SCHEME6 6 #define SCHEME7 7
#define NSCHEMES 8 #define NDRAW 32
#define NOHILITE 0 #define XMASHILITE 1 #define JUMPHILITE 2 #define MEMHILITE 3 #define HILITE4 4 #define HILITE5 5 #define HILITE6 6 #define HILITE7 7
#define NHILITE 8
#define BLACK 0 #define BLUE 1 #define GREEN 2 #define CYAN 3 #define RED 4 #define MAGENTA 5 #define BROWN 6 #define LIGHTGRAY 7 #define DARKGRAY 8 #define LIGHTBLUE 9 #define LIGHTGREEN 10 #define LIGHTCYAN 11 #define LIGHTRED 12 #define LIGHTMAGENTA 13 #define YELLOW 14 #define WHITE 15 #define MINT 16 #define SKYBLUE 17 #define IVORY 18 #define GRAY 19
#define NFIXCOLORS 20 #define NCOLORS (NFIXCOLORS+16)
#define G_SPACE 0x01 #define G_SEP 0x02 #define G_POINT 0x03 #define G_BIGPOINT 0x04 #define G_JMPDEST 0x05 #define G_CALLDEST 0x06 #define G_QUESTION 0x07 #define G_JMPUP 0x10 #define G_JMPOUT 0x11 #define G_JMPDN 0x12 #define G_SWUP 0x13 #define G_SWBOTH 0x14 #define G_SWDOWN 0x15 #define G_BEGIN 0x18 #define G_BODY 0x19 #define G_ENTRY 0x1A #define G_LEAF 0x1B #define G_END 0x1C #define G_SINGLE 0x1D #define G_ENDBEG 0x1E #define G_PATHUP 0x21 #define G_PATH 0x22 #define G_PATHDN 0x23 #define G_PATHUPDN 0x24 #define G_THROUGHUP 0x25 #define G_THROUGHDN 0x26 #define G_PATHUPEND 0x27 #define G_PATHDNEND 0x28 #define G_PATHBIEND 0x29 #define G_THRUUPEND 0x2A #define G_THRUDNEND 0x2B #define G_ARRLEFT 0x2C
#define G_HL 0x30 #define G_LT 0x31 #define G_CT 0x32 #define G_RT 0x33 #define G_LM 0x34 #define G_CM 0x35 #define G_RM 0x36 #define G_LB 0x37 #define G_CB 0x38 #define G_RB 0x39 #define G_VL 0x3A #define G_LA 0x3B #define G_RA 0x3C #define G_DA 0x3D
typedef struct t_font { LOGFONT logfont; int stockindex; int hadjtop; int hadjbot; wchar_t name[TEXTLEN]; HFONT hfont; int isstock; int isfullunicode; int width; int height; } t_font;
typedef struct t_scheme { wchar_t name[TEXTLEN]; COLORREF textcolor[NDRAW]; COLORREF bkcolor[NDRAW]; int hiliteoperands; int hilitemodified; HBRUSH bkbrush; HBRUSH selbkbrush; HBRUSH auxbrush; HPEN graphpen; HPEN lopen; HPEN hipen; HPEN auxpen; HPEN ulpen; } t_scheme;
stdapi (int) Getmonitorrect(int x,int y,RECT *rc); stdapi (void) Sunkenframe(HDC dc,RECT *rc,int flags); stdapi (int) Findstockobject(ulong gdihandle,wchar_t *name,int nname);
#define MM_REPORT 0x0000 #define MM_SILENT 0x0001 #define MM_NORESTORE 0x0002 #define MM_PARTIAL 0x0004 #define MM_WRITETHRU 0x0008 #define MM_REMOVEINT3 0x0010 #define MM_ADJUSTINT3 0x0020 #define MM_FAILGUARD 0x0040
#define MM_BPMASK BP_ACCESSMASK #define MM_BPREAD BP_READ #define MM_BPWRITE BP_WRITE #define MM_BPEXEC BP_EXEC
#define MSP_NONE 0 #define MSP_PEB 1 #define MSP_SHDATA 2 #define MSP_PROCPAR 3 #define MSP_ENV 4
typedef struct t_memory { ulong base; ulong size; ulong type; int special; ulong owner; ulong initaccess; ulong access; ulong threadid; wchar_t sectname[SHORTNAME]; uchar *copy; uchar *decode; } t_memory;
stdapi (void) Flushmemorycache(void); stdapi (ulong) Readmemory(void *buf,ulong addr,ulong size,int mode); stdapi (ulong) Readmemoryex(void *buf,ulong addr,ulong size,int mode, ulong threadid); stdapi (ulong) Writememory(const void *buf,ulong addr,ulong size,int mode); stdapi (t_memory *) Findmemory(ulong addr); stdapi (uchar *) Finddecode(ulong addr,ulong *psize); stdapi (int) Guardmemory(ulong base,ulong size,int guard); stdapi (int) Listmemory(void); stdapi (HGLOBAL) Copymemoryhex(ulong addr,ulong size); stdapi (int) Pastememoryhex(ulong addr,ulong size, int ensurebackup,int removeanalysis); stdapi (int) Editmemory(HWND hparent,ulong addr,ulong size, int ensurebackup,int removeanalysis,int x,int y,int font);
#define JT_TYPE 0x000F #define JT_UNDEF 0x0000 #define JT_JUMP 0x0001 #define JT_COND 0x0002 #define JT_SWITCH 0x0003 #define JT_RET 0x0004 #define JT_CALL 0x0005 #define JT_SWCALL 0x0006 #define JT_NETJUMP 0x0008 #define JT_NETCOND 0x0009 #define JT_NETSW 0x000A
#define JT_NOSORT 0x8000
#define Isjump(jmp) (((jmp)->type>=JT_JUMP && (jmp)->type<=JT_RET) || \ ((jmp)->type>=JT_NETJUMP && (jmp)->type<=JT_NETSW)) #define Iscall(jmp) ((jmp)->type==JT_CALL || (jmp)->type==JT_SWCALL)
typedef struct t_jmp { ulong from; ulong dest; uchar type; } t_jmp;
typedef struct t_exe { ulong base; ulong size; int adjusted; wchar_t path[MAXPATH]; } t_exe;
typedef struct t_jmpdata { ulong modbase; ulong modsize; t_jmp *jmpdata; int *jmpindex; int maxjmp; int njmp; int nsorted; int dontsort; t_exe *exe; int maxexe; int nexe; } t_jmpdata;
typedef struct t_jmpcall { ulong addr; union { int type; ulong swcase; }; } t_jmpcall;
stdapi (int) Addjump(t_jmpdata *pdat,ulong from,ulong dest,int type); stdapi (void) Sortjumpdata(t_jmpdata *pdat); stdapi (t_jmp *) Findjumpfrom(ulong from); stdapi (int) Findlocaljumpsto(ulong dest,ulong *buf,int nbuf); stdapi (int) Findlocaljumpscallsto(ulong dest,t_jmpcall *jmpcall, int njmpcall); stdapi (int) Arelocaljumpscallstorange(ulong addr0,ulong addr1); stdapi (int) Findglobalcallsto(ulong dest,ulong *buf,int nbuf); stdapi (int) Findglobaljumpscallsto(ulong dest,t_jmpcall *jmpcall, int njmpcall);
typedef struct t_range { ulong rmin; ulong rmax; } t_range;
stdapi (int) Initset(t_range *set,ulong nmax); stdapi (int) Fullrange(t_range *set); stdapi (int) Emptyrange(t_range *set); stdapi (ulong) Getsetcount(const t_range *set); stdapi (int) Getrangecount(const t_range *set); stdapi (int) Isinset(const t_range *set,ulong value); stdapi (int) Getrangebymember(const t_range *set,ulong value, ulong *rmin,ulong *rmax); stdapi (int) Getrangebyindex(const t_range *set,int index, ulong *rmin,ulong *rmax); stdapi (int) Addrange(t_range *set,ulong rmin,ulong rmax); stdapi (int) Removerange(t_range *set,ulong rmin,ulong rmax);
#define ND_LEVELMASK 0x000000FF #define ND_OPENTOP 0x00000100 #define ND_OPENBOTTOM 0x00000200 #define ND_NESTHILITE 0x00000400 #define ND_NESTGRAY 0x00000800
#define ND_MOREVARS 0x00010000
#define MAXNEST 32
typedef struct t_nesthdr { ulong addr0; ulong addr1; ulong type; ulong aprev; } t_nesthdr;
typedef void NDDEST(t_nesthdr *);
typedef struct t_nested { int n; int nmax; ulong itemsize; void *data; ulong version; NDDEST *destfunc; } t_nested;
stdapi (void) Destroynesteddata(t_nested *nd); stdapi (int) Createnesteddata(t_nested *nd,ulong itemsize,int nexp, NDDEST *destfunc); stdapi (void *) Addnesteddata(t_nested *nd,void *item); stdapi (void) Deletenestedrange(t_nested *nd,ulong addr0,ulong addr1); stdapi (int) Getnestingpattern(t_nested *nd,ulong addr,wchar_t *pat, int npat,uchar *mask,int showentry,int *isend); stdapi (int) Getnestingdepth(t_nested *nd,ulong addr); stdapi (void *) Findnesteddata(t_nested *nd,ulong addr,int level);
stdapi (void *) Nesteddatatoudd(t_nested *nd,ulong base,ulong *datasize); stdapi (int) Uddtonesteddata(t_nested *nd,void *data,ulong base,ulong size);
#define SHT_MERGENEXT 0x00000001
#define NCALLMOD 24
#define NS_STRINGS 0 #define NS_GUID 1 #define NS_BLOB 2 #define NS_US 3 #define NS_META 4
#define NETSTREAM 5
#define MDT_MODULE 0 #define MDT_TYPEREF 1 #define MDT_TYPEDEF 2 #define MDT_FIELDPTR 3 #define MDT_FIELD 4 #define MDT_METHODPTR 5 #define MDT_METHOD 6 #define MDT_PARAMPTR 7 #define MDT_PARAM 8 #define MDT_INTERFACE 9 #define MDT_MEMBERREF 10 #define MDT_CONSTANT 11 #define MDT_CUSTATTR 12 #define MDT_MARSHAL 13 #define MDT_DECLSEC 14 #define MDT_CLASSLAY 15 #define MDT_FIELDLAY 16 #define MDT_SIGNATURE 17 #define MDT_EVENTMAP 18 #define MDT_EVENTPTR 19 #define MDT_EVENT 20 #define MDT_PROPMAP 21 #define MDT_PROPPTR 22 #define MDT_PROPERTY 23 #define MDT_METHSEM 24 #define MDT_METHIMPL 25 #define MDT_MODREF 26 #define MDT_TYPESPEC 27 #define MDT_IMPLMAP 28 #define MDT_RVA 29 #define MDT_ENCLOG 30 #define MDT_ENCMAP 31 #define MDT_ASSEMBLY 32 #define MDT_ASMPROC 33 #define MDT_ASMOS 34 #define MDT_ASMREF 35 #define MDT_REFPROC 36 #define MDT_REFOS 37 #define MDT_FILE 38 #define MDT_EXPORT 39 #define MDT_RESOURCE 40 #define MDT_NESTED 41 #define MDT_GENPARM 42 #define MDT_METHSPEC 43 #define MDT_CONSTR 44 #define MDT_UNUSED 63
#define MDTCOUNT 64
typedef struct t_secthdr { wchar_t sectname[12]; ulong base; ulong size; ulong type; ulong fileoffset; ulong rawsize; ulong characteristics; } t_secthdr;
typedef struct t_premod { ulong base; ulong size; ulong type; ulong entry; wchar_t path[MAXPATH]; } t_premod;
typedef struct t_netstream { ulong base; ulong size; } t_netstream;
typedef struct t_metadata { ulong base; ulong rowcount; ulong rowsize; ushort nameoffs; ushort namesize; } t_metadata;
typedef struct t_module { ulong base; ulong size; ulong type; wchar_t modname[SHORTNAME]; wchar_t path[MAXPATH]; wchar_t version[TEXTLEN]; ulong fixupbase; ulong codebase; ulong codesize; ulong entry; ulong sfxentry; ulong winmain; ulong database; ulong edatabase; ulong edatasize; ulong idatatable; ulong iatbase; ulong iatsize; ulong relocbase; ulong relocsize; ulong resbase; ulong ressize; ulong tlsbase; ulong tlssize; ulong tlscallback; ulong netentry; ulong clibase; ulong clisize; t_netstream netstr[NETSTREAM]; t_metadata metadata[MDTCOUNT]; ulong sfxbase; ulong sfxsize; ulong rawhdrsize; ulong memhdrsize; int nsect; t_secthdr *sect; int nfixup; ulong *fixup; t_jmpdata jumps; t_nested loopnest; t_nested argnest; t_simple predict; t_sorted strings; int saveudd; int ncallmod; wchar_t callmod[NCALLMOD][SHORTNAME]; } t_module;
typedef struct t_aqueue { ulong base; ulong size; ulong type; } t_aqueue;
stdapi (t_module *) Findmodule(ulong addr); stdapi (t_module *) Findmodulebyname(wchar_t *shortname); stdapi (t_module *) Findmainmodule(void); stdapi (int) Issystem(ulong addr); stdapi (ulong *) Findfixup(t_module *pmod,ulong addr); stdapi (ulong) Findfileoffset(t_module *pmod,ulong addr); stdapi (int) Decoderange(wchar_t *s,ulong addr,ulong size); stdapi (int) Getexeversion(wchar_t *path,wchar_t *version); stdapi (int) Getexportfrommemory(ulong addr,wchar_t *s);
typedef struct t_window { ulong hwnd; ulong dummy; ulong type; ulong parenthw; ulong winproc; ulong threadid; ulong exstyle; ulong style; ulong id; ulong classproc; RECT windowrect; RECT clientrect; int child; int sibling; int byparent; int level; wchar_t title[TEXTLEN]; wchar_t classname[TEXTLEN]; wchar_t tree[MAXNEST]; } t_window;
#define NA_FIND 0 #define NA_UPDATE 1 #define NA_CLOSE 2 #define NA_CLOSEALL 3
typedef struct t_namecast { ulong base; t_table *table; } t_namecast;
typedef struct t_namelist { ulong addr; ulong size; ulong type; } t_namelist;
typedef struct t_string { ulong id; ulong dummy; ulong addr; ulong count; int language; } t_string;
stdapi (int) Getmodulestring(t_module *pm,ulong id,wchar_t *s);
#define SAVEMAGIC 0xFEDCBA98
typedef struct t_savearea { ulong magic; wchar_t dumpstr[SHORTNAME]; } t_savearea;
#define NREG 8 #define NSEG 6 #define NHARD 4
#define IGNO_INT3 0x00000001 #define IGNO_ACCESS 0x00000002 #define IGNO_HW 0x00000004
#define RDM_MODE 0x0000000F #define RDM_FPU 0x00000000 #define RDM_MMX 0x00000001 #define RDM_3DN 0x00000002 #define RDM_DBG 0x00000003 #define RDM_SSEMODE 0x000000F0 #define RDM_SSEI32 0x00000000 #define RDM_SSEF32 0x00000010 #define RDM_SSEF64 0x00000020
#define RV_MODIFIED 0x00000001 #define RV_USERMOD 0x00000002 #define RV_SSEVALID 0x00000004 #define RV_SSEMOD 0x00000008 #define RV_ERRVALID 0x00000010 #define RV_ERRMOD 0x00000020 #define RV_MEMVALID 0x00000040 #define RV_DBGMOD 0x00000080
#define FLAG_C 0x00000001 #define FLAG_P 0x00000004 #define FLAG_A 0x00000010 #define FLAG_Z 0x00000040 #define FLAG_S 0x00000080 #define FLAG_T 0x00000100 #define FLAG_D 0x00000400 #define FLAG_O 0x00000800
#define NMEMFIELD 2
typedef struct t_memfield { ulong addr; ulong size; uchar data[16]; } t_memfield;
typedef struct t_reg { ulong status; ulong threadid; ulong ip; ulong r[NREG]; ulong flags; ulong s[NSEG]; ulong base[NSEG]; ulong limit[NSEG]; uchar big[NSEG]; uchar dummy[2]; int top; long double f[NREG]; uchar tag[NREG]; ulong fst; ulong fcw; ulong ferrseg; ulong feroffs; ulong dr[NREG]; ulong lasterror; uchar ssereg[NREG][16]; ulong mxcsr; t_memfield mem[NMEMFIELD]; } t_reg;
typedef struct t_thread { ulong threadid; ulong dummy; ulong type; int ordinal; wchar_t name[SHORTNAME]; HANDLE thread; ulong tib; ulong entry; CONTEXT context; t_reg reg; int regvalid; t_reg oldreg; int oldregvalid; int suspendrun; int suspendcount; int suspenduser; int trapset; int trapincontext; ulong rtprotocoladdr; int ignoreonce; int drvalid; ulong dr[NREG]; int hwmasked; int hwreported; HWND hw; ulong usertime; ulong systime; ulong stacktop; ulong stackbottom; } t_thread;
stdapi (t_thread *) Findthread(ulong threadid); stdapi (t_thread *) Findthreadbyordinal(int ordinal); stdapi (t_reg *) Threadregisters(ulong threadid); stdapi (int) Decodethreadname(wchar_t *s,ulong threadid,int mode); stdapi (void) Registermodifiedbyuser(t_thread *pthr);
#define MAXCMDSIZE 16 #define MAXSEQSIZE 256 #define INT3 0xCC #define NOP 0x90 #define NOPERAND 4 #define NEGLIMIT (-16384) #define DECLIMIT 65536
#define REG_UNDEF (-1) #define REG_EAX 0 #define REG_ECX 1 #define REG_EDX 2 #define REG_EBX 3 #define REG_ESP 4 #define REG_EBP 5 #define REG_ESI 6 #define REG_EDI 7
#define REG_BYTE 0x80
#define REG_AL 0 #define REG_CL 1 #define REG_DL 2 #define REG_BL 3 #define REG_AH 4 #define REG_CH 5 #define REG_DH 6 #define REG_BH 7
#define SEG_UNDEF (-1) #define SEG_ES 0 #define SEG_CS 1 #define SEG_SS 2 #define SEG_DS 3 #define SEG_FS 4 #define SEG_GS 5
#define REG_R8 NREG #define REG_R16 NREG #define REG_R32 NREG #define REG_ANY NREG #define SEG_ANY NREG #define REG_RA (NREG+1) #define REG_RB (NREG+2)
#define NPSEUDO (NREG+3)
#define IS_REAL(r) ((r)<REG_R32) #define IS_PSEUDO(r) ((r)>=REG_R32) #define IS_SEMI(r) ((r)>=REG_RA)
#define D_NONE 0x00000000
#define D_CMDTYPE 0x0000001F #define D_CMD 0x00000000 #define D_MOV 0x00000001 #define D_MOVC 0x00000002 #define D_SETC 0x00000003 #define D_TEST 0x00000004 #define D_STRING 0x00000005 #define D_JMP 0x00000006 #define D_JMPFAR 0x00000007 #define D_JMC 0x00000008 #define D_JMCX 0x00000009 #define D_PUSH 0x0000000A #define D_POP 0x0000000B #define D_CALL 0x0000000C #define D_CALLFAR 0x0000000D #define D_INT 0x0000000E #define D_RET 0x0000000F #define D_RETFAR 0x00000010 #define D_FPU 0x00000011 #define D_MMX 0x00000012 #define D_3DNOW 0x00000013 #define D_SSE 0x00000014 #define D_IO 0x00000015 #define D_SYS 0x00000016 #define D_PRIVILEGED 0x00000017 #define D_DATA 0x0000001C #define D_PSEUDO 0x0000001D #define D_PREFIX 0x0000001E #define D_BAD 0x0000001F
#define D_SIZE01 0x00000020 #define D_POSTBYTE 0x00000040
#define D_LONGFORM 0x00000080
#define D_SIZEMASK 0x00000F00 #define D_DATA16 0x00000100 #define D_DATA32 0x00000200 #define D_ADDR16 0x00000400 #define D_ADDR32 0x00000800
#define D_MUSTMASK 0x0000F000 #define D_NOMUST 0x00000000 #define D_MUST66 0x00001000 #define D_MUSTF2 0x00002000 #define D_MUSTF3 0x00003000 #define D_MUSTNONE 0x00004000 #define D_NEEDF2 0x00005000 #define D_NEEDF3 0x00006000 #define D_NOREP 0x00007000 #define D_MUSTREP 0x00008000 #define D_MUSTREPE 0x00009000 #define D_MUSTREPNE 0x0000A000 #define D_LOCKABLE 0x00010000 #define D_BHINT 0x00020000
#define D_MEMORY 0x00040000 #define D_REGISTER 0x00080000
#define D_FLAGMASK 0x00700000 #define D_NOFLAGS 0x00000000 #define D_ALLFLAGS 0x00100000 #define D_FLAGZ 0x00200000 #define D_FLAGC 0x00300000 #define D_FLAGSCO 0x00400000 #define D_FLAGD 0x00500000 #define D_FLAGSZPC 0x00600000 #define D_NOCFLAG 0x00700000 #define D_FPUMASK 0x01800000 #define D_FPUSAME 0x00000000 #define D_FPUPOP 0x00800000 #define D_FPUPOP2 0x01000000 #define D_FPUPUSH 0x01800000 #define D_CHGESP 0x02000000
#define D_HLADIR 0x04000000 #define D_WILDCARD 0x08000000 #define D_COND 0x10000000 #define D_USESCARRY 0x20000000 #define D_USEMASK 0xC0000000 #define D_RARE 0x40000000 #define D_SUSPICIOUS 0x80000000 #define D_UNDOC 0xC0000000
#define DX_ZEROMASK 0x00000003 #define DX_JE 0x00000001 #define DX_JZ 0x00000002 #define DX_CARRYMASK 0x0000000C #define DX_JB 0x00000004 #define DX_JC 0x00000008 #define DX_WONKYTRAP 0x00000100
#define B_ARGMASK 0x000000FF #define B_NONE 0x00000000 #define B_AL 0x00000001 #define B_AH 0x00000002 #define B_AX 0x00000003 #define B_CL 0x00000004 #define B_CX 0x00000005 #define B_DX 0x00000006 #define B_DXPORT 0x00000007 #define B_EAX 0x00000008 #define B_EBX 0x00000009 #define B_ECX 0x0000000A #define B_EDX 0x0000000B #define B_ACC 0x0000000C #define B_STRCNT 0x0000000D #define B_DXEDX 0x0000000E #define B_BPEBP 0x0000000F #define B_REG 0x00000010 #define B_REG16 0x00000011 #define B_REG32 0x00000012 #define B_REGCMD 0x00000013 #define B_REGCMD8 0x00000014 #define B_ANYREG 0x00000015 #define B_INT 0x00000016 #define B_INT8 0x00000017 #define B_INT16 0x00000018 #define B_INT32 0x00000019 #define B_INT1632 0x0000001A #define B_INT64 0x0000001B #define B_INT128 0x0000001C #define B_IMMINT 0x0000001D #define B_INTPAIR 0x0000001E #define B_SEGOFFS 0x0000001F #define B_STRDEST 0x00000020 #define B_STRDEST8 0x00000021 #define B_STRSRC 0x00000022 #define B_STRSRC8 0x00000023 #define B_XLATMEM 0x00000024 #define B_EAXMEM 0x00000025 #define B_LONGDATA 0x00000026 #define B_ANYMEM 0x00000027 #define B_STKTOP 0x00000028 #define B_STKTOPFAR 0x00000029 #define B_STKTOPEFL 0x0000002A #define B_STKTOPA 0x0000002B #define B_PUSH 0x0000002C #define B_PUSHRET 0x0000002D #define B_PUSHRETF 0x0000002E #define B_PUSHA 0x0000002F #define B_EBPMEM 0x00000030 #define B_SEG 0x00000031 #define B_SEGNOCS 0x00000032 #define B_SEGCS 0x00000033 #define B_SEGDS 0x00000034 #define B_SEGES 0x00000035 #define B_SEGFS 0x00000036 #define B_SEGGS 0x00000037 #define B_SEGSS 0x00000038 #define B_ST 0x00000039 #define B_ST0 0x0000003A #define B_ST1 0x0000003B #define B_FLOAT32 0x0000003C #define B_FLOAT64 0x0000003D #define B_FLOAT80 0x0000003E #define B_BCD 0x0000003F #define B_MREG8x8 0x00000040 #define B_MMX8x8 0x00000041 #define B_MMX8x8DI 0x00000042 #define B_MREG16x4 0x00000043 #define B_MMX16x4 0x00000044 #define B_MREG32x2 0x00000045 #define B_MMX32x2 0x00000046 #define B_MREG64 0x00000047 #define B_MMX64 0x00000048 #define B_3DREG 0x00000049 #define B_3DNOW 0x0000004A #define B_XMM0I32x4 0x0000004B #define B_XMM0I64x2 0x0000004C #define B_XMM0I8x16 0x0000004D #define B_SREGF32x4 0x0000004E #define B_SREGF32L 0x0000004F #define B_SREGF32x2L 0x00000050 #define B_SSEF32x4 0x00000051 #define B_SSEF32L 0x00000052 #define B_SSEF32x2L 0x00000053 #define B_SREGF64x2 0x00000054 #define B_SREGF64L 0x00000055 #define B_SSEF64x2 0x00000056 #define B_SSEF64L 0x00000057 #define B_SREGI8x16 0x00000058 #define B_SSEI8x16 0x00000059 #define B_SSEI8x16DI 0x0000005A #define B_SSEI8x8L 0x0000005B #define B_SSEI8x4L 0x0000005C #define B_SSEI8x2L 0x0000005D #define B_SREGI16x8 0x0000005E #define B_SSEI16x8 0x0000005F #define B_SSEI16x4L 0x00000060 #define B_SSEI16x2L 0x00000061 #define B_SREGI32x4 0x00000062 #define B_SREGI32L 0x00000063 #define B_SREGI32x2L 0x00000064 #define B_SSEI32x4 0x00000065 #define B_SSEI32x2L 0x00000066 #define B_SREGI64x2 0x00000067 #define B_SSEI64x2 0x00000068 #define B_SREGI64L 0x00000069 #define B_EFL 0x0000006A #define B_FLAGS8 0x0000006B #define B_OFFSET 0x0000006C #define B_BYTEOFFS 0x0000006D #define B_FARCONST 0x0000006E #define B_DESCR 0x0000006F #define B_1 0x00000070 #define B_CONST8 0x00000071 #define B_CONST8_2 0x00000072 #define B_CONST16 0x00000073 #define B_CONST 0x00000074 #define B_CONSTL 0x00000075 #define B_SXTCONST 0x00000076 #define B_CR 0x00000077 #define B_CR0 0x00000078 #define B_DR 0x00000079
#define B_MODMASK 0x000F0000 #define B_NONSPEC 0x00000000 #define B_UNSIGNED 0x00010000 #define B_SIGNED 0x00020000 #define B_BINARY 0x00030000 #define B_BITCNT 0x00040000 #define B_SHIFTCNT 0x00050000 #define B_COUNT 0x00060000 #define B_NOADDR 0x00070000 #define B_JMPCALL 0x00080000 #define B_JMPCALLFAR 0x00090000 #define B_STACKINC 0x000A0000 #define B_PORT 0x000B0000
#define B_MEMORY 0x00100000 #define B_REGISTER 0x00200000 #define B_MEMONLY 0x00400000 #define B_REGONLY 0x00800000 #define B_32BITONLY 0x01000000 #define B_NOESP 0x02000000
#define B_SHOWSIZE 0x08000000 #define B_CHG 0x10000000 #define B_UPD 0x20000000 #define B_PSEUDO 0x40000000 #define B_NOSEG 0x80000000
#define DEC_TYPEMASK 0x1F #define DEC_UNKNOWN 0x00 #define DEC_NEXTCODE 0x01 #define DEC_NEXTDATA 0x02 #define DEC_FILLDATA 0x03 #define DEC_INT 0x04 #define DEC_SWITCH 0x05 #define DEC_DATA 0x06 #define DEC_DB 0x07 #define DEC_DUMP 0x08 #define DEC_ASCII 0x09 #define DEC_ASCCNT 0x0A #define DEC_UNICODE 0x0B #define DEC_UNICNT 0x0C #define DEC_FLOAT 0x0D #define DEC_GUID 0x10 #define DEC_NETCMD 0x18 #define DEC_JMPNET 0x19 #define DEC_CALLNET 0x1A #define DEC_COMMAND 0x1C #define DEC_JMPDEST 0x1D #define DEC_CALLDEST 0x1E #define DEC_FILLING 0x1F #define DEC_PROCMASK 0x60 #define DEC_NOPROC 0x00 #define DEC_PROC 0x20 #define DEC_PEND 0x40 #define DEC_PBODY 0x60 #define DEC_TRACED 0x80
#define PST_GENMASK 0xFFFFFC00 #define PST_GENINC 0x00000400 #define PST_UNCERT 0x00000200 #define PST_NONSTACK 0x00000100 #define PST_REL 0x00000080 #define PST_BASE 0x0000007F #define PST_SPEC 0x00000040 #define PST_VALID 0x00000020 #define PST_ADDR 0x00000010 #define PST_ORIG 0x00000008 #define PST_OMASK 0x00000007
#define PSS_SPECMASK PST_GENMASK #define PSS_SEHPTR 0x00000400
#define NSTACK 12 #define NSTKMOD 24 #define NMEM 2
typedef struct t_modrm { ulong size; struct t_modrm *psib; ulong dispsize; ulong features; int reg; int defseg; uchar scale[NREG]; ulong aregs; int basereg; wchar_t ardec[SHORTNAME]; wchar_t aratt[SHORTNAME]; } t_modrm;
typedef struct t_predict { ulong addr; ulong one; ulong type; ushort flagsmeaning; ulong rstate[NREG]; ulong rconst[NREG]; ulong jmpstate; ulong jmpconst; ulong espatpushbp; int nstack; struct { long soffset; ulong sstate; ulong sconst; } stack[NSTACK]; int nstkmod; ulong stkmod[NSTKMOD]; int nmem; struct { ulong maddr; ulong mstate; ulong mconst; } mem[NMEM]; ulong resstate; ulong resconst; } t_predict;
typedef struct t_callpredict { ulong addr; ulong one; ulong type; ulong eaxstate; ulong eaxconst; int nstkmod; ulong stkmod[NSTKMOD]; ulong resstate; ulong resconst; } t_callpredict;
#define OP_SOMEREG 0x000000FF #define OP_REGISTER 0x00000001 #define OP_SEGREG 0x00000002 #define OP_FPUREG 0x00000004 #define OP_MMXREG 0x00000008 #define OP_3DNOWREG 0x00000010 #define OP_SSEREG 0x00000020 #define OP_CREG 0x00000040 #define OP_DREG 0x00000080 #define OP_MEMORY 0x00000100 #define OP_CONST 0x00000200 #define OP_PORT 0x00000400
#define OP_INVALID 0x00001000 #define OP_PSEUDO 0x00002000 #define OP_MOD 0x00004000 #define OP_MODREG 0x00008000 #define OP_REL 0x00010000 #define OP_IMPORT 0x00020000 #define OP_SELECTOR 0x00040000
#define OP_INDEXED 0x00080000 #define OP_OPCONST 0x00100000 #define OP_ADDR16 0x00200000 #define OP_ADDR32 0x00400000
#define OP_OFFSOK 0x00800000 #define OP_ADDROK 0x01000000 #define OP_VALUEOK 0x02000000 #define OP_PREDADDR 0x04000000 #define OP_PREDVAL 0x08000000 #define OP_RTLOGMEM 0x10000000 #define OP_ACTVALID 0x20000000
#define OP_ANYMEM 0x40000000 #define OP_ANY 0x80000000
typedef struct t_operand { ulong features; ulong arg; int optype; int opsize; int granularity; int reg; ulong uses; ulong modifies; int seg; uchar scale[NREG]; ulong aregs; ulong opconst; ulong offset; ulong selector; ulong addr; union { ulong u; signed long s; uchar value[16]; }; uchar actual[16]; wchar_t text[TEXTLEN]; wchar_t comment[TEXTLEN]; } t_operand;
#define PF_SEGMASK 0x0000003F #define PF_ES 0x00000001 #define PF_CS 0x00000002 #define PF_SS 0x00000004 #define PF_DS 0x00000008 #define PF_FS 0x00000010 #define PF_GS 0x00000020 #define PF_DSIZE 0x00000040 #define PF_ASIZE 0x00000080 #define PF_LOCK 0x00000100 #define PF_REPMASK 0x00000600 #define PF_REPNE 0x00000200 #define PF_REP 0x00000400 #define PF_BYTE 0x00000800 #define PF_MUSTMASK D_MUSTMASK #define PF_66 PF_DSIZE #define PF_F2 PF_REPNE #define PF_F3 PF_REP #define PF_HINT (PF_CS|PF_DS) #define PF_NOTTAKEN PF_CS #define PF_TAKEN PF_DS
#define DAE_NOERR 0x00000000 #define DAE_BADCMD 0x00000001 #define DAE_CROSS 0x00000002 #define DAE_MEMORY 0x00000004 #define DAE_REGISTER 0x00000008 #define DAE_LOCK 0x00000010 #define DAE_BADSEG 0x00000020 #define DAE_SAMEPREF 0x00000040 #define DAE_MANYPREF 0x00000080 #define DAE_BADCR 0x00000100 #define DAE_INTERN 0x00000200
#define DAW_DATASIZE 0x00000001 #define DAW_ADDRSIZE 0x00000002 #define DAW_SEGPREFIX 0x00000004 #define DAW_REPPREFIX 0x00000008 #define DAW_DEFSEG 0x00000010 #define DAW_JMP16 0x00000020 #define DAW_FARADDR 0x00000040 #define DAW_SEGMOD 0x00000080 #define DAW_PRIV 0x00000100 #define DAW_IO 0x00000200 #define DAW_SHIFT 0x00000400 #define DAW_LOCK 0x00000800 #define DAW_STACK 0x00001000 #define DAW_NOESP 0x00002000 #define DAW_RARE 0x00004000 #define DAW_NONCLASS 0x00008000 #define DAW_INTERRUPT 0x00010000
#define DAF_NOCOND 0x00000000 #define DAF_TRUE 0x00000001 #define DAF_FALSE 0x00000002 #define DAF_ANYCOND 0x00000003
typedef struct t_disasm { ulong hilitereg; int hiregindex; int hiliteindex; ulong ip; ulong size; ulong cmdtype; ulong exttype; ulong prefixes; ulong nprefix; ulong memfixup; ulong immfixup; int errors; int warnings; ulong uses; ulong modifies; int condition; ulong jmpaddr; ulong memconst; ulong stackinc; t_operand op[NOPERAND]; wchar_t dump[TEXTLEN]; wchar_t result[TEXTLEN]; uchar mask[TEXTLEN]; int maskvalid; wchar_t comment[TEXTLEN]; } t_disasm;
typedef struct t_opinfo { ulong features; ulong arg; int opsize; int reg; int seg; uchar scale[NREG]; ulong opconst; } t_opinfo;
typedef struct t_cmdinfo { ulong ip; ulong size; ulong cmdtype; ulong prefixes; ulong nprefix; ulong memfixup; ulong immfixup; int errors; ulong jmpaddr; ulong stackinc; t_opinfo op[NOPERAND]; } t_cmdinfo;
typedef struct t_emu { ulong operand[NOPERAND]; ulong opsize; ulong memaddr; ulong memsize; ulong memdata; } t_emu;
typedef void TRACEFUNC(ulong *,ulong *,t_predict *,t_disasm *); typedef void __cdecl EMUFUNC(t_emu *,t_reg *);
typedef struct t_bincmd { wchar_t *name; ulong cmdtype; ulong exttype; ulong length; ulong mask; ulong code; ulong postbyte; ulong arg[NOPERAND]; TRACEFUNC *trace; EMUFUNC *emu; } t_bincmd;
#define AMF_SAMEORDER 0x01 #define AMF_ANYSEG 0x02 #define AMF_POSTBYTE 0x04 #define AMF_IMPRECISE 0x08 #define AMF_ANYSIZE 0x10 #define AMF_NOSMALL 0x20 #define AMF_UNDOC 0x40 #define AMF_NEWCMD 0x80
#define AMP_REGISTER 0x01 #define AMP_MEMORY 0x02 #define AMP_CONST 0x04 #define AMP_IMPRECISE 0x08 #define AMP_ANYMEM 0x10 #define AMP_ANYOP 0x20
typedef struct t_modop { uchar features; uchar reg; uchar scale[NPSEUDO]; ulong opconst; } t_modop;
typedef struct t_asmmod { uchar code[MAXCMDSIZE]; uchar mask[MAXCMDSIZE]; ulong prefixes; uchar ncode; uchar features; uchar postbyte; uchar noperand; t_modop op[NOPERAND]; } t_asmmod;
typedef struct t_asmlist { t_asmmod *pasm; int length; wchar_t comment[TEXTLEN]; } t_asmlist;
#define DA_TEXT 0x00000001 #define DA_HILITE 0x00000002 #define DA_OPCOMM 0x00000004 #define DA_DUMP 0x00000008 #define DA_MEMORY 0x00000010 #define DA_NOIMPORT 0x00000020 #define DA_RTLOGMEM 0x00000040 #define DA_NOSTACKP 0x00000080 #define DA_STEPINTO 0x00000100 #define DA_SHOWARG 0x00000200 #define DA_NOPSEUDO 0x00000400 #define DA_FORHELP 0x00000800
#define USEDECODE ((uchar *)1)
stdapi (int) Byteregtodwordreg(int bytereg); stdapi (int) Printfloat4(wchar_t *s,float f); stdapi (int) Printfloat8(wchar_t *s,double d); stdapi (int) Printfloat10(wchar_t *s,long double ext); stdapi (int) Printmmx(wchar_t *s,uchar *data); stdapi (int) Commentcharacter(wchar_t *s,int c,int mode); stdapi (int) Nameoffloat(wchar_t *s,uchar *data,ulong size); stdapi (ulong) Disasm(uchar *cmd,ulong cmdsize,ulong ip,uchar *dec, t_disasm *da,int mode,t_reg *reg, t_predict *predict); stdapi (ulong) Cmdinfo(uchar *cmd,ulong cmdsize,ulong cmdip, t_cmdinfo *ci,int cmdmode,t_reg *cmdreg); stdapi (ulong) Disassembleforward(uchar *copy,ulong base,ulong size, ulong ip,ulong n,uchar *decode); stdapi (ulong) Disassembleback(uchar *copy,ulong base,ulong size, ulong ip,ulong n,uchar *decode); stdapi (int) Checkcondition(int code,ulong flags); stdapi (ulong) Setcondition(int code,ulong flags);
#define AM_ALLOWBAD 0x00000001 #define AM_IMPRECISE 0x00000002 #define AM_MULTI 0x00000004
#define AM_SEARCH AM_IMPRECISE
stdapi (int) Assembleallforms(wchar_t *src,ulong ip,t_asmmod *model, int maxmodel,int mode,wchar_t *errtxt); stdapi (ulong) Assemble(wchar_t *src,ulong ip,uchar *buf,ulong nbuf,int mode, wchar_t *errtxt);
#define N_CMDTYPE 0x0000001F #define N_CMD 0x00000000 #define N_JMP 0x00000001 #define N_JMC 0x00000002 #define N_CALL 0x00000003 #define N_RET 0x00000004 #define N_SWITCH 0x00000005 #define N_PREFIX 0x00000006 #define N_DATA 0x0000001E #define N_BAD 0x0000001F #define N_POPMASK 0x00000F00 #define N_POP0 0x00000000 #define N_POP1 0x00000100 #define N_POP2 0x00000200 #define N_POP3 0x00000300 #define N_POPX 0x00000F00 #define N_PUSHMASK 0x0000F000 #define N_PUSH0 0x00000000 #define N_PUSH1 0x00001000 #define N_PUSH2 0x00002000 #define N_PUSHX 0x0000F000
#define A_ARGMASK 0x000000FF #define A_NONE 0x00000000 #define A_OFFSET 0x00000001 #define A_BYTEOFFS 0x00000002 #define A_METHOD 0x00000003 #define A_SIGNATURE 0x00000004 #define A_TYPE 0x00000005 #define A_FIELD 0x00000006 #define A_STRING 0x00000007 #define A_TOKEN 0x00000008 #define A_INDEX1 0x00000009 #define A_INDEX2 0x0000000A #define A_SWCOUNT 0x0000000B #define A_INT1S 0x0000000C #define A_INT4 0x0000000D #define A_INT8 0x0000000E #define A_FLOAT4 0x0000000F #define A_FLOAT8 0x00000010 #define A_NOLIST 0x00000011 #define A_ALIGN 0x00000012
typedef struct t_netasm { ulong ip; ulong size; ulong cmdtype; ulong cmdsize; ulong opsize; ulong nswitch; ulong jmpaddr; ulong descriptor; ulong dataaddr; int errors; ulong optype; wchar_t optext[TEXTLEN]; wchar_t dump[TEXTLEN]; wchar_t result[TEXTLEN]; wchar_t comment[TEXTLEN]; } t_netasm;
stdapi (ulong) Ndisasm(uchar *cmd,ulong size,ulong ip,t_netasm *da, int mode,t_module *pmod);
#define MAXARG 256
#define NGUESS 7
#define AA_MANUAL 0 #define AA_MAINONLY 1 #define AA_NONSYS 2 #define AA_ALL 3
#define AO_ISFORMATA 0x01 #define AO_SIGFORMATA 0x02 #define AO_ISFORMATW 0x04 #define AO_SIGFORMATW 0x08 #define AO_NOTFORMAT 0x10 #define AO_ISCOUNT 0x20 #define AO_NOTCOUNT 0x40
typedef struct t_procdata { ulong addr; ulong size; ulong type; ulong retsize; ulong localsize; ulong savedebp; ulong features; char generic[12]; int narg; int nguess; int npush; int usedarg; uchar preserved; uchar argopt[NGUESS]; } t_procdata;
typedef struct t_argnest { ulong addr0; ulong addr1; ulong type; ulong aprev; } t_argnest;
#define NLOOPVAR 4
typedef struct t_loopnest { ulong addr0; ulong addr1; ulong type; ulong aprev; ulong eoffs; struct { uchar type; long espoffset; long increment; } loopvar[NLOOPVAR]; } t_loopnest;
stdapi (ulong) Getpackednetint(uchar *code,ulong size,ulong *value); stdapi (void) Removeanalysis(ulong base,ulong size,int keephittrace); stdapi (int) Maybecommand(ulong addr,int requireanalysis);
#define SF_FMUNREL 0x00000001 #define SF_BPUNREL 0x00000002 #define SF_VIRTUAL 0x00000004
typedef struct t_sframe { ulong eip; ulong esp; ulong ebp; int firstcall; HANDLE thread; CONTEXT context; int contextvalid; ulong status; ulong oldeip; ulong oldesp; ulong oldebp; ulong retpos; ulong procaddr; #ifdef STACKFRAME64 STACKFRAME64 sf; #else uchar dummy[264]; #endif } t_sframe;
stdapi (ulong) Isretaddr(ulong retaddr,ulong *procaddr); stdapi (int) Findretaddrdata(t_sframe *pf,ulong base,ulong size);
#define NARG 24
#define ADEC_VALID 0x00000001 #define ADEC_PREDICTED 0x00000002 #define ADEC_CHGNAME 0x00000004 #define ADEC_MARK 0x00000008
#define ARG_POINTER 0x01 #define ARG_BASE 0x06 #define ARG_TYPE 0x00 #define ARG_STRUCT 0x02 #define ARG_DIRECT 0x04 #define ARG_OUT 0x08 #define ARG_MARK 0x10 #define ARG_ELLIPSYS 0x20 #define ARG_VALID 0x40
#define ARG_TYPEMASK (ARG_POINTER|ARG_BASE)
#define ARG_PTYPE (ARG_POINTER|ARG_TYPE) #define ARG_PSTRUCT (ARG_POINTER|ARG_STRUCT)
#define FN_C 0x00000001 #define FN_PASCAL 0x00000002 #define FN_NORETURN 0x00000004 #define FN_VARARG 0x00000008 #define FN_EAX 0x00000100 #define FN_ECX 0x00000200 #define FN_EDX 0x00000400 #define FN_EBX 0x00000800 #define FN_ESP 0x00001000 #define FN_EBP 0x00002000 #define FN_ESI 0x00004000 #define FN_EDI 0x00008000 #define FN_USES_EAX 0x00010000 #define FN_USES_ECX 0x00020000 #define FN_USES_EDX 0x00040000 #define FN_USES_EBX 0x00080000 #define FN_USES_ESP 0x00100000 #define FN_USES_EBP 0x00200000 #define FN_USES_ESI 0x00400000 #define FN_USES_EDI 0x00800000
#define FN_FUNCTION 0 #define FN_STDFUNC (FN_PASCAL|FN_EBX|FN_EBP|FN_ESI|FN_EDI) #define FN_STDC (FN_C|FN_EBX|FN_EBP|FN_ESI|FN_EDI)
typedef struct t_argdec { ulong mode; ulong value; ulong pushaddr; wchar_t prtype[SHORTNAME]; wchar_t name[TEXTLEN]; wchar_t text[TEXTLEN]; } t_argdec;
typedef struct t_strdec { ulong size; ulong addr; ulong value; uchar valuevalid; uchar dec; uchar decsize; uchar reserved; wchar_t prtype[SHORTNAME]; wchar_t name[TEXTLEN]; wchar_t text[TEXTLEN]; } t_strdec;
typedef struct t_rawdata { ulong size; ulong hasmask; ulong features; } t_rawdata;
typedef struct t_argloc { ulong fntype; int retfeatures; int retsize; wchar_t rettype[SHORTNAME]; int argvalid; struct { int features; int size; wchar_t name[TEXTLEN]; wchar_t type[SHORTNAME]; } arg[NARG]; } t_argloc;
stdapi (int) Getconstantbyname(wchar_t *name,ulong *value); stdapi (int) Getconstantbyvalue(wchar_t *groupname, ulong value,wchar_t *name); stdapi (int) Decodetype(ulong data,wchar_t *type,wchar_t *text,int ntext); stdapi (int) Fillcombowithgroup(HWND hw,wchar_t *groupname, int sortbyname,ulong select); stdapi (int) Fillcombowithstruct(HWND hw,wchar_t *prefix,wchar_t *select); stdapi (t_rawdata *) Getrawdata(wchar_t *name); stdapi (int) Substitutehkeyprefix(wchar_t *key); stdapi (int) Decodeknownbyname(wchar_t *name,t_procdata *pd, t_argdec adec[NARG],wchar_t *rettype,int nexp); stdapi (int) Decodeknownbyaddr(ulong addr,t_procdata *pd, t_argdec adec[NARG],wchar_t *rettype,wchar_t *name, int nexp,int follow); stdapi (int) Isnoreturn(ulong addr); stdapi (int) Decodeargument(t_module *pmod,wchar_t *prtype,void *data, int ndata,wchar_t *text,int ntext,int *nontriv); stdapi (int) Getstructureitemcount(wchar_t *name,ulong *size); stdapi (int) Findstructureitembyoffset(wchar_t *name,ulong offset); stdapi (int) Decodestructure(wchar_t *name,ulong addr,int item0, t_strdec *str,int nstr); stdapi (ulong) Getstructureitemvalue(uchar *code,ulong ncode, wchar_t *name,wchar_t *itemname,void *value,ulong nvalue);
#define NEXPR 16
#define EMOD_CHKEXTRA 0x00000001 #define EMOD_NOVALUE 0x00000002 #define EMOD_NOMEMORY 0x00000004 #define EMOD_MULTI 0x00000008
#define EXPR_TYPEMASK 0x0F #define EXPR_INVALID 0x00 #define EXPR_BYTE 0x01 #define EXPR_WORD 0x02 #define EXPR_DWORD 0x03 #define EXPR_FLOAT4 0x04 #define EXPR_FLOAT8 0x05 #define EXPR_FLOAT10 0x06 #define EXPR_SEG 0x07 #define EXPR_ASCII 0x08 #define EXPR_UNICODE 0x09 #define EXPR_TEXT 0x0A #define EXPR_REG 0x10 #define EXPR_SIGNED 0x20
#define EXPR_SIGDWORD (EXPR_DWORD|EXPR_SIGNED)
typedef struct t_result { int lvaltype; ulong lvaladdr; int datatype; int repcount; union { uchar data[10]; ulong u; long l; long double f; }; wchar_t value[TEXTLEN]; } t_result;
typedef struct t_watch { ulong addr; ulong size; ulong type; wchar_t expr[TEXTLEN]; } t_watch;
stdapi (int) Cexpression(wchar_t *expression,uchar *cexpr,int nexpr, int *explen,wchar_t *err,ulong mode); stdapi (int) Exprcount(uchar *cexpr); stdapi (int) Eexpression(t_result *result,wchar_t *expl,uchar *cexpr, int index,uchar *data,ulong base,ulong size,ulong threadid, ulong a,ulong b,ulong mode); stdapi (int) Expression(t_result *result,wchar_t *expression,uchar *data, ulong base,ulong size,ulong threadid,ulong a,ulong b, ulong mode); stdapi (int) Fastexpression(t_result *result,ulong addr,int type, ulong threadid);
#define DIA_SIZEMASK 0x0000001F #define DIA_BYTE 0x00000001 #define DIA_WORD 0x00000002 #define DIA_DWORD 0x00000004 #define DIA_QWORD 0x00000008 #define DIA_TBYTE 0x0000000A #define DIA_DQWORD 0x00000010 #define DIA_HEXONLY 0x00000020 #define DIA_EXTENDED 0x00000040 #define DIA_DATAVALID 0x00000080 #define DIA_DEFMASK 0x00000F00 #define DIA_DEFHEX 0x00000100 #define DIA_DEFSIG 0x00000200 #define DIA_DEFUNSIG 0x00000300 #define DIA_DEFASC 0x00000400 #define DIA_DEFUNI 0x00000500 #define DIA_DEFCODE 0x00000600 #define DIA_DEFFLOAT 0x00000700 #define DIA_ISSEARCH 0x00001000 #define DIA_ASKCASE 0x00002000 #define DIA_SEARCHDIR 0x00004000 #define DIA_HISTORY 0x00008000 #define DIA_SELMASK 0x000F0000 #define DIA_SEL0 0x00000000 #define DIA_SEL4 0x00040000 #define DIA_SEL8 0x00080000 #define DIA_SEL12 0x000C0000 #define DIA_SEL14 0x000E0000 #define DIA_JMPMODE 0x00300000 #define DIA_JMPFROM 0x00000000 #define DIA_JMPTO 0x00100000 #define DIA_SWITCH 0x00200000 #define DIA_JMPGLOB 0x00400000 #define DIA_JMPLOC 0x00000000 #define DIA_UTF8 0x00800000 #define DIA_ABSXYPOS 0x10000000 #define DIA_RESTOREPOS 0x20000000
#define CA_END 0 #define CA_COMMENT 1 #define CA_TEXT 2 #define CA_TEXTC 4 #define CA_TEXTR 5 #define CA_WARN 6 #define CA_WTEXT 7 #define CA_TITLE 8 #define CA_FRAME 9 #define CA_SUNK 10 #define CA_GROUP 11 #define CA_EDIT 12 #define CA_NOEDIT 13 #define CA_EDITHEX 14 #define CA_MULTI 15 #define CA_NOMULTI 16 #define CA_BTN 17 #define CA_DEFBTN 18 #define CA_COMBO 19 #define CA_COMBOFIX 20 #define CA_CEDIT 21 #define CA_CEDITFIX 22 #define CA_CESAV0 32 #define CA_CESAV1 33 #define CA_CESAV2 34 #define CA_CESAV3 35 #define CA_CESAV4 36 #define CA_CESAV5 37 #define CA_CESAV6 38 #define CA_CESAV7 39 #define CA_LIST 48 #define CA_LISTFIX 49 #define CA_CHECK 62 #define CA_CHECKR 63 #define CA_BIT0 64 #define CA_BIT1 65 #define CA_BIT2 66 #define CA_BIT3 67 #define CA_BIT4 68 #define CA_BIT5 69 #define CA_BIT6 70 #define CA_BIT7 71 #define CA_BIT8 72 #define CA_BIT9 73 #define CA_BIT10 74 #define CA_BIT11 75 #define CA_BIT12 76 #define CA_BIT13 77 #define CA_BIT14 78 #define CA_BIT15 79 #define CA_BIT16 80 #define CA_BIT17 81 #define CA_BIT18 82 #define CA_BIT19 83 #define CA_BIT20 84 #define CA_BIT21 85 #define CA_BIT22 86 #define CA_BIT23 87 #define CA_BIT24 88 #define CA_BIT25 89 #define CA_BIT26 90 #define CA_BIT27 91 #define CA_BIT28 92 #define CA_BIT29 93 #define CA_BIT30 94 #define CA_BIT31 95 #define CA_RADIO0 96 #define CA_RADIO1 97 #define CA_RADIO2 98 #define CA_RADIO3 99 #define CA_RADIO4 100 #define CA_RADIO5 101 #define CA_RADIO6 102 #define CA_RADIO7 103 #define CA_RADIO8 104 #define CA_RADIO9 105 #define CA_RADIO10 106 #define CA_RADIO11 107 #define CA_RADIO12 108 #define CA_RADIO13 109 #define CA_RADIO14 110 #define CA_RADIO15 111 #define CA_CUSTOM 124 #define CA_CUSTSF 125
#define CA_FILE 129 #define CA_BROWSE 130 #define CA_BRDIR 131 #define CA_LANGS 132 #define CA_FONTS 133 #define CA_FHTOP 134 #define CA_FHBOT 135 #define CA_SCHEMES 136 #define CA_HILITE 137 #define CA_HILITE1 138
#define DFM_SYSTEM 0 #define DFM_PARENT 1 #define DFM_FIXED 2 #define DFM_FIXALL 3
#define HEXLEN 1024
#define NSEARCHCMD 128
typedef struct t_control { ulong type; int id; int x; int y; int dx; int dy; int *var; wchar_t *text; wchar_t *help; int oldvar; } t_control;
typedef struct t_dialog { t_control *controls; wchar_t *title; int focus; int item; ulong u; uchar data[16]; ulong addr0; ulong addr1; int letter; int x; int y; int fi; int mode; int cesav[8]; HFONT fixfont; int isfullunicode; int fixdx; int fixdy; HWND htooltip; HWND hwwarn; int initdone; } t_dialog;
typedef struct t_hexstr { ulong n; ulong nmax; uchar data[HEXLEN]; uchar mask[HEXLEN]; } t_hexstr;
typedef int BROWSECODEFUNC(int,void *,ulong *,wchar_t *);
stdapi (t_control *) Findcontrol(HWND hw); stdapi (int) Defaultactions(HWND hparent,t_control *pctr, WPARAM wp,LPARAM lp); stdapi (void) Addstringtocombolist(HWND hc,wchar_t *s); stdapi (int) Preparedialog(HWND hw,t_dialog *pdlg); stdapi (int) Endotdialog(HWND hw,int result); stdapi (int) Getregister(HWND hparent,int reg,ulong *data,int letter, int x,int y,int fi,int mode); stdapi (int) Getinteger(HWND hparent,wchar_t *title,ulong *data,int letter, int x,int y,int fi,int mode); stdapi (int) Getdword(HWND hparent,wchar_t *title,ulong *data,int letter, int x,int y,int fi,int mode); stdapi (int) Getlasterrorcode(HWND hparent,wchar_t *title,ulong *data, int letter,int x,int y,int fi); stdapi (int) Getaddressrange(HWND hparent,wchar_t *title, ulong *rmin,ulong *rmax,int x,int y,int fi,int mode); stdapi (int) Getexceptionrange(HWND hparent,wchar_t *title, ulong *rmin,ulong *rmax,int x,int y,int fi); stdapi (int) Getstructuretype(HWND hparent,wchar_t *title,wchar_t *text, wchar_t *strname,int x,int y,int fi); stdapi (int) Getfpureg(HWND hparent,int reg,void *data,int letter, int x,int y,int fi); stdapi (int) Get3dnow(HWND hparent,wchar_t *title,void *data,int letter, int x,int y,int fi,int mode); stdapi (int) Getfloat(HWND hparent,wchar_t *title,void *data,int letter, int x,int y,int fi,int mode); stdapi (int) Getmmx(HWND hparent,wchar_t *title,void *data,int letter, int x,int y,int fi); stdapi (int) Getsse(HWND hparent,wchar_t *title,void *data,int letter, int x,int y,int fi,int mode); stdapi (int) Getstring(HWND hparent,wchar_t *title,wchar_t *s,int length, int savetype,int letter,int x,int y,int fi,int mode); stdapi (int) Getdwordexpression(HWND hparent,wchar_t *title,ulong *u, ulong threadid,int savetype,int x,int y,int fi,int mode); stdapi (int) Getgotoexpression(HWND hparent,wchar_t *title,ulong *u, ulong threadid,int savetype,int x,int y,int fi,int mode); stdapi (int) Asmindump(HWND hparent,wchar_t *title,struct t_dump *pd, int letter,int x,int y,int fi,int mode); stdapi (int) Getasmsearchmodel(HWND hparent,wchar_t *title,t_asmmod *model, int nmodel,int x,int y,int fi,int mode); stdapi (int) Getseqsearchmodel(HWND hparent,wchar_t *title,t_asmmod *model, int nmodel,int x,int y,int fi,int mode); stdapi (int) Binaryedit(HWND hparent,wchar_t *title,t_hexstr *hstr, int letter,int x,int y,int fi,int mode); stdapi (int) Getpredefinedtypebyindex(int fnindex,wchar_t *type); stdapi (int) Getindexbypredefinedtype(wchar_t *type); stdapi (int) Condbreakpoint(HWND hparent,ulong *addr,int naddr, wchar_t *title,int x,int y,int fi); stdapi (int) Condlogbreakpoint(HWND hparent,ulong *addr,int naddr, int fnindex,wchar_t *title,int x,int y,int fi); stdapi (int) Membreakpoint(HWND hparent,ulong addr,ulong size, int x,int y,int fi,int mode); stdapi (int) Memlogbreakpoint(HWND hparent,ulong addr,ulong size, int x,int y,int fi,int mode); stdapi (int) Hardbreakpoint(HWND hparent,ulong addr, int x,int y,int fi,int mode); stdapi (int) Hardlogbreakpoint(HWND hparent,ulong addr,int fnindex, int x,int y,int fi,int mode); stdapi (void) Setrtcond(HWND hparent,int x,int y,int fi); stdapi (void) Setrtprot(HWND hparent,int x,int y,int fi); stdapi (ulong) Browsecodelocations(HWND hparent,wchar_t *title, BROWSECODEFUNC *bccallback,void *data); stdapi (int) Fillcombowithcodepages(HWND hw,int select);
#define OPT_TITLE 9001 #define OPT_1 9011 #define OPT_2 9012 #define OPT_3 9013 #define OPT_4 9014 #define OPT_5 9015 #define OPT_6 9016 #define OPT_7 9017 #define OPT_8 9018 #define OPT_9 9019 #define OPT_10 9020 #define OPT_11 9021 #define OPT_12 9022 #define OPT_13 9023 #define OPT_14 9024 #define OPT_15 9025 #define OPT_16 9026 #define OPT_17 9027 #define OPT_18 9028 #define OPT_19 9029 #define OPT_20 9030 #define OPT_21 9031 #define OPT_22 9032 #define OPT_23 9033 #define OPT_24 9034 #define OPT_W1 9101 #define OPT_W2 9102 #define OPT_W3 9103 #define OPT_W4 9104 #define OPT_W5 9105 #define OPT_W6 9106 #define OPT_W7 9107 #define OPT_W8 9108 #define OPT_W9 9109 #define OPT_W10 9110 #define OPT_W11 9111 #define OPT_W12 9112 #define OPT_S1 9121 #define OPT_S2 9122 #define OPT_S3 9123 #define OPT_S4 9124 #define OPT_S5 9125 #define OPT_S6 9126 #define OPT_S7 9127 #define OPT_S8 9128 #define OPT_S9 9129 #define OPT_S10 9130 #define OPT_S11 9131 #define OPT_S12 9132 #define OPT_X1 9141 #define OPT_X2 9142 #define OPT_X3 9143 #define OPT_X4 9144 #define OPT_X5 9145 #define OPT_X6 9146 #define OPT_X7 9147 #define OPT_X8 9148 #define OPT_X9 9149 #define OPT_X10 9150 #define OPT_X11 9151 #define OPT_X12 9152
#define OPT_CUSTMIN 9500 #define OPT_CUSTMAX 9999
#define COMM_USER 0x00000001 #define COMM_MARK 0x00000002 #define COMM_PROC 0x00000004 #define COMM_ALL 0xFFFFFFFF
stdapi (int) Stringtotext(wchar_t *data,int ndata,wchar_t *text,int ntext, int stopatzero); stdapi (int) Isstring(ulong addr,int isstatic,wchar_t *symb,int nsymb); stdapi (int) Squeezename(wchar_t *dest,int ndest,wchar_t *src,int nsrc); stdapi (void) Uncapitalize(wchar_t *s); stdapi (int) Decoderelativeoffset(ulong addr,int addrmode, wchar_t *symb,int nsymb); stdapi (int) Decodeaddress(ulong addr,ulong amod,int mode, wchar_t *symb,int nsymb,wchar_t *comment); stdapi (int) Decodearglocal(ulong ip,ulong offs,ulong datasize, wchar_t *name,int len); stdapi (int) Getanalysercomment(struct t_module *pmod,ulong addr, wchar_t *comment,int len); stdapi (int) Getswitchcomment(ulong addr,wchar_t *comment,int len); stdapi (int) Getloopcomment(struct t_module *pmod,ulong addr,int level, wchar_t *comment,int len); stdapi (int) Getproccomment(ulong addr,ulong acall, wchar_t *comment,int len,int argonly); stdapi (int) Commentaddress(ulong addr,int typelist, wchar_t *comment,int len);
stdapi (void) Redrawlist(void); varapi (void) Addtolist(ulong addr,int color,wchar_t *format,...);
#define DU_STACK 0x80000000 #define DU_NOSMALL 0x40000000 #define DU_MODEMASK 0x3C000000 #define DU_SMALL 0x20000000 #define DU_FIXADDR 0x10000000 #define DU_BACKUP 0x08000000 #define DU_USEDEC 0x04000000 #define DU_COMMMASK 0x03000000 #define DU_COMMENT 0x00000000 #define DU_SOURCE 0x01000000 #define DU_DISCARD 0x00800000 #define DU_PROFILE 0x00400000 #define DU_TYPEMASK 0x003F0000 #define DU_HEXTEXT 0x00010000 #define DU_HEXUNI 0x00020000 #define DU_TEXT 0x00030000 #define DU_UNICODE 0x00040000 #define DU_INT 0x00050000 #define DU_UINT 0x00060000 #define DU_IHEX 0x00070000 #define DU_FLOAT 0x00080000 #define DU_ADDR 0x00090000 #define DU_ADRASC 0x000A0000 #define DU_ADRUNI 0x000B0000 #define DU_DISASM 0x000C0000 #define DU_DECODE 0x000D0000 #define DU_COUNTMASK 0x0000FF00 #define DU_SIZEMASK 0x000000FF
#define DU_MAINPART (DU_TYPEMASK|DU_COUNTMASK|DU_SIZEMASK)
#define DUMP_HEXA8 0x00010801 #define DUMP_HEXA16 0x00011001 #define DUMP_HEXU8 0x00020801 #define DUMP_HEXU16 0x00021001 #define DUMP_ASC32 0x00032001 #define DUMP_ASC64 0x00034001 #define DUMP_UNI16 0x00041002 #define DUMP_UNI32 0x00042002 #define DUMP_UNI64 0x00044002 #define DUMP_INT16 0x00050802 #define DUMP_INT16S 0x00050402 #define DUMP_INT32 0x00050404 #define DUMP_INT32S 0x00050204 #define DUMP_UINT16 0x00060802 #define DUMP_UINT16S 0x00060402 #define DUMP_UINT32 0x00060404 #define DUMP_UINT32S 0x00060204 #define DUMP_IHEX16 0x00070802 #define DUMP_IHEX16S 0x00070402 #define DUMP_IHEX32 0x00070404 #define DUMP_IHEX32S 0x00070204 #define DUMP_FLOAT32 0x00080404 #define DUMP_FLOAT32S 0x00080104 #define DUMP_FLOAT64 0x00080208 #define DUMP_FLOAT64S 0x00080108 #define DUMP_FLOAT80 0x0008010A #define DUMP_ADDR 0x00090104 #define DUMP_ADDRASC 0x000A0104 #define DUMP_ADDRUNI 0x000B0104 #define DUMP_DISASM 0x000C0110 #define DUMP_DECODE 0x000D0110
#define DMT_FIXTYPE 0x00000001 #define DMT_STRUCT 0x00000002 #define DMT_CPUMASK 0x00070000 #define DMT_CPUDASM 0x00010000 #define DMT_CPUDUMP 0x00020000 #define DMT_CPUSTACK 0x00040000
#define SD_REALIGN 0x01 #define SD_CENTERY 0x02
#define SCH_SEL0 0x01 #define SCH_SEL1 0x02
#define CDS_TITLES 0x00000001 #define CDS_NOGRAPH 0x00000002
typedef void DUMPSELFUNC(struct t_dump *,int);
typedef struct t_dump { ulong base; ulong size; ulong dumptype; ulong menutype; ulong itemwidth; ulong threadid; t_table table; ulong addr; ulong sel0; ulong sel1; ulong selstart; ulong selend; uchar *filecopy; wchar_t path[MAXPATH]; uchar *backup; wchar_t strname[SHORTNAME]; uchar *decode; wchar_t bkpath[MAXPATH]; int relreg; ulong reladdr; ulong hilitereg; int hiregindex; ulong graylimit; DUMPSELFUNC *dumpselfunc; } t_dump;
stdapi (void) Setdumptype(t_dump *pd,ulong dumptype); stdapi (int) Ensurememorybackup(t_memory *pmem,int makebackup); stdapi (void) Backupusercode(struct t_module *pm,int force); stdapi (HGLOBAL) Copydumpselection(t_dump *pd,int mode); stdapi (ulong) Dumpback(t_dump *pd,ulong addr,int n); stdapi (ulong) Dumpforward(t_dump *pd,ulong addr,int n); stdapi (ulong) Scrolldumpwindow(t_dump *pd,ulong addr,int mode); stdapi (int) Alignselection(t_dump *pd,ulong *sel0,ulong *sel1); stdapi (int) Getproclimits(ulong addr,ulong *amin,ulong *amax); stdapi (int) Getextproclimits(ulong addr,ulong *amin,ulong *amax); stdapi (int) Newdumpselection(t_dump *pd,ulong addr,ulong size); stdapi (t_dump *) Findfiledump(wchar_t *path); stdapi (HWND) Createdumpwindow(wchar_t *title,ulong base,ulong size, wchar_t *path,ulong dumptype,ulong sel0,ulong sel1, wchar_t *strname); stdapi (HWND) Embeddumpwindow(HWND hw,t_dump *pd,ulong dumptype);
#define SL_UNDEF 0 #define SL_DISASM 1 #define SL_SEQASM 2 #define SL_STRINGS 3 #define SL_GUIDS 4 #define SL_COMMENTS 5 #define SL_SWITCHES 6 #define SL_FLOATS 7 #define SL_CALLS 8 #define SL_MOD 9
#define SEARCH_NONE 0 #define SEARCH_CMD 1 #define SEARCH_SEQ 2 #define SEARCH_BINARY 3 #define SEARCH_CONST 4 #define SEARCH_MOD 5
#define SDIR_GLOBAL 0 #define SDIR_FORWARD 1 #define SDIR_BACKWARD 2
#define SRCH_NEW 0 #define SRCH_NEWMEM 1 #define SRCH_SAMEDIR 2 #define SRCH_OPPDIR 3 #define SRCH_MEM 4
#define CSEQ_IGNORECMD 0x00000001 #define CSEQ_ALLOWJMP 0x00000002
typedef struct t_found { ulong addr; ulong size; } t_found;
typedef struct t_search { ulong addr; ulong size; ulong type; ulong data; ulong seqlen; } t_search;
stdapi (ulong) Comparecommand(uchar *cmd,ulong cmdsize,ulong cmdip, t_asmmod *model,int nmodel,int *pa,int *pb,t_disasm *da); stdapi (ulong) Comparesequence(uchar *cmd,ulong cmdsize,ulong cmdip, uchar *decode,t_asmmod *model,int nmodel,int mode, int *pa,int *pb,t_disasm *da,ulong *amatch,int namatch);
#define PATCHSIZE 512
typedef struct t_patch { ulong addr; ulong size; ulong type; uchar orig[PATCHSIZE]; uchar mod[PATCHSIZE]; } t_patch;
#define BA_PERMANENT 0x00000001 #define BA_PLUGIN 0x80000000
typedef struct t_bpoint { ulong addr; ulong size; ulong type; ushort fnindex; uchar cmd; uchar patch; ulong limit; ulong count; ulong actions; } t_bpoint;
typedef struct t_bpmem { ulong addr; ulong size; ulong type; ulong limit; ulong count; } t_bpmem;
typedef struct t_bppage { ulong base; ulong size; ulong type; ulong oldaccess; ulong newaccess; } t_bppage;
typedef struct t_bphard { ulong index; ulong dummy; ulong type; ulong addr; ulong size; int fnindex; ulong limit; ulong count; ulong actions; ulong modbase; wchar_t path[MAXPATH]; } t_bphard;
stdapi (int) Removeint3breakpoint(ulong addr,ulong type); stdapi (int) Setint3breakpoint(ulong addr,ulong type,int fnindex, int limit,int count,ulong actions, wchar_t *condition,wchar_t *expression,wchar_t *exprtype); stdapi (int) Enableint3breakpoint(ulong addr,int enable); stdapi (int) Confirmint3breakpoint(ulong addr); stdapi (int) Confirmhardwarebreakpoint(ulong addr); stdapi (int) Confirmint3breakpointlist(ulong *addr,int naddr); stdapi (void) Wipebreakpointrange(ulong addr0,ulong addr1); stdapi (int) Removemembreakpoint(ulong addr); stdapi (int) Setmembreakpoint(ulong addr,ulong size,ulong type, int limit,int count,wchar_t *condition, wchar_t *expression,wchar_t *exprtype); stdapi (int) Enablemembreakpoint(ulong addr,int enable); stdapi (int) Removehardbreakpoint(int index); stdapi (int) Sethardbreakpoint(int index,ulong size,ulong type,int fnindex, ulong addr,int limit,int count,ulong actions, wchar_t *condition,wchar_t *expression,wchar_t *exprtype); stdapi (int) Enablehardbreakpoint(int index,int enable); stdapi (int) Findfreehardbreakslot(ulong type);
#define CPU_ASMHIST 0x00000001 #define CPU_ASMCENTER 0x00000004 #define CPU_ASMFOCUS 0x00000008 #define CPU_DUMPHIST 0x00000010 #define CPU_DUMPFIRST 0x00000020 #define CPU_DUMPFOCUS 0x00000080 #define CPU_STACKFOCUS 0x00000100 #define CPU_STACKCTR 0x00000200 #define CPU_REGAUTO 0x00001000 #define CPU_NOCREATE 0x00002000 #define CPU_REDRAW 0x00004000 #define CPU_NOFOCUS 0x00008000 #define CPU_RUNTRACE 0x00010000 #define CPU_NOTRACE 0x00020000
#define ASR_OFF 0 #define ASR_EVENT 1 #define ASR_ALWAYS 2
#define NHISTORY 1024
typedef struct t_histrec { ulong threadid; ulong dumptype; ulong addr; ulong sel0; ulong sel1; } t_histrec;
typedef struct t_history { t_histrec h[NHISTORY]; int holdest; int hnext; int hcurr; } t_history;
stdapi (void) Redrawcpudisasm(void); stdapi (void) Redrawcpureg(void); stdapi (ulong) Getcputhreadid(void); stdapi (int) Getcpuruntracebackstep(void); stdapi (t_dump *) Getcpudisasmdump(void); stdapi (ulong) Getcpudisasmselection(void); stdapi (t_table *) Getcpudisasmtable(void); stdapi (void) Addtohistory(t_history *ph,ulong threadid,ulong dumptype, ulong addr,ulong sel0,ulong sel1); stdapi (int) Walkhistory(t_history *ph,int dir,ulong *threadid, ulong *dumptype,ulong *addr,ulong *sel0,ulong *sel1); stdapi (int) Checkhistory(t_history *ph,int dir,int *isnewest); stdapi (void) Setcpu(ulong threadid,ulong asmaddr,ulong dumpaddr, ulong selsize,ulong stackaddr,int mode);
#define NIGNORE 32 #define NRTPROT 64
#define FP_SYSBP 0 #define FP_TLS 1 #define FP_ENTRY 2 #define FP_WINMAIN 3 #define FP_NONE 4
#define AP_SYSBP 0 #define AP_CODE 1 #define AP_NONE 2
#define DP_LOADDLL 0 #define DP_ENTRY 1 #define DP_LOADED 2 #define DP_NONE 3
#define DR6_SET 0xFFFF0FF0 #define DR6_TRAP 0x00004000 #define DR6_BD 0x00002000 #define DR6_BHIT 0x0000000F #define DR6_B3 0x00000008 #define DR6_B2 0x00000004 #define DR6_B1 0x00000002 #define DR6_B0 0x00000001
#define DR7_GD 0x00002000 #define DR7_SET 0x00000400 #define DR7_EXACT 0x00000100 #define DR7_G3 0x00000080 #define DR7_L3 0x00000040 #define DR7_G2 0x00000020 #define DR7_L2 0x00000010 #define DR7_G1 0x00000008 #define DR7_L1 0x00000004 #define DR7_G0 0x00000002 #define DR7_L0 0x00000001
#define DR7_IMPORTANT (DR7_G3|DR7_L3|DR7_G2|DR7_L2|DR7_G1|DR7_L1|DR7_G0|DR7_L0)
#define NCOND 4 #define NRANGE 2 #define NCMD 2 #define NMODLIST 24
#define RTC_COND1 0x00000001 #define RTC_COND2 0x00000002 #define RTC_COND3 0x00000004 #define RTC_COND4 0x00000008 #define RTC_CMD1 0x00000010 #define RTC_CMD2 0x00000020 #define RTC_INRANGE 0x00000100 #define RTC_OUTRANGE 0x00000200 #define RTC_COUNT 0x00000400 #define RTC_MEM1 0x00001000 #define RTC_MEM2 0x00002000 #define RTC_MODCMD 0x00008000
#define RTL_ALL 0 #define RTL_JUMPS 1 #define RTL_CDEST 2 #define RTL_MEM 3
#define HTNC_RUN 0 #define HTNC_PAUSE 1 #define HTNC_TRACE 2
#define SFM_RUNTRACE 0 #define SFM_HITTRACE 1
typedef struct t_rtcond { int options; ulong inrange0; ulong inrange1; ulong outrange0; ulong outrange1; ulong count; ulong currcount; int memaccess[NRANGE]; ulong memrange0[NRANGE]; ulong memrange1[NRANGE]; wchar_t cond[NCOND][TEXTLEN]; wchar_t cmd[NCMD][TEXTLEN]; uchar ccomp[NCOND][TEXTLEN]; int validmodels; t_asmmod model[NCMD][NSEARCHCMD]; int nmodel[NCMD]; } t_rtcond;
typedef struct t_rtprot { int tracelogtype; int memranges; int memaccess[NRANGE]; ulong memrange0[NRANGE]; ulong memrange1[NRANGE]; int rangeactive; t_range range[NRTPROT]; } t_rtprot;
stdapi (void) Suspendallthreads(void); stdapi (void) Resumeallthreads(void); stdapi (int) Pauseprocess(void); stdapi (int) Closeprocess(int confirm); stdapi (int) Detachprocess(void); stdapi (int) Getlasterror(t_thread *pthr,ulong *error,wchar_t *s); stdapi (ulong) Followcall(ulong addr); stdapi (int) Run(t_status status,int pass); stdapi (int) Checkfordebugevent(void); stdapi (int) Addprotocolrange(ulong addr0,ulong addr1); stdapi (int) Getruntrace(int nback,t_reg *preg,uchar *cmd); stdapi (int) Findruntracerecord(ulong addr0,ulong addr1);
#define GUIDSIZE 16
stdapi (int) Getguidname(uchar *data,ulong ndata,wchar_t *name); stdapi (int) Isguid(ulong addr,wchar_t *name,int nname);
typedef struct t_srcline { ulong offset; int nextent; int extent; } t_srcline;
typedef struct t_srcext { ulong amin; ulong amax; } t_srcext;
typedef struct t_source { ulong addr; ulong size; ulong type; wchar_t path[MAXPATH]; int nameoffs; char *text; t_srcline *line; int nline; t_srcext *extent; int maxextent; int nextent; int lastline; int lastoffset; } t_source;
stdapi (t_source *) Findsource(ulong base,wchar_t *path); stdapi (int) Getsourceline(ulong base,wchar_t *path,int line,int skipspaces, wchar_t *text,wchar_t *fname,t_srcext **extent,int *nextent); stdapi (int) Showsourcecode(ulong base,wchar_t *path,int line);
#define AE_NONE 0 #define AE_APP 1 #define AE_SYS 2
typedef struct t_run { t_status status; ulong threadid; ulong tpausing; int wakestep; ulong eip; ulong ecx; ulong restoreint3addr; ulong stepoverdest; int updatebppage; DEBUG_EVENT de; int indebugevent; int netevent; int isappexception; ulong lastexception; int suspended; int suspendonpause; int updatedebugreg; int dregmodified; } t_run;
oddata (t_bincmd) bincmd[];
oddata (wchar_t *) regname[3][NREG]; oddata (wchar_t *) segname[NREG]; oddata (wchar_t *) fpuname[2][NREG]; oddata (wchar_t *) mmxname[NREG]; oddata (wchar_t *) ssename[NREG]; oddata (wchar_t *) crname[NREG]; oddata (wchar_t *) drname[NREG]; oddata (wchar_t *) sizename[17]; oddata (wchar_t *) sizekey[17]; oddata (wchar_t *) sizeatt[17];
oddata (wchar_t) ollyfile[MAXPATH]; oddata (wchar_t) ollydir[MAXPATH]; oddata (wchar_t) systemdir[MAXPATH]; oddata (wchar_t) plugindir[MAXPATH];
oddata (HINSTANCE) hollyinst; oddata (HWND) hwollymain; oddata (HWND) hwclient; oddata (wchar_t) ottable[SHORTNAME]; oddata (ulong) cpufeatures; oddata (int) ischild;
oddata (int) asciicodepage; #ifdef FILE oddata (FILE *) tracefile; #endif oddata (int) restorewinpos;
oddata (t_font) font[NFIXFONTS]; oddata (t_font) sysfont; oddata (t_font) titlefont; oddata (t_font) fixfont; oddata (COLORREF) color[NCOLORS]; oddata (t_scheme) scheme[NSCHEMES]; oddata (t_scheme) hilite[NHILITE];
oddata (wchar_t) executable[MAXPATH]; oddata (wchar_t) arguments[ARGLEN];
oddata (int) netdbg; oddata (int) rundll; oddata (HANDLE) process; oddata (ulong) processid; oddata (ulong) mainthreadid; oddata (t_run) run; oddata (int) skipsystembp;
oddata (ulong) debugbreak; oddata (ulong) dbgbreakpoint; oddata (ulong) kiuserexcept; oddata (ulong) zwcontinue; oddata (ulong) uefilter; oddata (ulong) ntqueryinfo; oddata (ulong) corexemain; oddata (ulong) peblock; oddata (ulong) kusershareddata; oddata (ulong) userspacelimit;
oddata (t_rtcond) rtcond; oddata (t_rtprot) rtprot;
oddata (t_table) list; oddata (t_sorted) premod; oddata (t_table) module; oddata (t_sorted) aqueue; oddata (t_table) thread; oddata (t_table) memory; oddata (t_table) win; oddata (t_table) bpoint; oddata (t_table) bpmem; oddata (t_sorted) bppage; oddata (t_table) bphard; oddata (t_table) watch; oddata (t_table) patch; oddata (t_sorted) procdata; oddata (t_table) source; oddata (t_table) srccode;
#define PN_NEWPROC 1 #define PN_ENDPROC 2 #define PN_NEWTHR 3 #define PN_ENDTHR 4 #define PN_PREMOD 5 #define PN_NEWMOD 6 #define PN_ENDMOD 7 #define PN_STATUS 8 #define PN_REMOVE 16 #define PN_RUN 24
#define PE_IGNORED 0x00000000 #define PE_CONTINUE 0x00000001 #define PE_STEP 0x00000002 #define PE_PAUSE 0x00000004
pentry (int) ODBG2_Pluginquery(int ollydbgversion,ulong *features, wchar_t pluginname[SHORTNAME], wchar_t pluginversion[SHORTNAME]);
pentry (int) ODBG2_Plugininit(void);
pentry( void ) ODBG2_Pluginreset( void );
pentry( int ) ODBG2_Pluginclose( void );
pentry( void ) ODBG2_Plugindestroy( void );
pentry (void) ODBG2_Pluginanalyse(t_module *pmod);
pentry( void ) ODBG2_Pluginmainloop( DEBUG_EVENT *debugevent );
pentry( int ) ODBG2_Pluginexception( t_run *prun , const t_disasm *da , t_thread *pthr,t_reg *preg,wchar_t *message);
pentry( void ) ODBG2_Plugintempbreakpoint( ulong addr , const t_disasm *da,t_thread *pthr,t_reg *preg);
pentry( void ) ODBG2_Pluginnotify( int code , void *data , ulong parm1,ulong parm2);
pentry( int ) ODBG2_Plugindump( t_dump *pd , wchar_t *s , uchar *mask , int n,int *select,ulong addr,int column);
pentry( t_menu * ) ODBG2_Pluginmenu( wchar_t *type );
pentry( t_control * ) ODBG2_Pluginoptions( UINT msg , WPARAM wp , LPARAM lp );
pentry( void ) ODBG2_Pluginsaveudd( t_uddsave *psave , t_module *pmod , int ismainmodule);
pentry( void ) ODBG2_Pluginuddrecord( t_module *pmod , int ismainmodule , ulong tag,ulong size,void *data);
#endif
|