Function at 0x416fe4
Capabilities:
Download and write a file
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0xa5c
mov ebx, dword [esp + 0xa70]
mov edi, dword [esp + 0xa74]
lea eax, [esp + 0x38]
mov dword [esp + 8], eax
mov dword [esp + 4], 2
mov dword [esp], ebx
call sub.lua54.dll_lua_tolstring
mov edx, dword [esp + 0x38]
xor esi, esi
cmp byte [eax + edx - 1], 0x2f
je 0x41702d
mov dword [esp], eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameA]
push edx
mov esi, eax
mov dword [esp], ebx
call sub.lua54.dll_lua_pushnil
cmp dword [edi + 0x10], 0
je 0x4172b4
mov dword [esp + 0x3c], 0
mov eax, dword [sym.imp.lua54.dll_TFtp]
cmp dword [edi], eax
jne 0x417062
lea esi, [esp + 0x40]
mov dword [esp + 4], esi
mov dword [esp], ebx
call sub.lua54.dll_luaL_buffinit
jmp 0x4170ac
xor ecx, ecx
mov edx, 1
mov eax, ebx
call fcn.00416e54
or edx, eax
jne 0x41707e
test esi, esi
jne 0x417117
jmp 0x417050
mov dword [esp + 8], 0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_tolstring
mov dword [esp + 4], str.text_
mov dword [esp], eax
call sub.msvcrt.dll_strstr
test eax, eax
jne 0x417050
jmp 0x417074
lea eax, [esp + 0x3c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x800
lea ebp, [esp + 0x250]
mov dword [esp + 4], ebp
mov eax, dword [edi + 0x10]
mov dword [esp], eax
call dword [sym.imp.WININET.DLL_InternetReadFile]
sub esp, 0x10
test eax, eax
je 0x417102
mov eax, dword [esp + 0x3c]
mov dword [esp + 8], eax
mov dword [esp + 4], ebp
mov dword [esp], esi
call sub.lua54.dll_luaL_addlstring
cmp dword [esp + 0x3c], 0
jne 0x4170ac
mov dword [esp], esi
call sub.lua54.dll_luaL_pushresult
jmp 0x4172b4
mov dword [esp + 4], 0
mov dword [esp], ebx
call sub.lua54.dll_lua_pushboolean
jmp 0x4172b4
xor ecx, ecx
mov edx, 0x2f
mov eax, ebx
call fcn.00416e54
or edx, eax
je 0x4171a8
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_isstring
test eax, eax
je 0x4171a8
mov dword [esp + 8], 0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_tolstring
mov dword [esp], eax
call sub.msvcrt.dll__strdup
mov ebp, eax
mov dword [esp + 4], 0x22
mov dword [esp], eax
call sub.msvcrt.dll_strchr
mov edx, eax
test eax, eax
je 0x41719e
mov dword [esp + 4], 0x22
lea eax, [eax + 2]
mov dword [esp + 0x2c], edx
mov dword [esp], eax
call sub.msvcrt.dll_strchr
mov byte [eax], 0
mov edx, dword [esp + 0x2c]
inc edx
mov dword [esp], edx
call sub.msvcrt.dll__strdup
mov esi, eax
mov dword [esp], ebp
call sub.msvcrt.dll_free
jmp 0x4171b2
mov dword [esp], esi
call sub.msvcrt.dll__strdup
mov esi, eax
mov dword [esp + 4], 0xfffffffe
mov dword [esp], ebx
call fcn.00401580
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40000000
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
sub esp, 0x1c
mov ebp, eax
cmp eax, 0xffffffff
je 0x41729d
lea eax, [esp + 0x3c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x800
lea edx, [esp + 0x250]
mov dword [esp + 4], edx
mov eax, dword [edi + 0x10]
mov dword [esp], eax
call dword [sym.imp.WININET.DLL_InternetReadFile]
sub esp, 0x10
test eax, eax
je 0x41726d
mov dword [esp + 0x10], 0
lea eax, [esp + 0x40]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 8], eax
lea edx, [esp + 0x250]
mov dword [esp + 4], edx
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esp, 0x14
cmp dword [esp + 0x3c], 0
jne 0x417209
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
mov dword [esp + 4], esi
mov dword [esp], ebx
call sub.lua54.dll_lua_pushstring
mov dword [esp + 8], 1
mov dword [esp + 4], 0x427791
mov dword [esp], ebx
call sub.lua54.dll_lua_pushnewinstance
jmp 0x4172ac
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7b
je 0x417050
mov dword [esp], esi
call sub.msvcrt.dll_free
mov eax, 1
add esp, 0xa5c
pop ebx
pop esi
pop edi
pop ebp
ret