Function at 0x41634d
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x7c
mov esi, dword [ebp + 8]
test esi, esi
sete al
cmp dword [ebp + 0xc], 0
sete dl
or eax, edx
test al, 1
jne 0x416a53
mov edx, dword [ebp + 0xc]
mov eax, dword [edx + 4]
mov dword [esp + 4], eax
mov eax, dword [0x455010]
mov dword [esp], eax
call fcn.0040913f
mov dword [ebp - 0x5c], eax
test eax, eax
jne 0x4163ab
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx + 4]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Uh_oh__I_cant_find_the_boot_image__s___n
mov dword [esp], 0xffffffff
call fcn.0042c48d
cld
mov ecx, 8
mov eax, 0
mov edi, esi
rep stosd dword es:[edi], eax
mov ebx, dword [ebp + 0xc]
movzx eax, byte [ebx + 8]
cmp al, 1
sbb eax, eax
and al, 0x88
mov byte [esi], al
mov eax, dword [ebx + 0x1c]
mov dword [esp + 4], eax
lea eax, [esi + 2]
mov dword [esp], eax
call fcn.004092e0
mov edi, dword [ebx + 0x18]
mov dword [ebp - 0x60], edi
cmp dword [ebx + 0x18], 0
jne 0x41642a
mov ecx, dword [ebp - 0x5c]
mov eax, dword [ecx + 0x100]
mov edx, dword [ecx + 0x104]
test edx, edx
jns 0x416402
add eax, 0x7ff
adc edx, 0
shrd eax, edx, 0xb
mov ecx, eax
shl ecx, 2
mov edi, dword [ebp - 0x5c]
mov eax, dword [edi + 0x100]
and eax, 0x7ff
mov edx, 0
mov edi, edx
or edi, eax
je 0x416427
add ecx, 4
mov dword [ebp - 0x60], ecx
cmp dword [0x430040], 0
jle 0x416452
mov eax, dword [ebp - 0x60]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Size_of_boot_image_is__d_sectors___
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0042c789
mov edx, dword [ebp + 0xc]
cmp dword [edx + 0x10], 0
je 0x4166e1
mov byte [esi + 1], 4
cmp dword [0x430040], 0
jle 0x416494
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x16
mov dword [esp + 4], 1
mov dword [esp], str.Emulating_a_hard_disk_n
call sub.msvcrt.dll_fwrite
mov dword [esp + 4], 0x8000
mov ecx, dword [ebp - 0x5c]
mov eax, dword [ecx + 0x114]
mov dword [esp], eax
call sub.msvcrt.dll__open
mov ebx, eax
cmp eax, 0xffffffff
jne 0x4164cd
mov edi, dword [ebp - 0x5c]
mov eax, dword [edi + 0x114]
mov dword [esp + 4], eax
mov dword [esp], str.Error_opening_boot_image__s_for_read._n
call fcn.0042c45d
mov dword [esp + 8], 0x200
mov dword [esp + 4], 0x465ad0
mov dword [esp], ebx
call sub.msvcrt.dll__read
cmp eax, 0x200
je 0x416505
mov edx, dword [ebp - 0x5c]
mov eax, dword [edx + 0x114]
mov dword [esp + 4], eax
mov dword [esp], str.Error_reading_MBR_from_boot_image__s._n
call fcn.0042c45d
mov dword [esp], ebx
call sub.msvcrt.dll__close
movzx dx, byte [0x465cce]
movzx eax, byte [0x465ccf]
shl eax, 8
or eax, edx
cmp ax, 0xaa55
je 0x416548
mov ecx, dword [ebp - 0x5c]
mov eax, dword [ecx + 0x114]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Warning:_boot_image__s_MBR_is_not_a_boot_sector._n
mov dword [esp], 0xffffffff
call fcn.0042c4e6
mov byte [esi + 4], 0
mov ebx, 0
mov ecx, ebx
shl ecx, 4
movzx eax, byte [ecx + 0x465c91]
shl eax, 8
movzx edx, byte [ecx + 0x465c90]
mov edi, edx
or edi, eax
movzx eax, byte [ecx + 0x465c95]
shl eax, 8
movzx edx, byte [ecx + 0x465c94]
or edx, eax
mov dword [ebp - 0x64], edx
cmp byte [ecx + 0x465c92], 0
je 0x4166a4
cmp byte [esi + 4], 0
je 0x4165b5
mov edx, dword [ebp - 0x5c]
mov eax, dword [edx + 0x114]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Boot_image__s_has_multiple_partitions._n
mov dword [esp], 0xffffffff
call fcn.0042c48d
mov edx, ebx
shl edx, 4
movzx eax, byte [edx + 0x465c92]
mov byte [esi + 4], al
mov ecx, dword [ebp + 0xc]
cmp dword [ecx + 8], 0
jne 0x4165fe
cmp byte [edx + 0x465c8e], 0x80
je 0x4165fe
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x26
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_partition_not_marked_active._n
call sub.msvcrt.dll_fwrite
mov edx, edi
sar edx, 8
lea eax, [edi*4]
and eax, 0x300
or edx, eax
jne 0x41662e
mov eax, ebx
shl eax, 4
cmp byte [eax + 0x465c8f], 1
setne dl
cmp edi, 1
setne al
or eax, edx
test al, 1
je 0x416656
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x2c
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_partition_does_not_start_at_0_1_1._n
call sub.msvcrt.dll_fwrite
mov ecx, dword [ebp - 0x64]
sar ecx, 8
mov eax, dword [ebp - 0x64]
shl eax, 2
and eax, 0x300
or ecx, eax
inc ecx
mov eax, ebx
shl eax, 4
movzx eax, byte [eax + 0x465c93]
inc eax
imul ecx, eax
mov eax, dword [ebp - 0x64]
and eax, 0x3f
imul ecx, eax
cmp ecx, dword [ebp - 0x60]
je 0x4166a4
mov dword [esp + 8], ecx
mov dword [esp + 4], str.Warning:_image_size_does_not_match_geometry___d__n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0042c789
inc ebx
cmp ebx, 3
jle 0x416551
cmp byte [esi + 4], 0
jne 0x4166d5
mov ebx, dword [ebp - 0x5c]
mov eax, dword [ebx + 0x114]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Boot_image__s_has_no_partitions._n
mov dword [esp], 0xffffffff
call fcn.0042c48d
mov dword [ebp - 0x60], 1
jmp 0x41681b
mov edi, dword [ebp + 0xc]
cmp dword [edi + 0xc], 0
je 0x416728
mov byte [esi + 1], 0
cmp dword [0x430040], 0
jle 0x41681b
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0xd
mov dword [esp + 4], 1
mov dword [esp], str.No_emulation_n
call sub.msvcrt.dll_fwrite
jmp 0x41681b
cmp dword [ebp - 0x60], 0xb40
jne 0x41676f
mov byte [esi + 1], 2
cmp dword [0x430040], 0
jle 0x416814
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x1b
mov dword [esp + 4], 1
mov dword [esp], str.Emulating_a_1440_kB_floppy_n
call sub.msvcrt.dll_fwrite
jmp 0x416814
cmp dword [ebp - 0x60], 0x1680
jne 0x4167b3
mov byte [esi + 1], 3
cmp dword [0x430040], 0
jle 0x416814
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x1b
mov dword [esp + 4], 1
mov dword [esp], str.Emulating_a_2880_kB_floppy_n
call sub.msvcrt.dll_fwrite
jmp 0x416814
cmp dword [ebp - 0x60], 0x960
jne 0x4167f3
mov byte [esi + 1], 1
cmp dword [0x430040], 0
jle 0x416814
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x1b
mov dword [esp + 4], 1
mov dword [esp], str.Emulating_a_1200_kB_floppy_n
call sub.msvcrt.dll_fwrite
jmp 0x416814
mov edx, dword [ebp - 0x5c]
mov eax, dword [edx + 0x114]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Error___boot_image__s_has_not_an_allowable_size._n
mov dword [esp], 0xffffffff
call fcn.0042c48d
mov dword [ebp - 0x60], 1
mov ecx, dword [ebp - 0x60]
mov dword [esp + 4], ecx
lea eax, [esi + 6]
mov dword [esp], eax
call fcn.004092e0
mov eax, dword [ebp - 0x5c]
add eax, 0xa
mov dword [esp], eax
call fcn.004093e2
mov dword [esp + 4], eax
lea eax, [esi + 8]
mov dword [esp], eax
call fcn.00409321
mov ebx, dword [ebp + 0xc]
cmp dword [ebx + 0x14], 0
je 0x416a53
mov dword [esp + 4], 0x8002
mov edi, dword [ebp - 0x5c]
mov eax, dword [edi + 0x114]
mov dword [esp], eax
call sub.msvcrt.dll__open
mov dword [ebp - 0x68], eax
cmp eax, 0xffffffff
jne 0x41688e
mov eax, dword [edi + 0x114]
mov dword [esp + 4], eax
mov dword [esp], str.Error_opening_boot_image_file__s_for_update._n
call fcn.0042c45d
mov dword [ebp - 0x70], 0
mov dword [ebp - 0x6c], 0
jmp 0x41694d
test byte [ebp - 0x70], 3
je 0x4168c8
mov edx, dword [ebp - 0x5c]
mov eax, dword [edx + 0x114]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Odd_alignment_at_non_end_of_file_in_boot_image__s._n
mov dword [esp], 0xffffffff
call fcn.0042c48d
cmp dword [ebp - 0x70], 0x3f
ja 0x416900
mov edi, 0x464ab0
mov eax, 0x40
mov ebx, eax
sub ebx, dword [ebp - 0x70]
mov edx, 0
cld
mov ecx, ebx
shr ecx, 2
mov eax, edx
rep stosd dword es:[edi], eax
test bl, 2
je 0x4168f9
mov word [edi], 0
add edi, 2
test bl, 1
je 0x416900
mov byte [edi], dl
cmp esi, 0x7ff
jg 0x416929
mov eax, 0x800
sub eax, esi
lea edx, [esi + 0x464ab0]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], edx
call sub.msvcrt.dll_memset
mov ebx, 0
lea eax, [ebx + 0x464ab0]
mov dword [esp], eax
call fcn.00409396
add dword [ebp - 0x6c], eax
add ebx, 4
cmp ebx, 0x7ff
jle 0x41692e
add dword [ebp - 0x70], esi
mov dword [esp + 8], 0x800
mov dword [esp + 4], 0x464ab0
mov edx, dword [ebp - 0x68]
mov dword [esp], edx
call sub.msvcrt.dll__read
mov esi, eax
test eax, eax
jg 0x4168a1
mov eax, dword [ebp - 0x70]
mov edx, 0
mov ebx, dword [ebp - 0x5c]
mov ecx, dword [ebx + 0x104]
xor ecx, edx
xor eax, dword [ebx + 0x100]
or ecx, eax
je 0x4169ad
mov eax, dword [ebx + 0x114]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Boot_image_file__s_changed_underneath_us__n
mov dword [esp], 0xffffffff
call fcn.0042c48d
mov dword [esp + 8], 0
mov dword [esp + 4], 8
mov edi, dword [ebp - 0x68]
mov dword [esp], edi
call sub.msvcrt.dll__lseek
lea edi, [ebp - 0x58]
cld
mov ecx, 0xe
mov eax, 0
rep stosd dword es:[edi], eax
mov eax, dword [0x45501c]
add eax, 0x10
mov dword [esp + 4], eax
lea ebx, [ebp - 0x58]
mov dword [esp], ebx
call fcn.00409321
mov edx, dword [ebp - 0x5c]
mov eax, dword [edx + 0xfc]
mov dword [esp + 4], eax
lea eax, [ebp - 0x54]
mov dword [esp], eax
call fcn.00409321
mov ecx, dword [ebp - 0x5c]
mov eax, dword [ecx + 0x100]
mov dword [esp + 4], eax
lea eax, [ebp - 0x50]
mov dword [esp], eax
call fcn.00409321
mov edi, dword [ebp - 0x6c]
mov dword [esp + 4], edi
lea eax, [ebp - 0x4c]
mov dword [esp], eax
call fcn.00409321
mov dword [esp + 8], 0x38
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x68]
mov dword [esp], eax
call sub.msvcrt.dll__write
mov edx, dword [ebp - 0x68]
mov dword [esp], edx
call sub.msvcrt.dll__close
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret