Function at 0x40c5c0
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov edx, dword [0x5430c0]
xor eax, eax
push ebx
push esi
mov dword [ebp - 0x14], eax
mov esi, edx
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov eax, dword [0x543770]
mov dword [ebp - 8], 0x200
mov dword [ebp - 0x18], ecx
mov dword [0x4f435c], eax
push edi
cmp eax, 0x200
jb 0x40c5fe
cmp eax, 0x10000
jbe 0x40c608
mov dword [0x4f435c], 0x200
cmp esi, 3
jne 0x40c635
cmp word [0x54365c], 0
jne 0x40c635
cmp byte [0x54364b], 0
mov eax, 7
cmovne esi, eax
cmp byte [0x54364c], 0
mov eax, 8
cmovne esi, eax
test edx, edx
je 0x40c69e
cmp dword [0x542e74], 1
jne 0x40c69e
mov esi, 0xa
push str.Writing_protective_message_SBR
call fcn.004407e0
mov ecx, dword [0x542fb0]
lea eax, [ebp - 4]
add esp, 4
mov dword [ebp - 4], 0x1000
mov edx, 0x1c4
mov dword [ebp - 8], 0x4400
push 1
push eax
push str.msg.txt
push 0xa
call fcn.0043f5c0
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x40c6bf
push str.Could_not_access_message
call fcn.004407e0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, esi
sub eax, 7
je 0x40c7cf
sub eax, 1
je 0x40c6c7
sub eax, 2
je 0x40c647
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 4]
jmp 0x40c870
mov ecx, dword [0x4fa960]
test ecx, ecx
je 0x40c70a
mov edx, dword [0x543750]
call fcn.0043d6c0
test eax, eax
mov edx, 0x4d04fc
mov ecx, 0x4d04f8
cmove ecx, edx
push ecx
push str.Writing_Grub_2.0_SBR__from_download___s
call fcn.004407e0
mov ebx, dword [0x4fa960]
add esp, 8
mov edi, dword [0x543750]
jmp 0x40c870
push str.Writing_Grub_2.0_SBR__from_embedded_
call fcn.004407e0
mov edi, dword [0x542fb0]
add esp, 4
push 0xa
push 0x1c3
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov ebx, eax
test ebx, ebx
jne 0x40c75f
call fcn.00440bb0
push eax
push str.core.img
push str.Could_not_locate_resource__s:__s
call fcn.004407e0
add esp, 0xc
push str.Could_not_access_core.img
call fcn.004407e0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 4], eax
test eax, eax
jne 0x40c79c
call fcn.00440bb0
push eax
push str.core.img
push str.Could_not_load_resource__s:__s
call fcn.004407e0
add esp, 0xc
push str.Could_not_access_core.img
call fcn.004407e0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push dword [ebp - 4]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ebx, eax
test ebx, ebx
jne 0x40c870
push str.Could_not_access_core.img
call fcn.004407e0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.Writing_Grub4Dos_SBR
call fcn.004407e0
mov edi, dword [0x542fb0]
add esp, 4
push 0xa
push 0x1c2
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov ebx, eax
test ebx, ebx
jne 0x40c824
call fcn.00440bb0
push eax
push str.grldr.mbr
push str.Could_not_locate_resource__s:__s
call fcn.004407e0
add esp, 0xc
push str.grldr.mbr_is_either_not_present_or_too_small
call fcn.004407e0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 4], eax
test eax, eax
jne 0x40c845
call fcn.00440bb0
push eax
push str.grldr.mbr
push str.Could_not_load_resource__s:__s
jmp 0x40c806
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push dword [ebp - 4]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_LockResource]
test eax, eax
je 0x40c80e
cmp edi, 0x200
jbe 0x40c80e
lea ebx, [eax + 0x200]
sub edi, 0x200
mov ecx, dword [ebp - 8]
lea eax, [edi + ecx]
cmp eax, dword [0x543788]
jbe 0x40c8a2
push str.__SBR_size_is_too_large___You_may_need_to_uncheck_Add_fixes_for_old_BIOSes.
call fcn.004407e0
add esp, 4
cmp esi, 0xa
jne 0x40c81b
push ebx
call fcn.004998ec
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push edi
push 0
push ecx
mov edx, ebx
lea ecx, [ebp - 0x18]
call fcn.0045d940
push dword [0x4fa960]
mov edi, eax
call fcn.004998ec
add esp, 0x14
mov dword [0x4fa960], 0
cmp esi, 0xa
jne 0x40c8da
push ebx
call fcn.004998ec
add esp, 4
xor eax, eax
test edi, edi
pop edi
pop esi
setne al
pop ebx
mov esp, ebp
pop ebp
ret