Function at 0x4053f0
Capabilities:
Create directory
Parse pe header
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x120
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, edx
mov dword [ebp - 0x120], eax
push edi
lea eax, [ebp - 0x110]
mov dword [ebp - 0x118], 0
mov ebx, 1
push dword [esi]
push 0x417ef4
push 0x104
push eax
call fcn.00405c7a
lea eax, [ebp - 0x110]
push eax
push 0x417ef4
push 0
call fcn.00403e00
add esp, 0x1c
test eax, eax
jne 0x4054b9
lea eax, [ebp - 0x110]
push eax
push eax
push str.File__s_NOT_exist__now_try__s.exe
call fcn.00403880
add esp, 0xc
lea eax, [ebp - 0x110]
push dword [esi]
push str._s.exe
push 0x104
push eax
call fcn.00405c7a
lea eax, [ebp - 0x110]
push eax
push 0x417ef4
push 0
call fcn.00403e00
add esp, 0x1c
mov edx, 0x418a54
test eax, eax
mov ecx, 0x418a50
lea eax, [ebp - 0x110]
cmove ecx, edx
push ecx
push eax
push str.File__s_exist____s
call fcn.00403880
add esp, 0xc
lea eax, [ebp - 0x11c]
push eax
lea edx, [ebp - 0x118]
lea ecx, [ebp - 0x110]
call fcn.00403bc0
mov esi, dword [ebp - 0x118]
add esp, 4
test eax, eax
jne 0x4055b4
cmp byte [esi], 0x4d
jne 0x405508
cmp byte [esi + 1], 0x5a
jne 0x405508
mov ecx, dword [esi + 0x3c]
cmp dword [ecx + esi], 0x4550
jne 0x405508
mov edx, 0x20b
cmp word [ecx + esi + 0x18], dx
sete al
jmp 0x40550a
xor eax, eax
push str.ventoy
push 1
mov dword [0x41bf78], eax
call fcn.00403e00
add esp, 8
test eax, eax
jne 0x40554e
push eax
push str.ventoy
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x40554e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_create_ventoy_directory_err:_u
call fcn.00403880
mov esi, dword [ebp - 0x118]
add esp, 8
jmp 0x4055b4
mov edi, dword [ebp - 0x11c]
xor ebx, ebx
test edi, edi
je 0x40559c
lea ebx, [ebx]
lea ecx, [ebx + esi]
call fcn.00403ce0
test eax, eax
je 0x405595
cmp byte [ebx + esi + 0x600], 0x4d
lea ecx, [ebx + esi]
jne 0x405595
cmp byte [ecx + 0x601], 0x5a
jne 0x405595
mov eax, dword [ecx + 0x63c]
cmp dword [ecx + eax + 0x600], 0x4550
je 0x4055d4
add ebx, 0x10
cmp ebx, edi
jb 0x405560
mov esi, dword [ebp - 0x118]
push str.OS_param_not_found
call fcn.00403880
mov ebx, 1
add esp, 4
test esi, esi
je 0x4055c1
push esi
call fcn.00405c96
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004059f4
mov esp, ebp
pop ebp
ret
push ebx
push str.Find_os_pararm_at__u
call fcn.00403880
lea eax, [ebx + esi]
mov ecx, 0x80
mov esi, eax
mov edi, 0x41d0b0
rep movsd dword es:[edi], dword [esi]
movdqu xmm1, xmmword [0x41d271]
lea esi, [eax + 0x200]
mov ecx, 0x100
movdqu xmm0, xmmword [0x41d281]
mov edi, 0x41cc88
add esp, 8
movd eax, xmm1
rep movsd dword es:[edi], dword [esi]
movdqu xmmword [0x41d088], xmm1
movdqu xmmword [0x41d098], xmm0
cmp al, 1
jne 0x405642
push str.break_here_for_debug_.....
call fcn.00403880
mov esi, dword [ebp - 0x118]
jmp 0x4055ac
xor eax, eax
mov cl, byte [eax + 0x41d0dd]
test cl, cl
je 0x405662
cmp cl, 0x2f
jne 0x40565a
mov byte [eax + 0x41d0dd], 0x5c
inc eax
cmp eax, 0x180
jb 0x405644
lea eax, [ebp - 0x110]
add ebx, 0x600
push 0x418a20
push eax
call fcn.00405d60
add esp, 8
test eax, eax
je 0x4056bc
lea ecx, [ebp - 0x110]
lea edx, [ecx + 1]
lea esp, [esp]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x405690
sub ecx, edx
test ecx, ecx
jle 0x4056bc
lea edx, [ebp - 0x110]
mov al, byte [edx + ecx - 1]
cmp al, 0x2f
je 0x40573a
cmp al, 0x5c
je 0x40573a
dec ecx
test ecx, ecx
jg 0x4056a3
lea eax, [ebp - 0x110]
push eax
push str.ventoy_s
push 0x104
push dword [ebp - 0x120]
call fcn.00405c7a
mov edi, dword [ebp - 0x11c]
mov esi, edi
sub esi, ebx
push esi
push dword [ebp - 0x120]
push str.SaveBuffer2File___s__len:_u
call fcn.00403880
add esp, 0x1c
push 0
push 0
push 1
push 0
push 3
push 0xc0000000
push dword [ebp - 0x120]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, eax
mov dword [ebp - 0x11c], ecx
cmp ecx, 0xffffffff
jne 0x405747
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_create_new_file__error:_u
call fcn.00403880
mov esi, dword [ebp - 0x118]
add esp, 8
jmp 0x40576e
lea eax, [ebp - 0x110]
add eax, ecx
jmp 0x4056c2
push 0
lea eax, [ebp - 0x114]
push eax
push esi
mov esi, dword [ebp - 0x118]
lea eax, [ebx + esi]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x11c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp ebx, edi
jae 0x4055a2
cmp byte [0x41d088], 2
jne 0x405793
push str.skip_hook_for_debug_.....
call fcn.00403880
add esp, 4
xor ebx, ebx
jmp 0x4055b4
mov ecx, 0x41d0b0
call fcn.004050b0
mov ebx, eax
jmp 0x4055b4