Function at 0x140018750
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x68
mov r13, qword [0x1400b4ba0]
xor r8d, r8d
lea r9, str.icon
lea rax, [rsp + 0x54]
mov dword [rsp + 0x28], r8d
mov rdi, rcx
mov r12d, edx
mov qword [rsp + 0x20], rax
mov rcx, qword [r13]
mov r8d, 0xe
mov edx, 0x78
call fcn.140036e5f
mov rsi, rax
test rdi, rdi
je 0x14001882c
cmp byte [rdi], 0
jne 0x1400187bf
mov edx, 2
mov ecx, 1
call sub.msvcrt.dll_calloc
mov rbp, rax
jmp 0x14001882e
xor edx, edx
xor ecx, ecx
mov r15, qword [sym.imp.KERNEL32.DLL_MultiByteToWideChar]
or r9d, 0xffffffff
mov dword [rsp + 0x28], edx
mov r8, rdi
xor edx, edx
mov qword [rsp + 0x20], rcx
mov ecx, 0xfde9
call r15
mov r14d, eax
cmp eax, 1
jle 0x14001882c
movsxd rcx, eax
mov edx, 2
call sub.msvcrt.dll_calloc
mov rbx, rax
mov rbp, rax
test rax, rax
je 0x14001882c
or r9d, 0xffffffff
xor edx, edx
mov dword [rsp + 0x28], r14d
mov r8, rdi
mov qword [rsp + 0x20], rax
mov ecx, 0xfde9
call r15
cmp r14d, eax
je 0x14001882e
mov rcx, rbx
call sub.msvcrt.dll_free
xor ebp, ebp
xor eax, eax
xor r9d, r9d
mov r8d, 1
mov edx, 0xc0000000
mov rcx, rbp
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 2
call qword [sym.imp.KERNEL32.DLL_CreateFileW]
mov rbx, rax
call qword [sym.imp.KERNEL32.DLL_GetLastError]
mov r14d, eax
test rbp, rbp
je 0x140018875
mov rcx, rbp
call sub.msvcrt.dll_free
mov ecx, r14d
call qword [sym.imp.KERNEL32.DLL_SetLastError]
cmp rbx, 0xffffffffffffffff
jne 0x14001889d
call fcn.140038579
mov rdx, rdi
lea rcx, str.Unable_to_create_icon__s:__s.
mov r8, rax
call fcn.1400380b9
jmp 0x1400188db
mov dword [rsp + 0x20], 4
lea rax, [rsp + 0x58]
mov rdx, rsi
mov rcx, rbx
mov r9, rax
mov r8d, 6
mov qword [rsp + 0x40], rax
call fcn.140038ff2
test eax, eax
jne 0x1400188e2
call fcn.140038579
lea rcx, str.Could_not_write_icon_header:__s.
mov rdx, rax
call fcn.1400380b9
xor esi, esi
jmp 0x140018a75
movzx eax, word [rsi + 4]
lea rdx, [rsp + 0x5c]
xor ebp, ebp
mov qword [rsp + 0x48], rdx
shl eax, 4
add eax, 6
mov dword [rsp + 0x5c], eax
cmp bp, word [rsi + 4]
jae 0x1400189bc
movzx eax, bp
mov r9, qword [rsp + 0x40]
mov rcx, rbx
movzx r15d, bp
imul rax, rax, 0xe
mov dword [rsp + 0x20], 4
mov r8d, 0xc
lea rdx, [rsi + rax + 6]
call fcn.140038ff2
test eax, eax
jne 0x14001894c
call fcn.140038579
mov edx, r15d
lea rcx, str.Could_not_write_ICONDIRENTRY__d_:__s.
mov r8, rax
jmp 0x140018a4e
movsxd rax, r15d
mov rcx, qword [r13]
mov r8d, 3
imul rax, rax, 0xe
movzx edx, word [rsi + rax + 0x12]
call qword [sym.imp.KERNEL32.DLL_FindResourceA]
mov dword [rsp + 0x20], 4
mov r9, qword [rsp + 0x40]
mov r8d, 4
mov rdx, qword [rsp + 0x48]
mov rcx, rbx
mov r14, rax
call fcn.140038ff2
test eax, eax
jne 0x1400189a6
call fcn.140038579
mov edx, r15d
lea rcx, str.Could_not_write_ICONDIRENTRY__d__offset:__s.
mov r8, rax
jmp 0x140018a4e
mov rdx, r14
xor ecx, ecx
inc ebp
call qword [sym.imp.KERNEL32.DLL_SizeofResource]
add eax, dword [rsp + 0x5c]
jmp 0x1400188f8
xor r15d, r15d
jmp 0x1400189c4
inc r15d
cmp r15w, word [rsi + 4]
jae 0x140018a58
movzx eax, r15w
mov r8d, 3
mov rcx, qword [r13]
movzx r14d, r15w
imul rax, rax, 0xe
movzx edx, word [rsi + rax + 0x12]
call qword [sym.imp.KERNEL32.DLL_FindResourceA]
xor ecx, ecx
mov rdx, rax
mov qword [rsp + 0x48], rax
call qword [sym.imp.KERNEL32.DLL_LoadResource]
mov rcx, rax
call qword [sym.imp.KERNEL32.DLL_LockResource]
xor ecx, ecx
mov rdx, qword [rsp + 0x48]
mov rbp, rax
call qword [sym.imp.KERNEL32.DLL_SizeofResource]
mov r9, qword [rsp + 0x40]
mov rdx, rbp
mov rcx, rbx
mov dword [rsp + 0x20], 4
mov r8d, eax
mov dword [rsp + 0x54], eax
call fcn.140038ff2
test eax, eax
jne 0x1400189c1
call fcn.140038579
mov edx, r14d
lea rcx, str.Could_not_write_icon_data__d:__s.
mov r8, rax
call fcn.1400380b9
jmp 0x1400188db
test r12d, r12d
je 0x140018a64
mov esi, 1
jmp 0x140018a75
mov rdx, rdi
lea rcx, str.Created:__s
call fcn.1400380b9
jmp 0x140018a5d
lea rax, [rbx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140018a88
mov rcx, rbx
call qword [sym.imp.KERNEL32.DLL_CloseHandle]
mov eax, esi
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret