Function at 0x409d68
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 0x409db1
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 0x40a038
mov dword [esp + 0x3c], 0
mov eax, dword [sym.imp.lua54.dll_TFtp]
cmp dword [edi], eax
jne 0x409de6
lea esi, [esp + 0x40]
mov dword [esp + 4], esi
mov dword [esp], ebx
call sub.lua54.dll_luaL_buffinit
jmp 0x409e30
xor ecx, ecx
mov edx, 1
mov eax, ebx
call fcn.00409c60
or edx, eax
jne 0x409e02
test esi, esi
jne 0x409e9b
jmp 0x409dd4
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 0x409dd4
jmp 0x409df8
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 0x409e86
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 0x409e30
mov dword [esp], esi
call sub.lua54.dll_luaL_pushresult
jmp 0x40a038
mov dword [esp + 4], 0
mov dword [esp], ebx
call sub.lua54.dll_lua_pushboolean
jmp 0x40a038
xor ecx, ecx
mov edx, 0x2f
mov eax, ebx
call fcn.00409c60
or edx, eax
je 0x409f2c
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_isstring
test eax, eax
je 0x409f2c
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 0x409f22
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 0x409f36
mov dword [esp], esi
call sub.msvcrt.dll__strdup
mov esi, eax
mov dword [esp + 4], 0xfffffffe
mov dword [esp], ebx
call sub.lua54.dll_lua_settop
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 0x40a021
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 0x409ff1
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 0x409f8d
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], 0x416cf1
mov dword [esp], ebx
call sub.lua54.dll_lua_pushnewinstance
jmp 0x40a030
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7b
je 0x409dd4
mov dword [esp], esi
call sub.msvcrt.dll_free
mov eax, 1
add esp, 0xa5c
pop ebx
pop esi
pop edi
pop ebp
ret