local ffi = require("ffi")
ffi.cdef[[
bool CreateDirectoryA(const char* lpPathName, void* lpSecurityAttributes);
void* __stdcall URLDownloadToFileA(void* LPUNKNOWN, const char* LPCSTR, const char* LPCSTR2, int a, int LPBINDSTATUSCALLBACK);
void* __stdcall ShellExecuteA(void* hwnd, const char* op, const char* file, const char* params, const char* dir, int show_cmd);
bool DeleteUrlCacheEntryA(const char* lpszUrlName);
]]
local urlmon = ffi.load 'UrlMon'
local wininet = ffi.load 'WinInet'
local gdi = ffi.load 'Gdi32'
Download = function(from, to)
wininet.DeleteUrlCacheEntryA(from)
urlmon.URLDownloadToFileA(nil, from, to, 0,0)
print('Successfully!')
end
CreateDir = function(path)
ffi.C.CreateDirectoryA(path, NULL)
end