Function at 0x140002480
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, 0x78
mov rbx, rdx
movzx edx, word [r8 + 4]
mov rsi, rcx
mov rdi, r8
mov qword [rsp + 0x68], 0
test dx, dx
je 0x1400029b5
lea ecx, [rdx - 1]
lea rax, [r8 + 0xe]
lea rdx, [rcx*8]
sub rdx, rcx
xor ecx, ecx
lea r8, [r8 + rdx*2 + 0x1c]
nop dword [rax]
mov edx, dword [rax]
add rax, 0xe
add rcx, rdx
cmp r8, rax
jne 0x1400024d0
call dbg.xmalloc
movzx ecx, word [rdi + 4]
mov qword [rsp + 0x38], rax
shl rcx, 4
call dbg.xmalloc
xor ecx, ecx
lea r8, [rsp + 0x68]
mov edx, 1
mov qword [rsp + 0x30], rax
call qword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
js 0x1400028a0
test rsi, rsi
je 0x140002670
cmp word [rdi + 4], 0
je 0x140002790
lea rbx, [rdi + 6]
xor r13d, r13d
xor ebp, ebp
xor r14d, r14d
lea r15, [0x140010000]
lea r12, str.populate_module16_icons
nop word [rax + rax]
mov r8, qword [rsi + 0x10]
movzx edx, word [r8 + 2]
lea rax, [r8 + 8]
test dx, dx
je 0x1400025a0
mov ecx, dword [rsi + 8]
mov r11, qword [rsi]
sub edx, 1
lea rdx, [rdx + rdx*2]
mov r10, rcx
lea r8, [r8 + rdx*4 + 0x14]
add rcx, r11
mov r9, rax
add rax, 0xc
cmp rax, rcx
ja 0x1400027e8
movzx edx, word [rbx + 0xc]
or dx, 0x8000
cmp word [rax - 6], dx
je 0x140002810
cmp rax, r8
jne 0x140002572
nop word [rax + rax]
movzx eax, word [rdi + 4]
add r14d, 1
add rbx, 0xe
cmp r14d, eax
jl 0x140002548
test ebp, ebp
je 0x140002790
mov rcx, qword [rsp + 0x68]
mov word [rsp + 0x66], bp
lea rsi, [rsp + 0x5c]
lea rdx, [rsp + 0x62]
mov dword [rsp + 0x62], 0x10000
mov r9, rsi
mov r8d, 6
mov rax, qword [rcx]
call qword [rax + 0x20]
mov ebx, eax
test eax, eax
js 0x1400029bc
cmp dword [rsp + 0x5c], 6
je 0x1400028fd
test byte [0x140010000], 2
je 0x14000279d
mov dword [rsp + 0x20], ebx
lea r9, str.error_0x_08lX_writing_icon_stream_n
lea r8, global___func__.7
mov ecx, 1
lea rdx, [0x140010000]
call sym.wine_dbg_log.constprop.0
mov rdi, qword gs:[0x30]
mov rax, qword [rdi + 0x60]
xor edx, edx
mov r8, qword [rsp + 0x38]
mov rsi, qword [sym.imp.kernel32.dll_HeapFree]
mov rcx, qword [rax + 0x30]
call rsi
mov rax, qword [rdi + 0x60]
xor edx, edx
mov r8, qword [rsp + 0x30]
mov rcx, qword [rax + 0x30]
call rsi
test ebx, ebx
jns 0x1400027cf
jmp 0x1400028df
test rbx, rbx
je 0x140002790
cmp word [rdi + 4], 0
je 0x140002790
xor r13d, r13d
mov r14, qword [sym.imp.kernel32.dll_FindResourceW]
lea r15, [rdi + 6]
xor ebp, ebp
mov qword [rsp + 0x40], r13
xor esi, esi
nop dword [rax + rax]
movzx edx, word [r15 + 0xc]
mov r8d, 3
mov rcx, rbx
call r14
mov r12, rax
test rax, rax
je 0x140002768
mov rdx, rax
mov rcx, rbx
call qword [sym.imp.kernel32.dll_LoadResource]
mov r13, rax
test rax, rax
je 0x140002768
mov eax, dword [r12 + 4]
mov rcx, r13
mov r12d, dword [r15 + 8]
mov dword [rsp + 0x4c], eax
call qword [sym.imp.kernel32.dll_LockResource]
mov rdx, rax
test rax, rax
je 0x14000275f
mov eax, dword [rsp + 0x4c]
movzx ecx, byte [r15]
mov r9, qword [rsp + 0x40]
cmp eax, r12d
cmovbe r12, rax
movsxd rax, ebp
add ebp, 1
shl rax, 4
add rax, qword [rsp + 0x30]
mov byte [rax], cl
movzx ecx, byte [r15 + 1]
mov r8, r12
mov dword [rax + 8], r12d
mov byte [rax + 1], cl
movzx ecx, byte [r15 + 2]
mov dword [rax + 0xc], r9d
mov byte [rax + 2], cl
movzx ecx, byte [r15 + 3]
mov byte [rax + 3], cl
movzx ecx, word [r15 + 4]
mov word [rax + 4], cx
movzx ecx, word [r15 + 6]
mov word [rax + 6], cx
mov rcx, qword [rsp + 0x38]
add rcx, r9
call sym.memcpy
add qword [rsp + 0x40], r12
mov rcx, r13
call qword [sym.imp.kernel32.dll_FreeResource]
movzx eax, word [rdi + 4]
add esi, 1
add r15, 0xe
cmp esi, eax
jl 0x1400026a0
mov r13, qword [rsp + 0x40]
test ebp, ebp
jne 0x1400025b9
nop dword [rax + rax]
test byte [0x140010000], 2
jne 0x1400029ce
mov rsi, qword gs:[0x30]
mov rax, qword [rsi + 0x60]
mov r8, qword [rsp + 0x38]
xor edx, edx
mov rbx, qword [sym.imp.kernel32.dll_HeapFree]
mov rcx, qword [rax + 0x30]
call rbx
mov rax, qword [rsi + 0x60]
mov r8, qword [rsp + 0x30]
xor edx, edx
mov rcx, qword [rax + 0x30]
call rbx
mov rax, qword [rsp + 0x68]
add rsp, 0x78
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
test byte [r15], 4
je 0x1400025a0
lea r9, str.file_too_small_for_icon_NE_NAMEINFO_n
mov r8, r12
mov rdx, r15
mov ecx, 2
call sym.wine_dbg_log.constprop.0
jmp 0x1400025a0
movzx ecx, word [rsi + 0x18]
movzx eax, word [r9]
mov r8d, dword [rbx + 8]
shl eax, cl
add eax, r8d
cmp r10d, eax
jb 0x140002a5f
movzx edx, byte [rbx]
movsxd rax, ebp
mov qword [rsp + 0x40], r8
add ebp, 1
shl rax, 4
add rax, qword [rsp + 0x30]
mov byte [rax], dl
movzx edx, byte [rbx + 1]
mov dword [rax + 8], r8d
mov byte [rax + 1], dl
movzx edx, byte [rbx + 2]
mov dword [rax + 0xc], r13d
mov byte [rax + 2], dl
movzx edx, byte [rbx + 3]
mov byte [rax + 3], dl
movzx edx, word [rbx + 4]
mov word [rax + 4], dx
movzx edx, word [rbx + 6]
mov word [rax + 6], dx
mov rax, qword [rsp + 0x38]
lea r10, [rax + r13]
movzx eax, word [r9]
shl eax, cl
mov rcx, r10
movsxd rdx, eax
add rdx, r11
call sym.memcpy
mov r8, qword [rsp + 0x40]
add r13, r8
jmp 0x1400025a0
test byte [0x140010000], 2
jne 0x140002991
mov rsi, qword gs:[0x30]
mov rax, qword [rsi + 0x60]
mov r8, qword [rsp + 0x38]
xor edx, edx
mov rbx, qword [sym.imp.kernel32.dll_HeapFree]
mov rcx, qword [rax + 0x30]
call rbx
mov rax, qword [rsi + 0x60]
mov r8, qword [rsp + 0x30]
xor edx, edx
mov rcx, qword [rax + 0x30]
call rbx
mov rax, qword [rsp + 0x68]
test rax, rax
je 0x1400027d4
mov rdx, qword [rax]
mov rcx, rax
call qword [rdx + 0x10]
xor eax, eax
jmp 0x1400027d4
mov rdi, qword [rsp + 0x30]
mov r8d, ebp
lea edx, [rbp - 1]
shl r8d, 4
shl rdx, 4
lea ecx, [r8 + 6]
lea rax, [rdi + 0xc]
lea rdx, [rdi + rdx + 0x1c]
nop dword [rax]
add dword [rax], ecx
add rax, 0x10
cmp rdx, rax
jne 0x140002920
mov rcx, qword [rsp + 0x68]
mov rdx, qword [rsp + 0x30]
mov r9, rsi
mov rax, qword [rcx]
call qword [rax + 0x20]
mov ebx, eax
test eax, eax
js 0x140002a90
movsxd rax, ebp
mov edx, dword [rsp + 0x5c]
shl rax, 4
cmp rdx, rax
je 0x1400029f2
test byte [0x140010000], 2
je 0x14000279d
mov dword [rsp + 0x20], ebx
lea r9, str.error_0x_08lX_writing_icon_dir_entries_to_stream_n
lea r8, global___func__.7
mov ecx, 1
lea rdx, [0x140010000]
call sym.wine_dbg_log.constprop.0
jmp 0x140002629
lea r9, str.error_creating_icon_stream_n
lea r8, global___func__.7
mov ecx, 1
lea rdx, [0x140010000]
call sym.wine_dbg_log.constprop.0
jmp 0x1400028ad
xor ecx, ecx
jmp 0x1400024de
test byte [0x140010000], 2
je 0x1400028ad
jmp 0x140002606
lea r9, str.no_valid_icon_entries_n
lea r8, global___func__.7
mov ecx, 1
lea rdx, [0x140010000]
call sym.wine_dbg_log.constprop.0
jmp 0x14000279d
mov rcx, qword [rsp + 0x68]
mov rdx, qword [rsp + 0x38]
mov r9, rsi
mov r8d, r13d
mov rax, qword [rcx]
call qword [rax + 0x20]
mov ebx, eax
test eax, eax
js 0x140002a50
mov eax, dword [rsp + 0x5c]
cmp rax, r13
je 0x140002aa2
test byte [0x140010000], 2
je 0x14000279d
mov dword [rsp + 0x20], ebx
lea r9, str.error_0x_08lX_writing_icon_images_to_stream_n
lea r8, global___func__.7
mov ecx, 1
lea rdx, [0x140010000]
call sym.wine_dbg_log.constprop.0
jmp 0x140002629
test byte [0x140010000], 2
je 0x1400028ad
jmp 0x140002a28
test byte [0x140010000], 4
je 0x1400025b1
lea r9, str.file_too_small_for_icon_contents_n
lea r8, str.populate_module16_icons
mov ecx, 2
lea rdx, [0x140010000]
call sym.wine_dbg_log.constprop.0
jmp 0x1400025b1
test byte [0x140010000], 2
je 0x1400028ad
jmp 0x140002969
mov rcx, qword [rsp + 0x68]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rax, qword [rcx]
call qword [rax + 0x28]
mov ebx, eax
jmp 0x140002629