Function at 0x40415c
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 0x404665
mov dword [esp + 4], 0xfffffffe
mov dword [esp], ebx
call sub.lua54.dll_lua_isstring
test eax, eax
jne 0x404212
mov dword [esp + 8], str.__name
mov dword [esp + 4], 2
mov dword [esp], ebx
call sub.lua54.dll_luaL_getmetafield
test eax, eax
je 0x4041ee
mov dword [esp + 8], 0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_tolstring
jmp 0x4041fe
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.00401710
test edi, edi
je 0x40428a
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 0x40429e
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 0x4042c0
cmp eax, 3
jge 0x4042ce
dec eax
je 0x4042ce
jmp 0x404606
cmp eax, 5
je 0x404374
jmp 0x404606
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 0x40435f
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 0x4045bb
jmp 0x4045ff
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x24]
lea eax, [ecx + eax + 0x40]
mov dword [esp + 0x24], eax
jmp 0x4045bb
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 0x404413
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.00401710
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 0x404588
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 0x4045ff
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 0x4045ff
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 0x4045ff
add ebp, dword [esp + 0x40]
xor edx, edx
cmp ebp, dword [esp + 0x48]
mov eax, edx
sbb eax, dword [esp + 0x4c]
jl 0x4044fa
mov dword [esp + 4], 0xfffffffe
mov dword [esp], ebx
call sub.lua54.dll_lua_settop
jmp 0x4045ad
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 sub.lua54.dll_lua_settop
test edi, edi
je 0x40418c
lea eax, [esp + 0x40]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 2
mov dword [esp + 4], 0x416c51
mov dword [esp], edi
call dword [sym.imp.WININET.DLL_InternetWriteFile]
sub esp, 0x10
test eax, eax
jne 0x40418c
xor eax, eax
jmp 0x4046be
mov dword [esp + 8], str.__name
mov dword [esp + 4], 2
mov dword [esp], ebx
call sub.lua54.dll_luaL_getmetafield
test eax, eax
je 0x40463c
mov dword [esp + 8], 0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call sub.lua54.dll_lua_tolstring
jmp 0x40464c
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.00401710
jmp 0x4045bb
test edi, edi
je 0x4046b7
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 0x4046b7
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 0x4046be
mov eax, dword [esp + 0x24]
add eax, 0x13
add esp, 0xc5c
pop ebx
pop esi
pop edi
pop ebp
ret