Function at 0x401640
Capabilities:
Delete file
Get disk information
Move file
Read file on windows
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
xor esi, esi
push ebx
sub esp, 0x150
mov ebx, dword [ebp + 0xc]
call fcn.00402540
mov dword [ebp - 0x140], 0
mov dword [ebp - 0x144], 0
mov dword [ebp - 0x148], 0
mov dword [ebp - 0x14c], 0
mov dword [ebp - 0x150], 0
mov dword [ebp - 0x154], 0
call fcn.00401315
test eax, eax
jne 0x4016ae
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
push str.You_need_to_be_running_at_least_Windows_NT__use_syslinux.com_instead._n
jmp 0x401c8e
mov eax, dword [ebx]
mov dword [0x408238], 0
lea edx, [ebx + 4]
mov dword [0x408248], eax
cmp dword [ebx + 4], 0
je 0x401770
mov eax, dword [edx]
cmp byte [eax], 0x2d
jne 0x401746
cmp byte [eax + 1], 0
lea ecx, [eax + 1]
je case.0x4016ef.98
movsx eax, byte [ecx]
sub eax, 0x61
cmp eax, 0x12
ja case.0x4016ef.98
jmp dword [eax*4 + 0x4073f0]
mov dword [ebp - 0x150], 1
jmp 0x40173e
mov dword [ebp - 0x154], 1
jmp 0x40173e
mov esi, 1
jmp 0x40173e
mov dword [ebp - 0x148], 1
jmp 0x40173e
mov dword [ebp - 0x14c], 1
jmp 0x40173e
cmp dword [edx + 4], 0
je 0x40173e
add edx, 4
mov eax, dword [edx]
mov dword [ebp - 0x144], eax
inc ecx
cmp byte [ecx], 0
jne 0x4016e0
jmp 0x401765
cmp dword [ebp - 0x140], 0
jne case.0x4016ef.98
cmp dword [0x408238], 0
je 0x401760
mov dword [ebp - 0x140], eax
jmp 0x401765
mov dword [0x408238], eax
add edx, 4
cmp dword [edx], 0
jmp 0x4016c6
mov eax, dword [0x408238]
test eax, eax
je case.0x4016ef.98
movsx edx, byte [eax]
mov eax, dword [sym.imp.msvcrt.dll___mb_cur_max]
cmp dword [eax], 1
jne 0x401798
mov eax, dword [sym.imp.msvcrt.dll__pctype]
mov eax, dword [eax]
movzx eax, word [eax + edx*2]
and eax, 0x103
jmp 0x4017a5
push 0x103
push edx
call sub.msvcrt.dll__isctype
pop edx
pop ecx
test eax, eax
je case.0x4016ef.98
mov eax, dword [0x408238]
cmp byte [eax + 1], 0x3a
jne case.0x4016ef.98
cmp byte [eax + 2], 0
je 0x4017bf
call fcn.00401626
call sub.KERNEL32.dll_GetLogicalDrives
mov ebx, eax
mov eax, dword [0x408238]
movsx eax, byte [eax]
push eax
call sub.msvcrt.dll_tolower
pop edi
lea ecx, [eax - 0x61]
mov eax, 1
shl eax, cl
mov edx, dword [0x408238]
test ebx, eax
jne 0x4017f7
movsx eax, byte [edx]
push eax
push str.No_such_drive__c:_n
jmp 0x4018e8
movzx eax, byte [edx]
mov byte [0x403004], al
movzx eax, byte [edx]
mov byte [str._:ldlinux.sys], al
movzx eax, byte [edx]
mov byte [0x403007], al
push 0x403007
call sub.KERNEL32.dll_GetDriveTypeA
cmp eax, 3
mov ecx, eax
sete dl
xor eax, eax
test esi, esi
sete al
test eax, edx
je 0x40183f
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
push str.Not_a_removable_drive__use__f_to_override___n
jmp 0x401c8e
lea eax, [ecx - 2]
cmp eax, 1
jbe 0x40185a
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
push str.Unsupported_media_n
jmp 0x401c8e
push 0
push 0
push 3
push 0
push 3
push 0xc0000000
push str.._:
call sub.KERNEL32.dll_CreateFileA
mov dword [ebp - 0x138], eax
inc eax
jne 0x401883
push str.Could_not_open_drive
jmp 0x4018aa
push 0
lea eax, [ebp - 0x130]
push eax
push 0x200
push 0x408008
push dword [ebp - 0x138]
call sub.KERNEL32.dll_ReadFile
test eax, eax
jne 0x4018b4
push str.Reading_boot_sector
call fcn.0040134f
jmp 0x401c93
cmp dword [ebp - 0x130], 0x200
je 0x4018d3
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
push str.Could_not_read_the_whole_boot_sector_n
jmp 0x401c8e
push 0x408008
call fcn.00401cdf
pop ecx
test eax, eax
je 0x4018fb
push eax
push 0x407290
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
call sub.msvcrt.dll_fprintf
jmp 0x401c93
push pe_nt_image_headers32
push str._:ldlinux.sys
call sub.KERNEL32.dll_SetFileAttributesA
push str._:ldlinux.sys
call sub.KERNEL32.dll_DeleteFileA
push 0
push 7
push 2
push 0
push 3
push 0xc0000000
push str._:ldlinux.sys
call sub.KERNEL32.dll_CreateFileA
cmp eax, 0xffffffff
mov esi, eax
jne 0x40193e
push str.Unable_to_create_ldlinux.sys
jmp 0x4018aa
push 0
lea edx, [ebp - 0x134]
push edx
push dword [0x403284]
push str._r_nSYSLINUX_3.71_3.71
push eax
call sub.KERNEL32.dll_WriteFile
test eax, eax
je 0x401a5e
mov eax, dword [0x403284]
cmp dword [ebp - 0x134], eax
je 0x401980
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
push str.Could_not_write_whole_ldlinux.sys_n
jmp 0x401c8e
push esi
call sub.KERNEL32.dll_FlushFileBuffers
test eax, eax
jne 0x401994
push str.FlushFileBuffers_failed
jmp 0x4018aa
push dword [ebp - 0x138]
xor edi, edi
push 0x4015ac
call fcn.00402290
push 0
mov ebx, eax
push str.LDLINUX_SYS
push 0
push eax
call fcn.004023fc
lea edx, [ebp - 0x11c]
mov dword [ebp - 0x13c], edx
push eax
push ebx
call fcn.004020e4
mov ecx, eax
add esp, 0x20
test eax, eax
je 0x401a01
mov eax, dword [ebp - 0x13c]
inc edi
mov dword [eax], ecx
add eax, 4
mov dword [ebp - 0x13c], eax
push ecx
push ebx
call fcn.00402115
mov ecx, eax
test ecx, ecx
pop eax
setne al
pop edx
xor edx, edx
cmp edi, 0x40
setle dl
test edx, eax
jmp 0x4019d1
push ebx
call fcn.004023e5
push dword [ebp - 0x154]
lea eax, [ebp - 0x11c]
push dword [ebp - 0x150]
push edi
push eax
call fcn.00401f54
push 0
push 0
push 0
push esi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0x14
test eax, eax
jne 0x401a5e
push 0
lea edx, [ebp - 0x134]
push edx
push dword [0x403284]
push str._r_nSYSLINUX_3.71_3.71
push esi
call sub.KERNEL32.dll_WriteFile
test eax, eax
je 0x401a5e
mov eax, dword [0x403284]
cmp dword [ebp - 0x134], eax
je 0x401a68
push str.Could_not_write_ldlinux.sys
jmp 0x4018aa
mov eax, dword [ebp - 0x148]
or eax, dword [ebp - 0x14c]
je 0x401ad7
lea eax, [ebp - 0x12c]
push eax
push dword [ebp - 0x138]
call fcn.00401571
pop edx
test eax, eax
pop ecx
je 0x401ac2
push dword [ebp - 0x14c]
push dword [ebp - 0x148]
push dword [ebp - 0x124]
push dword [ebp - 0x128]
call fcn.00401397
add esp, 0x10
test eax, eax
jne 0x401ad7
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
push str.Did_not_successfully_update_the_MBR__continuing..._n
jmp 0x401ad0
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
push str.Could_not_find_device_number_for_updating_MBR__continuing..._n
call sub.msvcrt.dll_fputs
pop edi
pop eax
push esi
call sub.KERNEL32.dll_CloseHandle
cmp dword [ebp - 0x144], 0
je 0x401bd7
mov dword [ebp - 0x158], esp
mov edi, dword [ebp - 0x144]
xor eax, eax
cld
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
lea eax, [ecx + 0x21]
and eax, 0xfffffffc
call fcn.00402a00
mov dword [ebp - 0x15c], 1
mov eax, dword [0x408238]
lea edi, [esp + 0xf]
and edi, 0xfffffff0
lea ecx, [edi + 3]
movzx eax, byte [eax]
mov byte [edi + 1], 0x3a
mov byte [edi + 2], 0x5c
mov byte [edi], al
mov esi, dword [ebp - 0x144]
cmp byte [esi], 0
je 0x401b78
movzx ebx, byte [esi]
cmp bl, 0x2f
sete al
cmp bl, 0x5c
sete dl
or eax, edx
test al, 1
je 0x401b68
cmp dword [ebp - 0x15c], 0
jne 0x401b75
mov dword [ebp - 0x15c], 1
mov bl, 0x5c
jmp 0x401b72
mov dword [ebp - 0x15c], 0
mov byte [ecx], bl
inc ecx
inc esi
jmp 0x401b37
lea eax, [edi + 3]
cmp ecx, eax
jbe 0x401bd1
cmp dword [ebp - 0x15c], 0
jne 0x401b8c
mov byte [ecx], 0x5c
inc ecx
mov dword [ecx], 0x696c646c
mov dword [ecx + 4], 0x2e78756e
mov dword [ecx + 8], 0x737973
push pe_nt_image_headers32
push edi
call sub.KERNEL32.dll_SetFileAttributesA
push edi
call sub.KERNEL32.dll_DeleteFileA
push edi
push str._:ldlinux.sys
call sub.KERNEL32.dll_MoveFileA
test eax, eax
jne 0x401bc9
push 7
push str._:ldlinux.sys
jmp 0x401bcc
push 7
push edi
call sub.KERNEL32.dll_SetFileAttributesA
mov esp, dword [ebp - 0x158]
push 0x408008
call fcn.00401cb0
cmp dword [ebp - 0x140], 0
pop esi
je 0x401c45
push 0
push 0x20
push 2
push 0
push 3
push 0xc0000000
push dword [ebp - 0x140]
call sub.KERNEL32.dll_CreateFileA
cmp eax, 0xffffffff
mov esi, eax
jne 0x401c16
push str.Unable_to_create_bootsector_file
jmp 0x4018aa
push 0
lea edx, [ebp - 0x134]
push edx
push 0x200
push 0x408008
push eax
call sub.KERNEL32.dll_WriteFile
test eax, eax
jne 0x401c3d
push str.Could_not_write_boot_sector_file
jmp 0x4018aa
push esi
call sub.KERNEL32.dll_CloseHandle
jmp 0x401c74
push 0
push 0
push 0
push dword [ebp - 0x138]
call sub.KERNEL32.dll_SetFilePointer
push 0
lea eax, [ebp - 0x134]
push eax
push 0x200
push 0x408008
push dword [ebp - 0x138]
call sub.KERNEL32.dll_WriteFile
cmp dword [ebp - 0x134], 0x200
je 0x401c9a
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
push str.Could_not_write_the_whole_boot_sector_n
call sub.msvcrt.dll_fputs
push 1
call sub.msvcrt.dll_exit
push dword [ebp - 0x138]
call sub.KERNEL32.dll_CloseHandle
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret