Function at 0x401470
Capabilities:
Delete file
Get common file path
Receive http request
Send http response
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x37c
mov eax, dword [0x405004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov ebx, edx
push edi
push 0x800
push 0
mov dword [ebp - 0x378], ecx
mov dword [ebp - 0x374], 0
mov dword [ebp - 0x224], 0
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
jne 0x4014df
push str.Insufficient_resources__n
call fcn.00401010
add esp, 4
lea eax, [edi + 8]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004017e5
mov esp, ebp
pop ebp
ret
push 0x120
lea eax, [ebp - 0x370]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x368], 0x200c8
test byte [ebx], 1
mov dword [ebp - 0x364], 0x403314
je 0x40177f
lea eax, [ebp - 0x220]
push eax
push 0
push 0x40343c
push 0x403444
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
jne 0x401569
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push 0x403448
call fcn.00401010
mov eax, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
add esp, 8
call eax
push edi
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004017e5
mov esp, ebp
pop ebp
ret
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x37c], eax
cmp eax, 0xffffffff
jne 0x4015a3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push str.Cannot_create_temporary_file._Error__lu__n
jmp 0x40153d
push 0
lea eax, [ebp - 0x224]
push eax
push 0x800
push edi
push 0
push dword [ebx + 0x14]
push dword [ebx + 0x10]
push dword [ebp - 0x378]
call dword [sym.imp.HTTPAPI.dll_HttpReceiveRequestEntityBody]
mov ecx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
test esi, esi
jne 0x40162e
mov eax, dword [ebp - 0x224]
test eax, eax
je 0x4015f5
add dword [ebp - 0x374], eax
lea edx, [ebp - 0x228]
push 0
push edx
push eax
push edi
push dword [ebp - 0x37c]
call ecx
push 0
lea eax, [ebp - 0x224]
mov dword [ebp - 0x224], 0
push eax
push 0x800
push edi
push 0
push dword [ebx + 0x14]
push dword [ebx + 0x10]
push dword [ebp - 0x378]
call dword [sym.imp.HTTPAPI.dll_HttpReceiveRequestEntityBody]
mov ecx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
test esi, esi
je 0x4015d2
cmp esi, 0x26
je 0x40163e
push esi
push str.HttpReceiveRequestEntityBody_failed_with__lu__n
jmp 0x40173a
mov eax, dword [ebp - 0x224]
test eax, eax
je 0x401661
add dword [ebp - 0x374], eax
lea edx, [ebp - 0x228]
push 0
push edx
push eax
push edi
push dword [ebp - 0x37c]
call ecx
push dword [ebp - 0x374]
lea eax, [ebp - 0x10]
push 0x4034e4
push 0xb
push eax
call fcn.00401050
lea eax, [ebp - 0x10]
add esp, 0x10
mov ecx, eax
mov dword [ebp - 0x2f4], eax
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401688
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x22c]
sub ecx, edx
push eax
push 0
lea eax, [ebp - 0x370]
mov word [ebp - 0x2f8], cx
push eax
push 2
push dword [ebx + 0x14]
push dword [ebx + 0x10]
push dword [ebp - 0x378]
call dword [sym.imp.HTTPAPI.dll_HttpSendHttpResponse]
mov esi, eax
test esi, esi
je 0x4016d2
push esi
push str.HttpSendHttpResponse_failed_with__lu__n
jmp 0x40173a
mov eax, dword [ebp - 0x37c]
xorps xmm0, xmm0
push 0
push 0
push 0
push 0
push 0
mov dword [ebp - 0x238], eax
lea eax, [ebp - 0x250]
push eax
push 1
push 0
push dword [ebx + 0x14]
mov dword [ebp - 0x250], 1
push dword [ebx + 0x10]
movlpd qword [ebp - 0x248], xmm0
push dword [ebp - 0x378]
mov dword [ebp - 0x240], 0xffffffff
mov dword [ebp - 0x23c], 0xffffffff
call dword [sym.imp.HTTPAPI.dll_HttpSendResponseEntityBody]
mov esi, eax
test esi, esi
je 0x401742
push esi
push 0x4034e8
call fcn.00401010
add esp, 8
mov eax, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
call eax
push edi
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [ebp - 0x37c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004017e5
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x22c]
push eax
push 0
lea eax, [ebp - 0x370]
push eax
push 0
push dword [ebx + 0x14]
push dword [ebx + 0x10]
push dword [ebp - 0x378]
call dword [sym.imp.HTTPAPI.dll_HttpSendHttpResponse]
mov ebx, eax
test ebx, ebx
je 0x4017c6
push ebx
push str.HttpSendHttpResponse_failed_with__lu__n
call fcn.00401010
add esp, 8
call esi
push edi
push 0
jmp 0x4017cb
push edi
push 0
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004017e5
mov esp, ebp
pop ebp
ret