Function at 0x5406d0
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Get file attributes

Disassembly:
push 0xffffffffffffffff
push 0x57cd8a
mov eax, dword fs:[0]
push eax
push ecx
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5e68f0]
xor eax, esp
push eax
lea eax, [esp + 0x18]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [esi]
mov edx, dword [eax + 0x58]
call edx
mov ebx, dword [esp + 0x28]
lea ebp, [esi + 0x30]
test ebx, ebx
jne 0x54070d
xor eax, eax
jmp 0x540721
mov eax, ebx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x540712
sub eax, edx
sar eax, 1
push eax
push ebx
mov ecx, ebp
call fcn.00408080
mov edx, dword [esp + 0x2c]
lea edi, [esi + 0x34]
test edx, edx
jne 0x540739
xor eax, eax
jmp 0x540753
mov eax, edx
lea ebx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x540740
sub eax, ebx
mov ebx, dword [esp + 0x28]
sar eax, 1
push eax
push edx
mov ecx, edi
call fcn.00408080
mov ecx, dword [esi + 0x2c]
test ecx, ecx
jne 0x54088d
mov eax, dword [ebp]
cmp dword [eax - 0xc], ecx
je 0x540833
push 0x5c
lea ecx, [esp + 0x30]
push ebp
push ecx
call fcn.00540200
push edi
push eax
lea edx, [esp + 0x3c]
xor ebp, ebp
push edx
mov dword [esp + 0x38], ebp
call fcn.0040b2a0
add esp, 0x18
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
mov byte [esp + 0x20], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x5407ba
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [edi]
cmp dword [ecx - 0xc], ebp
je 0x540848
mov edx, dword [esp + 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x540848
test al, 0x10
jne 0x540848
push 0x14
call fcn.0040d49d
add esp, 4
mov dword [esp + 0x14], eax
mov byte [esp + 0x20], 3
cmp eax, ebp
je 0x5407f9
mov ecx, eax
call fcn.00505ae9
jmp 0x5407fb
xor eax, eax
mov ecx, dword [esp + 0x28]
push ebp
mov dword [esi + 0x3c], eax
mov edx, dword [eax]
mov edx, dword [edx + 0x20]
push ebp
push ecx
mov ecx, eax
mov byte [esp + 0x2c], 2
call edx
test eax, eax
jne 0x54083a
mov ecx, dword [esi + 0x3c]
cmp ecx, ebp
je 0x54082a
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push 1
call edx
mov dword [esi + 0x3c], ebp
lea ecx, [esp + 0x28]
call fcn.00401790
xor eax, eax
jmp 0x5409d3
lea ecx, [esp + 0x28]
call fcn.00401790
jmp 0x5409ce
push ebx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [esi + 0x28], eax
cmp eax, ebp
jne 0x540863
push 2
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov dword [esi + 0x28], eax
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
mov dword [esp + 0x20], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x54089b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x54089b
mov edx, dword [edi]
mov eax, dword [edx - 0xc]
neg eax
sbb eax, eax
and eax, ecx
mov dword [esi + 0x28], eax
cmp dword [esi + 0x28], 0
je 0x540833
mov eax, dword [edi]
cmp dword [eax - 0xc], 0
jne 0x5408ed
lea ecx, [esp + 0x14]
push ecx
mov ecx, esi
call fcn.005405c0
push eax
mov ecx, edi
mov dword [esp + 0x24], 4
call fcn.0040b710
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov dword [esp + 0x20], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x5408ed
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [edi]
sub eax, 0x10
push eax
call fcn.0040b6a0
add eax, 0x10
add esp, 4
mov dword [esp + 0x28], eax
push 0x5f
push 0x2e
lea ecx, [esp + 0x30]
mov dword [esp + 0x28], 5
call fcn.00540160
push 0x5f
push 0x5c
lea ecx, [esp + 0x30]
call fcn.00540160
mov ebp, dword [esp + 0x28]
mov ecx, dword [esi + 0x28]
push str.TEXTFILE
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov edi, eax
test edi, edi
jne 0x540967
add ebp, 0xfffffff0
mov dword [esp + 0x20], 0xffffffff
lea edx, [ebp + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x540963
mov ecx, dword [ebp]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebp
call eax
xor eax, eax
jmp 0x5409d3
mov ecx, dword [esi + 0x28]
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
je 0x54093e
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ecx, dword [esi + 0x28]
push edi
push ecx
mov dword [esi + 0x20], eax
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
shr eax, 1
lea edx, [ebx + eax*2]
mov dword [esi + 0x24], edx
test ebx, ebx
je 0x5409a9
mov eax, 0xfeff
cmp word [ebx], ax
jne 0x5409a9
add ebx, 2
mov dword [esi + 0x20], ebx
add ebp, 0xfffffff0
mov dword [esp + 0x20], 0xffffffff
lea ecx, [ebp + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x5409ce
mov ecx, dword [ebp]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push ebp
call edx
mov eax, 1
mov ecx, dword [esp + 0x18]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 8