diff --git a/.gitignore b/.gitignore index 78c9d57..938a211 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Build output /Debug +/Release # visual studio (code) stuff .vs @@ -14,4 +15,5 @@ ecudump *.log # rom dump output -*.bin \ No newline at end of file +*.bin + diff --git a/J2534/J2534.cpp b/J2534/J2534.cpp index d1fc0d0..8611fcf 100644 --- a/J2534/J2534.cpp +++ b/J2534/J2534.cpp @@ -39,7 +39,7 @@ J2534::J2534(void) #elif __APPLE__ strcpy(dllName,"op20pt32.dylib"); #else - strcpy(dllName,"j2354.so"); + strcpy(dllName,"j2354.so"); #endif } @@ -229,7 +229,7 @@ long J2534::LoadJ2534DLL(const char* szDLL) strcpy(libPath,pathPtr); strcat(libPath,"/Contents/Frameworks"); chdir(libPath); // change to this dir so J2534 .dylib can find any other needed dylibs in the same dir - strcat(libPath,"/""); + strcat(libPath,"/"); strcat(libPath,szDLL); CFRelease(appUrlRef); diff --git a/ecudump.vcxproj b/ecudump.vcxproj index 27e9b9c..79431b8 100644 --- a/ecudump.vcxproj +++ b/ecudump.vcxproj @@ -62,6 +62,7 @@ Level3 EditAndContinue + C:\Users\konno\Desktop\rx8\ecu\ecudump\J2534;%(AdditionalIncludeDirectories) $(OutDir)$(ProjectName).exe @@ -78,6 +79,7 @@ Level3 ProgramDatabase + C:\Users\konno\Desktop\rx8\ecu\ecudump\J2534;%(AdditionalIncludeDirectories) $(OutDir)$(ProjectName).exe @@ -89,20 +91,22 @@ - - - - + + + + + - - - - + + + + + diff --git a/ecudump.vcxproj.filters b/ecudump.vcxproj.filters index f620003..f5577ec 100644 --- a/ecudump.vcxproj.filters +++ b/ecudump.vcxproj.filters @@ -1,15 +1,29 @@  - - - - + + Src + + + Src + + + Src + + + Src + + + Src + {80505dd4-3aff-4e9d-b44f-43aaac66b754} + + {2f2a7131-6bb7-4371-b42c-5ef8a6b70870} + @@ -20,9 +34,20 @@ - - - - + + Src + + + Src + + + Src + + + Src + + + Src + \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 2c1c678..3c59fa2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,7 +20,7 @@ limitations under the License. #include #include -#ifdef WIN32 +#if defined(_WIN32) || defined(WIN32) || defined (_WIN64) || defined (WIN64) #include #include #include @@ -211,7 +211,7 @@ int main(int argc, char** argv) } } - dumpFile = fopen(dumpFileName, "wba+"); + dumpFile = fopen(dumpFileName, "ab+"); if(!dumpFile) { LOGE(TAG, "Failed to open dump file %s", strerror(errno)); dumpFile = NULL; @@ -247,8 +247,8 @@ int main(int argc, char** argv) LOGI(TAG, "Unlocked ECU"); LOGI(TAG, "Starting ROM dump, this will take a moment.."); - - time (&dumpStart); + + time (&dumpStart); for(address = 0; address < dumpSize; address+=chunkSize) { if (ecu->readMem(address, chunkSize, &dump)) @@ -265,7 +265,7 @@ int main(int argc, char** argv) fflush(dumpFile); printProgress(dumpSize, dumpSize); - time(&dumpEnd); + time(&dumpEnd); LOGI(TAG, "Successfully dumped ROM to %s Took %.0lf seconds", dumpFileName, difftime(dumpEnd,dumpStart)); cleanup: diff --git a/src/progressbar.cpp b/src/progressbar.cpp index c84308c..9b5d11d 100644 --- a/src/progressbar.cpp +++ b/src/progressbar.cpp @@ -22,8 +22,10 @@ The Inspired by https://github.com/rpm-software-management/rpm/blob/a7c3886b356c #include #include -#ifdef __WIN32__ -#error FIX PROGRESS BAR +#if defined(_WIN32) || defined(WIN32) || defined (_WIN64) || defined (WIN64) +#include +#define isatty _isatty +#define fileno _fileno #else #include #endif @@ -36,13 +38,13 @@ static size_t progressTotal = 0; void printProgress(const size_t amount, const size_t total) { size_t charsNeeded; - charsTotal = (isatty (STDOUT_FILENO) ? 34 : 40); + charsTotal = (isatty(fileno(stdout)) ? 34 : 40); if (charsCurrent != charsTotal) { float pct = (total ? (((float) amount) / total) : 1.0); charsNeeded = (charsTotal * pct) + 0.5; while (charsNeeded > charsCurrent) { - if (isatty (STDOUT_FILENO)) { + if (isatty (fileno(stdout))) { size_t i; for (i = 0; i < charsCurrent; i++) putchar ('#'); @@ -63,7 +65,7 @@ void printProgress(const size_t amount, const size_t total) if (charsCurrent == charsTotal) { size_t i; progressCurrent++; - if (isatty(STDOUT_FILENO)) { + if (isatty(fileno(stdout))) { for (i = 1; i < charsCurrent; i++) putchar ('#'); pct = (progressTotal ? (((float) progressCurrent) / progressTotal): 1); fprintf(stdout, " [%3d%%]", (int)((100 * pct) + 0.5)); diff --git a/src/util.cpp b/src/util.cpp index eb4af52..bd935f1 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -32,7 +32,7 @@ void dump_msg(PASSTHRU_MSG* msg) if (msg->RxStatus & START_OF_MESSAGE) return; - printf("[%lu] [%0b]", msg->Timestamp, msg->RxStatus); + printf("[%lu]", msg->Timestamp); for (unsigned int i = 0; i < msg->DataSize; i++) printf("%02X ", msg->Data[i]); printf("\n");