Function at 0x405acc
Capabilities:
Get file size
Read and send data from client to server
Read file on windows
Send data

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0xc5c
mov ebx, eax
mov edi, edx
mov dword [esp + 4], 3
mov dword [esp], eax
call sub.lua54.dll_lua_pushvalue
mov dword [esp], ebx
call sub.lua54.dll_lua_pushnil
xor esi, esi
mov dword [esp + 0x24], 0
mov dword [esp + 4], 0xfffffffe
mov dword [esp], ebx
call sub.lua54.dll_lua_next
test eax, eax
je 0x405fd5
mov dword [esp + 4], 0xfffffffe
mov dword [esp], ebx
call sub.lua54.dll_lua_isstring
test eax, eax
jne 0x405b82
mov dword [esp + 8], 0x4275b1
mov dword [esp + 4], 2
mov dword [esp], ebx
call sub.lua54.dll_luaL_getmetafield
test eax, eax
je 0x405b5e
mov dword [esp + 8], 0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_tolstring
jmp 0x405b6e
mov dword [esp + 4], 2
mov dword [esp], ebx
call sub.lua54.dll_lua_objectname
mov dword [esp + 8], eax
mov dword [esp + 4], str.error_during_table_traversal___s_key_found__string_expected_
mov dword [esp], ebx
call fcn.00401778
test edi, edi
je 0x405bfa
mov dword [esp + 8], 0x400
mov dword [esp + 4], 0
lea ebp, [esp + 0x50]
mov dword [esp], ebp
call sub.msvcrt.dll_memset
mov dword [esp + 8], str.______L_u_a_R_T_x_r_nContent_Disposition:_form_data__name_
mov dword [esp + 4], 0x39
lea eax, [ebp + esi]
mov dword [esp], eax
mov edx, dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 0x28], edx
call edx
mov esi, eax
lea eax, [esp + 0x3c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0xfffffffe
mov dword [esp], ebx
call sub.lua54.dll_lua_tolstring
mov dword [esp + 8], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 4], eax
add ebp, esi
mov dword [esp], ebp
mov edx, dword [esp + 0x28]
call edx
add esi, eax
jmp 0x405c0e
mov dword [esp + 4], 0xfffffffe
mov dword [esp], ebx
call sub.lua54.dll_luaL_len
add dword [esp + 0x24], eax
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_type
cmp eax, 4
jg 0x405c30
cmp eax, 3
jge 0x405c3e
dec eax
je 0x405c3e
jmp 0x405f76
cmp eax, 5
je 0x405ce4
jmp 0x405f76
lea eax, [esp + 0x3c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_tolstring
mov dword [esp + 0x2c], eax
test edi, edi
je 0x405ccf
mov dword [esp + 8], str.__r_n_r_n
mov dword [esp + 4], 5
lea ebp, [esp + 0x50]
lea eax, [ebp + esi]
mov dword [esp], eax
mov edx, dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 0x28], edx
call edx
add esi, eax
mov ecx, dword [esp + 0x2c]
mov dword [esp + 8], ecx
mov eax, dword [esp + 0x3c]
mov dword [esp + 4], eax
lea eax, [ebp + esi]
mov dword [esp], eax
mov edx, dword [esp + 0x28]
call edx
add esi, eax
lea eax, [esp + 0x40]
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], ebp
mov dword [esp], edi
call dword [sym.imp.WININET.DLL_InternetWriteFile]
sub esp, 0x10
test eax, eax
jne 0x405f2b
jmp 0x405f6f
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x24]
lea eax, [ecx + eax + 0x40]
mov dword [esp + 0x24], eax
jmp 0x405f2b
mov eax, dword [sym.imp.lua54.dll_TFile]
mov dword [esp + 8], eax
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_checkcinstance
mov ebp, eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov eax, dword [eax + 0x50]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
sub esp, 0x1c
mov dword [esp + 0x28], eax
inc eax
jne 0x405d83
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 4], eax
mov dword [esp], ebx
call sub.lua54.dll_lasterror
mov dword [esp + 8], 0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_tolstring
mov dword [esp + 8], eax
mov dword [esp + 4], str.cannot_open_File_:__s
mov dword [esp], ebx
call fcn.00401778
lea eax, [esp + 0x48]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
push eax
push eax
test edi, edi
je 0x405ef8
mov dword [esp + 8], str.___filename_
mov dword [esp + 4], 0xd
lea eax, [esp + 0x50]
add eax, esi
mov dword [esp], eax
mov edx, dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 0x2c], edx
call edx
add esi, eax
mov eax, dword [ebp + 0x50]
mov dword [esp], eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
push ecx
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], eax
mov dword [esp], ebx
call sub.lua54.dll_lua_pushlwstring
lea eax, [esp + 0x3c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_tolstring
mov dword [esp + 8], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 4], eax
lea eax, [esp + 0x50]
add eax, esi
mov dword [esp], eax
mov edx, dword [esp + 0x2c]
call edx
add esi, eax
mov dword [esp + 8], str.__r_nContent_Type:_application_octet_stream_r_nContent_Transfer_Encoding:_binary_r_n_r_n
mov dword [esp + 4], 0x50
lea eax, [esp + 0x50]
add eax, esi
mov dword [esp], eax
mov edx, dword [esp + 0x2c]
call edx
add esi, eax
lea eax, [esp + 0x40]
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
lea eax, [esp + 0x50]
mov dword [esp + 4], eax
mov dword [esp], edi
call dword [sym.imp.WININET.DLL_InternetWriteFile]
sub esp, 0x10
test eax, eax
je 0x405f6f
xor ebp, ebp
mov dword [esp + 0x10], 0
lea eax, [esp + 0x44]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x800
lea edx, [esp + 0x450]
mov dword [esp + 4], edx
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x405f6f
lea eax, [esp + 0x40]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x44]
mov dword [esp + 8], eax
lea edx, [esp + 0x450]
mov dword [esp + 4], edx
mov dword [esp], edi
call dword [sym.imp.WININET.DLL_InternetWriteFile]
sub esp, 0x10
test eax, eax
je 0x405f6f
add ebp, dword [esp + 0x40]
xor edx, edx
cmp ebp, dword [esp + 0x48]
mov eax, edx
sbb eax, dword [esp + 0x4c]
jl 0x405e6a
mov dword [esp + 4], 0xfffffffe
mov dword [esp], ebx
call fcn.00401580
jmp 0x405f1d
mov eax, dword [ebp + 0x50]
mov dword [esp], eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
push edx
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
add eax, 0x99
add eax, dword [esp + 0x48]
add eax, 0xffffffff
add dword [esp + 0x24], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
mov dword [esp + 4], 0xfffffffe
mov dword [esp], ebx
call fcn.00401580
test edi, edi
je 0x405afc
lea eax, [esp + 0x40]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 2
mov dword [esp + 4], 0x4276f1
mov dword [esp], edi
call dword [sym.imp.WININET.DLL_InternetWriteFile]
sub esp, 0x10
test eax, eax
jne 0x405afc
xor eax, eax
jmp 0x40602e
mov dword [esp + 8], 0x4275b1
mov dword [esp + 4], 2
mov dword [esp], ebx
call sub.lua54.dll_luaL_getmetafield
test eax, eax
je 0x405fac
mov dword [esp + 8], 0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_tolstring
jmp 0x405fbc
mov dword [esp + 4], 2
mov dword [esp], ebx
call sub.lua54.dll_lua_objectname
mov dword [esp + 8], eax
mov dword [esp + 4], str.error_during_table_traversal___s_value_found__string_or_File_expected_
mov dword [esp], ebx
call fcn.00401778
jmp 0x405f2b
test edi, edi
je 0x406027
lea eax, [esp + 0x40]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x13
mov dword [esp + 4], str.______L_u_a_R_T_x__
mov dword [esp], edi
call dword [sym.imp.WININET.DLL_InternetWriteFile]
sub esp, 0x10
test eax, eax
je 0x406027
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], edi
call dword [sym.imp.WININET.DLL_HttpEndRequestA]
sub esp, 0x10
jmp 0x40602e
mov eax, dword [esp + 0x24]
add eax, 0x13
add esp, 0xc5c
pop ebx
pop esi
pop edi
pop ebp
ret