+void Rebase()
+{
+ char dest[65535];
+ char command[65535];
+
+ *dest = 0;
+
+ WIN32_FIND_DATA fd;
+#ifdef _DEBUG
+ HANDLE fh = FindFirstFile("..\\bin\\debug\\lib\\*.so", &fd);
+#else
+ HANDLE fh = FindFirstFile("..\\bin\\release\\lib\\*.so", &fd);
+#endif
+ if(fh == INVALID_HANDLE_VALUE)
+ return;
+
+ do
+ {
+#ifdef _DEBUG
+ strcat(dest, " ..\\bin\\debug\\lib\\");
+#else
+ strcat(dest, " ..\\bin\\release\\lib\\");
+#endif
+ strcat(dest, fd.cFileName);
+ }
+ while (FindNextFile(fh, &fd));
+
+ FindClose(fh);
+
+ sprintf(command, "rebase.exe -v -b 10000000 -c baseaddr_commands.txt %s", dest);
+ printf("%s\n", command);
+ system(command);
+
+#ifdef _DEBUG
+ fh = FindFirstFile("..\\bin\\debug\\modules\\*.so", &fd);
+#else
+ fh = FindFirstFile("..\\bin\\release\\modules\\*.so", &fd);
+#endif
+ if(fh == INVALID_HANDLE_VALUE)
+ return;
+
+ *dest = 0;
+
+ do
+ {
+#ifdef _DEBUG
+ strcat(dest, " ..\\bin\\debug\\modules\\");
+#else
+ strcat(dest, " ..\\bin\\release\\modules\\");
+#endif
+ strcat(dest, fd.cFileName);
+ }
+ while (FindNextFile(fh, &fd));
+
+ sprintf(command, "rebase.exe -v -b 11000000 -c baseaddr_modules.txt %s", dest);
+ printf("%s\n", command);
+ system(command);
+
+ FindClose(fh);
+
+}
+