Function at 0x404670
Capabilities:
Extract resource via kernel32 functions

Disassembly:
mov rax, rsp
sub rsp, 0x78
mov qword [rsp + 0x20], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov qword [rax - 8], r12
cmp dword [0x0046e640], 0
jne 0x40490d
lea rcx, [0x0046ef50]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x0046e640], 0
jne 0x404900
xor ebp, ebp
mov qword [rsp + 0x30], rbp
mov dword [rsp + 0x38], ebp
lea r12, [0x004555a0]
mov qword [rsp + 0x28], r12
mov dword [rsp + 0x40], ebp
xor edx, edx
lea rcx, [rsp + 0x28]
call qword [0x004555a8]
nop
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov rdi, rax
mov edx, 0x80
lea r8d, [rbp + 0xa]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_FindResourceA]
mov rsi, rax
test rax, rax
jne 0x404731
mov qword [rsp + 0x28], r12
mov rcx, qword [rsp + 0x30]
mov qword [rsp + 0x30], rbp
mov dword [rsp + 0x38], ebp
mov dword [rsp + 0x40], ebp
test rcx, rcx
je 0x40472a
call fcn.00429ab0
xor eax, eax
jmp 0x404912
mov rdx, rax
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SizeofResource]
movsxd rbx, eax
mov rdx, rsi
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LoadResource]
test rax, rax
jne 0x404779
mov qword [rsp + 0x28], r12
mov rcx, qword [rsp + 0x30]
mov qword [rsp + 0x30], rbp
mov dword [rsp + 0x38], ebp
mov dword [rsp + 0x40], ebp
test rcx, rcx
je 0x404772
call fcn.00429ab0
xor eax, eax
jmp 0x404912
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_LockResource]
mov rdi, rax
test rax, rax
jne 0x4047b2
mov qword [rsp + 0x28], r12
mov rcx, qword [rsp + 0x30]
mov qword [rsp + 0x30], rbp
mov dword [rsp + 0x38], ebp
mov dword [rsp + 0x40], ebp
test rcx, rcx
je 0x4047ab
call fcn.00429ab0
xor eax, eax
jmp 0x404912
mov ecx, dword [rsp + 0x40]
cmp ebx, ecx
jle 0x4047fb
mov eax, 8
cmp ecx, eax
cmovl ecx, eax
mov dword [rsp + 0x40], ecx
cmp ebx, ecx
jle 0x4047e4
add ecx, ecx
mov dword [rsp + 0x40], ecx
cmp ebx, ecx
jle 0x4047e4
lea ecx, [rbx + 0xb]
mov eax, ecx
and eax, 7
sub ecx, eax
mov dword [rsp + 0x40], ecx
movsxd rdx, ecx
mov rcx, qword [rsp + 0x30]
call fcn.004296b0
mov rdx, rax
mov qword [rsp + 0x30], rax
jmp 0x404800
mov rdx, qword [rsp + 0x30]
mov eax, ebx
mov dword [rsp + 0x38], ebx
mov r8, rbp
test ebx, ebx
jle 0x40483d
jmp 0x404815
mov rdx, qword [rsp + 0x30]
movzx eax, byte [r8 + rdi]
movzx ecx, al
sar cl, 6
and cl, 3
shl al, 2
or cl, al
mov byte [rdx + r8], cl
inc r8
cmp r8, rbx
jl 0x404810
mov eax, dword [rsp + 0x38]
mov rdx, qword [rsp + 0x30]
test eax, eax
jne 0x404867
mov qword [rsp + 0x28], r12
mov qword [rsp + 0x30], rbp
mov dword [rsp + 0x38], ebp
mov dword [rsp + 0x40], ebp
test rdx, rdx
je 0x404860
mov rcx, rdx
call fcn.00429ab0
xor eax, eax
jmp 0x404912
mov qword [rsp + 0x30], rbp
mov dword [rsp + 0x38], ebp
mov dword [rsp + 0x40], ebp
mov r8d, ebx
lea rcx, [0x0046e650]
call fcn.00424080
lea rdx, [rsp + 0x48]
mov rcx, qword [0x0046ef88]
call fcn.00404560
mov rbx, rax
mov rax, qword [rax]
mov edx, dword [rbx + 0x10]
mov rcx, rbx
call qword [rax + 8]
mov rdx, qword [rbx + 8]
lea rcx, [0x0046ead0]
call fcn.004244e0
nop
mov qword [rsp + 0x48], r12
mov rcx, qword [rsp + 0x50]
mov qword [rsp + 0x50], rbp
mov dword [rsp + 0x58], ebp
mov dword [rsp + 0x60], ebp
test rcx, rcx
je 0x4048d5
call fcn.00429ab0
mov dword [0x0046e640], 1
mov qword [rsp + 0x28], r12
mov rcx, qword [rsp + 0x30]
mov qword [rsp + 0x30], rbp
mov dword [rsp + 0x38], ebp
mov dword [rsp + 0x40], ebp
test rcx, rcx
je 0x404900
call fcn.00429ab0
lea rcx, [0x0046ef50]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 1
mov rbx, qword [rsp + 0x80]
mov rbp, qword [rsp + 0x88]
mov rsi, qword [rsp + 0x90]
mov rdi, qword [rsp + 0x98]
mov r12, qword [rsp + 0x70]
add rsp, 0x78
ret