Function at 0x412f90
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
push edi
mov edi, dword [0x542fb0]
mov ebx, ecx
push 0xe
push 0x78
xor esi, esi
mov dword [ebp - 0x20], edx
push edi
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x18], esi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x412fd8
call fcn.00440bb0
push eax
push str.icon
push str.Could_not_locate_resource__s:__s
call fcn.004407e0
add esp, 0xc
jmp 0x413019
push eax
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x413001
call fcn.00440bb0
push eax
push str.icon
push str.Could_not_load_resource__s:__s
call fcn.004407e0
add esp, 0xc
jmp 0x413019
push dword [ebp - 0x14]
push edi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_LockResource]
mov esi, eax
mov dword [ebp - 0x18], eax
test ebx, ebx
je 0x41307f
cmp byte [ebx], 0
jne 0x413032
push 2
push 1
call fcn.0049570f
add esp, 8
mov edi, eax
jmp 0x413081
push 0
push 0
push 0xffffffffffffffff
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ebx, eax
cmp ebx, 1
jle 0x41307f
push 2
push ebx
call fcn.0049570f
mov edi, eax
add esp, 8
test edi, edi
je 0x41307f
push ebx
push edi
push 0xffffffffffffffff
push dword [ebp - 0xc]
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
cmp eax, ebx
je 0x413081
push edi
call fcn.004998ec
add esp, 4
xor edi, edi
push 0
push 0x80
push 2
push 0
push 1
push 0xc0000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x10], ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x14], eax
test edi, edi
je 0x4130b8
push edi
call fcn.004998ec
mov eax, dword [ebp - 0x14]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp ebx, 0xffffffff
jne 0x4130e3
call fcn.00440bb0
push eax
push dword [ebp - 0xc]
push str.Unable_to_create_icon__s:__s.
call fcn.004407e0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ecx
lea eax, [ebp - 8]
mov edx, esi
push eax
push 6
mov ecx, ebx
call fcn.004417e0
add esp, 0xc
test eax, eax
jne 0x413114
call fcn.00440bb0
push eax
push str.Could_not_write_icon_header:__s.
call fcn.004407e0
add esp, 8
xor esi, esi
jmp 0x41323f
movzx eax, word [esi + 4]
xor edx, edx
shl eax, 4
xor edi, edi
add eax, 6
mov dword [ebp - 4], eax
movzx eax, word [esi + 4]
mov ecx, eax
cmp dx, ax
jae 0x4131b4
movzx ecx, di
push ecx
mov dword [ebp - 0x14], ecx
lea eax, [ecx*8]
sub eax, ecx
lea ecx, [ebp - 8]
push ecx
push 0xc
mov ecx, ebx
lea eax, [esi + eax*2]
lea edx, [eax + 6]
mov dword [ebp - 0x1c], eax
call fcn.004417e0
add esp, 0xc
test eax, eax
je 0x41326d
mov eax, dword [ebp - 0x1c]
push 3
movzx eax, word [eax + 0x12]
push eax
push dword [0x542fb0]
call dword [sym.imp.KERNEL32.dll_FindResourceA]
push ecx
mov dword [ebp - 0x1c], eax
lea edx, [ebp - 4]
lea eax, [ebp - 8]
mov ecx, ebx
push eax
push 4
call fcn.004417e0
add esp, 0xc
test eax, eax
je 0x413253
push dword [ebp - 0x1c]
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
add dword [ebp - 4], eax
inc edi
movzx eax, word [esi + 4]
cmp di, ax
jb 0x413134
mov ecx, eax
xor eax, eax
xor ebx, ebx
cmp ax, cx
jae 0x413221
lea ecx, [ecx]
movzx ecx, bx
push 3
mov dword [ebp - 0x1c], ecx
lea eax, [ecx*8]
sub eax, ecx
movzx eax, word [esi + eax*2 + 0x12]
push eax
push dword [0x542fb0]
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
push esi
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push esi
push 0
mov edi, eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push ecx
lea ecx, [ebp - 8]
mov edx, edi
push ecx
mov ecx, dword [ebp - 0x10]
push eax
call fcn.004417e0
add esp, 0xc
test eax, eax
je 0x413287
mov esi, dword [ebp - 0x18]
inc ebx
cmp bx, word [esi + 4]
jb 0x4131c0
cmp dword [ebp - 0x20], 0
jne 0x413237
push dword [ebp - 0xc]
push str.Created:__s
call fcn.004407e0
add esp, 8
mov esi, 1
mov ebx, dword [ebp - 0x10]
test ebx, ebx
je 0x41324a
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.00440bb0
push eax
push dword [ebp - 0x14]
push str.Could_not_write_ICONDIRENTRY__d__offset:__s.
call fcn.004407e0
add esp, 0xc
xor esi, esi
jmp 0x41323f
call fcn.00440bb0
push eax
push dword [ebp - 0x14]
push str.Could_not_write_ICONDIRENTRY__d_:__s.
call fcn.004407e0
add esp, 0xc
xor esi, esi
jmp 0x41323f
call fcn.00440bb0
push eax
push dword [ebp - 0x1c]
push str.Could_not_write_icon_data__d:__s.
call fcn.004407e0
add esp, 0xc
xor esi, esi
jmp 0x41323c