Function at 0x503850
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x58ce68
mov eax, dword fs:[0]
push eax
sub esp, 0x10
push ebx
push esi
push edi
mov eax, dword [0x5ed80c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x10]
push 6
push 0
lea ecx, [ebp - 0x14]
push ecx
lea ecx, [ebp + 8]
mov dword [ebp - 4], 0
mov dword [eax], 0
call fcn.00505750
mov eax, dword [eax]
mov ecx, 0x5be2e4
nop
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x5038c6
test dx, dx
je 0x5038c2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x5038c6
add eax, 4
add ecx, 4
test dx, dx
jne 0x5038a0
xor eax, eax
jmp 0x5038cb
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
mov eax, dword [ebp - 0x14]
setne bl
add eax, 0xfffffff0
or edi, 0xffffffff
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x5038f1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
je 0x503928
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov dword [ebp - 4], edi
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edi
dec edi
test edi, edi
jg 0x503914
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 8]
cmp dword [ecx - 0xc], 7
jle 0x503950
add ecx, 0xe
push 0x5c
push ecx
call fcn.0056101e
mov ecx, dword [ebp + 8]
add esp, 8
test eax, eax
je 0x503950
sub eax, ecx
sar eax, 1
mov esi, eax
cmp esi, edi
jne 0x503955
lea eax, [ecx - 0x10]
jmp 0x5038fb
lea ecx, [esi + 1]
push ecx
lea edx, [ebp - 0x10]
push edx
lea ecx, [ebp + 8]
call fcn.00505a20
add esi, 0xfffffffa
push esi
push 6
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp + 8]
mov byte [ebp - 4], 1
call fcn.00505750
mov edi, dword [ebp + 0xc]
mov byte [ebp - 4], 2
test edi, edi
jne 0x503992
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [ebp + 0xc], eax
mov edi, eax
mov ebx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x10]
push ebx
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
je 0x5039b3
push esi
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
jne 0x503a15
add ebx, 0xfffffff0
mov byte [ebp - 4], 1
lea edx, [ebx + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x5039d3
mov ecx, dword [ebx]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebx
call eax
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x5039f6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x503908
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x503a45
add ebx, 0xfffffff0
mov byte [ebp - 4], 1
lea ecx, [ebx + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x5039d3
mov ecx, dword [ebx]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push ebx
call edx
jmp 0x5039d3
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_SizeofResource]
call edi
mov ecx, dword [ebp + 0x10]
push eax
mov dword [ecx], eax
call fcn.00523abd
mov edx, dword [ebp + 0xc]
add esp, 4
push esi
push edx
mov dword [ebp + 0x10], eax
call edi
mov edi, dword [ebp + 0x10]
push eax
mov eax, dword [ebp - 0x1c]
push eax
push edi
call fcn.0055ae50
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_FreeResource]
lea eax, [ebx - 0x10]
mov byte [ebp - 4], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x503a9f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x503ac2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x503ae8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret