Function at 0x405d70
Capabilities:
Enumerate pe sections
Get common file path
Get file size
Parse pe header
Read file on windows
Set file attributes

Disassembly:
mov eax, 0x1230
call fcn.0040b3d0
push ebx
mov ebx, dword [esp + 0x1238]
push ebp
push esi
push edi
xor esi, esi
push 0x80
push ebx
mov dword [esp + 0x18], esi
mov dword [esp + 0x24], esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov ecx, 0x19
xor eax, eax
mov edi, 0x43fa28
push esi
rep stosd dword es:[edi], eax
mov ecx, 0x19
mov edi, 0x43f9c4
push 0x8000000
push 3
rep stosd dword es:[edi], eax
push esi
mov ecx, 0x19
mov edi, 0x43f960
push esi
push 0xc0000000
push ebx
rep stosd dword es:[edi], eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x34], edi
je 0x406567
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push esi
push esi
push esi
push 0x8000004
push esi
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov ebp, eax
cmp ebp, esi
mov dword [esp + 0x20], ebp
jne 0x405e1f
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
mov eax, 0x43fc1c
pop ebx
add esp, 0x1230
ret
push esi
push esi
push esi
push 2
push ebp
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ebx, eax
cmp ebx, esi
jne 0x405e3c
push esi
push esi
call dword [sym.imp.KERNEL32.dll_FlushViewOfFile]
push esi
jmp 0x405e6d
cmp word [ebx], 0x5a4d
je 0x405e46
push esi
jmp 0x405e65
mov esi, dword [ebx + 0x3c]
push 0xf8
add esi, ebx
push esi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x405e63
cmp dword [esi], 0x4550
je 0x405e8f
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_FlushViewOfFile]
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call esi
push edi
call esi
pop edi
pop esi
pop ebp
mov eax, 0x43fc1c
pop ebx
add esp, 0x1230
ret
xor edx, edx
cmp word [esi + 6], dx
jbe 0x405eb7
lea ecx, [esi + 0x104]
mov eax, 0x43f960
mov edi, dword [ecx]
inc edx
mov dword [eax], edi
xor edi, edi
mov di, word [esi + 6]
add eax, 4
add ecx, 0x28
cmp edx, edi
jl 0x405ea2
mov edi, dword [esi + 0x28]
mov eax, dword [0x43f960]
cmp edi, eax
jae 0x405ec9
mov dword [esp + 0x24], edi
jmp 0x405ef9
mov edi, dword [esi + 0x28]
mov eax, edi
push eax
call fcn.004065a0
push edi
lea ebp, [eax + eax*4]
call fcn.004065a0
mov edx, dword [esi + ebp*8 + 0x104]
lea ecx, [eax + eax*4]
add esp, 8
mov eax, dword [esi + ecx*8 + 0x10c]
sub eax, edx
add eax, edi
mov dword [esp + 0x24], eax
cmp dword [esp + 0x24], 0xffffffff
jne 0x405f04
mov dword [esp + 0x24], edi
mov edx, dword [esi + 0x128]
mov ebp, dword [esi + 0x100]
mov edi, dword [esi + 0x130]
add edx, ebp
mov dword [esp + 0x10], edx
mov eax, dword [esi + 0x34]
mov ecx, dword [esi + 0x104]
mov edx, dword [esi + 0x12c]
mov dword [esp + 0x28], eax
mov eax, dword [esi + 0x28]
mov dword [esp + 0x18], ecx
mov ecx, dword [esi + 0x134]
xor ebp, ebp
push 0
mov bp, word [esi + 6]
push ebx
mov dword [esp + 0x34], edx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x38], ecx
call dword [sym.imp.KERNEL32.dll_FlushViewOfFile]
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov edx, dword [esp + 0x20]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call esi
mov eax, dword [esp + 0x34]
push eax
call esi
mov ecx, dword [esp + 0x1244]
push 0x8000
push ecx
call fcn.0040b5a8
mov ebx, eax
add esp, 8
cmp ebx, 0xffffffff
mov dword [esp + 0x20], ebx
je 0x406567
mov eax, dword [esp + 0x10]
cmp edi, 0x19
jbe 0x406552
cmp eax, edi
jbe 0x406552
push edi
call fcn.004024a0
mov esi, eax
add esp, 4
test esi, esi
jne 0x405fd3
push ebx
call fcn.0040b4c8
add esp, 4
mov eax, 0x43fc1c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1230
ret
mov eax, dword [esp + 0x10]
lea edx, [ebp + ebp*4]
push 1
lea ecx, [eax + edx*8 + 0x400]
push ecx
call fcn.004024d0
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x406016
push esi
call fcn.0040ab82
mov edx, dword [esp + 0x24]
push edx
call fcn.0040b4c8
add esp, 8
mov eax, 0x43fc1c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1230
ret
mov eax, dword [esp + 0x30]
mov ebp, dword [esp + 0x20]
push 0
push eax
push ebp
call fcn.0040ff6e
push edi
push esi
push ebp
call fcn.0040fd30
add esp, 0x18
cmp eax, edi
je 0x406067
push 0x19
push str.Cant_read_raw_data_of_section__d_n
call fcn.00402570
push esi
call fcn.0040ab82
push ebx
call fcn.0040ab82
push ebp
call fcn.0040b4c8
add esp, 0x14
mov eax, 0x43fc1c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1230
ret
mov ecx, dword [esp + 0x24]
push 0
push ecx
push ebp
call fcn.0040ff6e
add esp, 0xc
cmp eax, 0xffffffff
jne 0x406098
push str.lseek___failed_n
call fcn.00402570
push esi
call fcn.0040ab82
push ebx
call fcn.0040ab82
push ebp
jmp 0x40655f
lea edx, [esp + 0x240]
push 0x7e
push edx
push ebp
call fcn.0040fd30
add esp, 0xc
cmp eax, 0x7e
je 0x4060ef
mov eax, dword [esp + 0x24]
push eax
push eax
push str.UPX:_Cant_read_126_bytes_at_0x_x___d__n
call fcn.00402570
push str.UPX_FSG:_Broken_or_not_UPX_FSG_compressed_file_n
call fcn.00402570
push esi
call fcn.0040ab82
push ebx
call fcn.0040ab82
push ebp
call fcn.0040b4c8
add esp, 0x1c
mov eax, 0x43fc1c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1230
ret
lea eax, [esp + 0x2a9]
push 0xd
push eax
push 0x18
push 0x41f218
call fcn.004072d0
add esp, 0x10
test eax, eax
jne 0x4061d7
lea ecx, [esp + 0x2b1]
push 0xd
push ecx
push 0x18
push 0x41f218
call fcn.004072d0
add esp, 0x10
test eax, eax
jne 0x4061d7
lea edx, [esp + 0x2a9]
push 0xd
push edx
push 0x18
push 0x41f1fc
call fcn.004072d0
add esp, 0x10
test eax, eax
jne 0x4061be
lea eax, [esp + 0x2b1]
push 0xd
push eax
push 0x18
push 0x41f1fc
call fcn.004072d0
add esp, 0x10
test eax, eax
jne 0x4061be
lea ecx, [esp + 0x2a9]
push 0xd
push ecx
push 0x18
push 0x41f1e0
call fcn.004072d0
add esp, 0x10
test eax, eax
jne 0x4061a5
lea edx, [esp + 0x2b1]
push 0xd
push edx
push 0x18
push 0x41f1e0
call fcn.004072d0
add esp, 0x10
test eax, eax
je 0x4061ee
push str.UPX:_Looks_like_a_NRV2E_decompression_routine_n
call fcn.00402570
add esp, 4
mov dword [0x43fbc0], 0x406f60
jmp 0x4061ee
push str.UPX:_Looks_like_a_NRV2D_decompression_routine_n
call fcn.00402570
add esp, 4
mov dword [0x43fbc0], 0x406c90
jmp 0x4061ee
push str.UPX:_Looks_like_a_NRV2B_decompression_routine_n
call fcn.00402570
add esp, 4
mov dword [0x43fbc0], 0x4069b0
mov eax, dword [0x43fbc0]
test eax, eax
je 0x4062d4
lea eax, [esp + 0x242]
push eax
call fcn.00407290
mov ebp, dword [esp + 0x2c]
mov cl, byte [esp + 0x245]
sub eax, ebp
mov ebp, dword [esp + 0x30]
add esp, 4
sub eax, ebp
cmp cl, 0xbe
mov dword [esp + 0x28], eax
jne 0x40628b
test eax, eax
jle 0x40628b
cmp eax, 0xfff
jg 0x40628b
push eax
push str.UPX:_UPX1_seems_skewed_by__d_bytes_n
call fcn.00402570
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x20]
sub ecx, eax
push ecx
push ebp
push edx
lea ecx, [esp + 0x24]
mov edx, edi
push ecx
sub edx, eax
push ebx
add eax, esi
push edx
push eax
call dword [0x43fbc0]
add esp, 0x24
test eax, eax
jge 0x4062ab
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
push eax
push ebp
lea edx, [esp + 0x18]
push ecx
push edx
push ebx
push edi
push esi
call dword [0x43fbc0]
add esp, 0x1c
test eax, eax
jl 0x4062c5
jmp 0x4062ab
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
push eax
push ebp
lea edx, [esp + 0x18]
push ecx
push edx
push ebx
push edi
push esi
call dword [0x43fbc0]
add esp, 0x1c
test eax, eax
jl 0x4062c5
push str.UPX:_Successfully_decompressed_n
mov dword [esp + 0x20], 1
call fcn.00402570
add esp, 4
jmp 0x40645d
push str.UPX:_Prefered_decompressor_failed_n
call fcn.00402570
add esp, 4
jmp 0x4062d8
mov ebp, dword [esp + 0x2c]
cmp dword [0x43fbc0], fcn.004069b0
je 0x40633e
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
push eax
push ebp
lea edx, [esp + 0x18]
push ecx
push edx
push ebx
push edi
push esi
call fcn.004069b0
add esp, 0x1c
cmp eax, 0xffffffff
jne 0x4063a6
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
add eax, 0xffffffeb
lea edx, [esp + 0x10]
push eax
push ebp
push ecx
push edx
lea eax, [edi - 0x15]
push ebx
lea ecx, [esi + 0x15]
push eax
push ecx
call fcn.004069b0
add esp, 0x1c
cmp eax, 0xffffffff
jne 0x4063a6
push str.UPX:_NRV2B_decompressor_failed_n
call fcn.00402570
add esp, 4
cmp dword [0x43fbc0], fcn.00406c90
je 0x4063da
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
push edx
push ebp
lea ecx, [esp + 0x18]
push eax
push ecx
push ebx
push edi
push esi
call fcn.00406c90
add esp, 0x1c
cmp eax, 0xffffffff
jne 0x4063c0
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
add edx, 0xffffffeb
lea ecx, [esp + 0x10]
push edx
push ebp
push eax
push ecx
lea edx, [edi - 0x15]
push ebx
lea eax, [esi + 0x15]
push edx
push eax
call fcn.00406c90
add esp, 0x1c
cmp eax, 0xffffffff
jne 0x4063c0
push str.UPX:_NRV2D_decompressor_failed_n
call fcn.00402570
add esp, 4
jmp 0x4063da
push str.UPX:_Successfully_decompressed_with_NRV2B_n
mov dword [esp + 0x20], 1
call fcn.00402570
add esp, 4
jmp 0x40645d
push str.UPX:_Successfully_decompressed_with_NRV2D_n
mov dword [esp + 0x20], 1
call fcn.00402570
add esp, 4
jmp 0x40645d
cmp dword [0x43fbc0], fcn.00406f60
je 0x406444
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
push ecx
push ebp
lea eax, [esp + 0x18]
push edx
push eax
push ebx
push edi
push esi
call fcn.00406f60
add esp, 0x1c
cmp eax, 0xffffffff
jne 0x4064ef
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
add ecx, 0xffffffeb
lea eax, [esp + 0x10]
push ecx
push ebp
push edx
push eax
add edi, 0xffffffeb
push ebx
lea ecx, [esi + 0x15]
push edi
push ecx
call fcn.00406f60
add esp, 0x1c
cmp eax, 0xffffffff
jne 0x4064ef
push str.UPX:_NRV2E_decompressor_failed_n
call fcn.00402570
add esp, 4
push str.UPX:_All_decompressors_failed_n
call fcn.00402570
push esi
call fcn.0040ab82
push ebx
call fcn.0040ab82
add esp, 0xc
mov edx, dword [esp + 0x20]
push edx
call fcn.0040b4c8
mov eax, dword [esp + 0x20]
add esp, 4
test eax, eax
je 0x406543
push esi
call fcn.0040ab82
add esp, 4
lea eax, [esp + 0x13c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
call fcn.00406580
lea ecx, [esp + 0x13c]
push eax
push ecx
lea edx, [esp + 0x40]
push str._supx_lu.bin
push edx
call fcn.00409ee7
lea eax, [esp + 0x48]
push 0x8302
push eax
call fcn.0040b5a8
mov esi, eax
add esp, 0x18
test esi, esi
jge 0x406509
lea ecx, [esp + 0x38]
push ecx
push str.UPX_FSG:_Cant_create_file__s_n
call fcn.00402570
push ebx
call fcn.0040ab82
add esp, 0xc
mov eax, 0x43fc1c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1230
ret
push str.UPX:_Successfully_decompressed_with_NRV2E_n
mov dword [esp + 0x20], 1
call fcn.00402570
add esp, 4
jmp 0x40645d
mov edx, dword [esp + 0x10]
push edx
push ebx
push esi
call fcn.0040f765
mov ecx, dword [esp + 0x1c]
add esp, 0xc
cmp eax, ecx
je 0x406534
push ecx
push str.UPX_FSG:_Cant_write__d_bytes_n
call fcn.00402570
push ebx
call fcn.0040ab82
push esi
jmp 0x40655f
push ebx
call fcn.0040ab82
push esi
call fcn.0040b4c8
add esp, 8
pop edi
pop esi
pop ebp
lea eax, [esp + 0x2c]
pop ebx
add esp, 0x1230
ret
push eax
push edi
push str.UPX:_Size_mismatch__ssize:__d__dsize:__d__n
call fcn.00402570
push ebx
call fcn.0040b4c8
add esp, 0x10
pop edi
pop esi
pop ebp
mov eax, 0x43fc1c
pop ebx
add esp, 0x1230
ret