Function at 0x4047b1
Capabilities:
Extract resource via kernel32 functions
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push 0x2a4
xor ebx, ebx
push ebx
call edi
mov esi, eax
cmp esi, ebx
je 0x404800
push 0xa4
push ebx
push esi
call fcn.00559c50
add esp, 0xc
cmp dword [ebp + 0x18], ebx
je 0x404812
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
inc eax
push eax
push ebx
call edi
mov dword [esi + 0x30], eax
cmp eax, ebx
jne 0x404808
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push 2
pop edi
jmp 0x404b66
push dword [ebp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [ebp + 0x14]
or dword [esi + 0x24], 0xffffffff
and eax, 0x3ffffff7
dec eax
je 0x4048b4
dec eax
je 0x40485a
dec eax
dec eax
jne 0x40491a
push 2
push ebx
push ebx
lea edi, [esi + 4]
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x404893
mov eax, dword [ebp + 0xc]
mov dword [edi], eax
jmp 0x404899
push ebx
push 0x80
push 3
push ebx
mov eax, SysReAllocStringLen
push 1
push eax
push dword [ebp + 0xc]
lea edi, [esi + 4]
test dword [ebp + 0x14], eax
je 0x40487e
call dword [sym.imp.KERNEL32.dll_CreateFileW]
jmp 0x404884
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [edi], eax
cmp eax, 0xffffffff
jne 0x404893
xor edi, edi
inc edi
jmp 0x404b5f
mov dword [esi], 2
push 1
push ebx
push ebx
push dword [edi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esi + 0xc], eax
cmp eax, 0xffffffff
jne 0x40491a
push 0x10
jmp 0x404b5e
mov eax, dword [ebp + 0xc]
mov dword [esi + 4], eax
cmp eax, ebx
je 0x4048c3
mov eax, dword [ebp + 0x10]
jmp 0x404911
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov edi, eax
movzx eax, word [ebp + 0x10]
push 0xa
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov dword [ebp - 0x14], eax
cmp eax, ebx
je 0x404b5c
push eax
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, ebx
je 0x404b5c
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [esi + 4], eax
cmp eax, ebx
je 0x404b05
push dword [ebp - 0x14]
push edi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [esi + 0x10], eax
mov dword [esi], 1
test byte [ebp + 0x14], 8
je 0x404947
push 0x2a
lea eax, [esi + 0x38]
push ebx
push eax
call fcn.00559c50
add esp, 0xc
or dword [esi], 8
push 8
pop eax
mov word [esi + 0x3e], ax
mov eax, dword [esi + 0xc]
mov dword [esi + 0x5e], eax
mov dword [esi + 0x24], ebx
jmp 0x404b10
test byte [esi], 1
jne 0x404963
push 2
push ebx
push ebx
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, eax
sub edi, dword [esi + 0xc]
mov dword [ebp - 0xc], edi
jmp 0x40496e
mov eax, dword [esi + 0x10]
mov dword [esi + 0x14], eax
mov dword [ebp - 0xc], eax
mov edi, eax
mov eax, 0xffff
mov dword [ebp - 4], eax
cmp edi, eax
jae 0x40497d
mov dword [ebp - 4], edi
push 0x404
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 0x10], eax
cmp eax, ebx
je 0x404b05
push 4
pop eax
cmp dword [ebp - 4], eax
jbe 0x404a23
jmp 0x4049a8
mov edi, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
add eax, 0x400
mov dword [ebp - 8], ecx
cmp eax, ecx
ja 0x4049ba
mov dword [ebp - 8], eax
mov ebx, edi
sub ebx, dword [ebp - 8]
mov eax, 0x404
sub edi, ebx
mov dword [ebp - 0x14], eax
cmp edi, eax
ja 0x4049d0
mov dword [ebp - 0x14], edi
xor edi, edi
mov eax, ebx
mov ecx, esi
call fcn.00403648
test eax, eax
jne 0x404a21
mov edi, dword [ebp - 0x14]
push dword [ebp - 0x10]
mov eax, edi
call fcn.0040368a
pop ecx
test eax, eax
je 0x404a21
add edi, 0xfffffffd
js 0x404a19
mov eax, dword [ebp - 0x10]
dec edi
cmp byte [edi + eax], 0x50
jne 0x404a15
cmp byte [edi + eax + 1], 0x4b
jne 0x404a15
cmp byte [edi + eax + 2], 5
jne 0x404a15
cmp byte [edi + eax + 3], 6
je 0x404a53
test edi, edi
jge 0x4049f6
mov eax, dword [ebp - 4]
cmp dword [ebp - 8], eax
jb 0x4049a2
xor ebx, ebx
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor edi, edi
xor eax, eax
mov ecx, esi
call fcn.00403648
mov eax, esi
call fcn.004036fe
mov ecx, 0x8b1f
cmp ax, cx
je 0x404b09
push 6
jmp 0x404b5e
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
add ebx, edi
xor edi, edi
mov eax, ebx
mov ecx, esi
call fcn.00403648
mov eax, esi
call fcn.0040375c
mov eax, esi
call fcn.004036fe
movzx eax, ax
mov dword [ebp - 0x14], eax
mov eax, esi
call fcn.004036fe
movzx edi, ax
mov eax, esi
call fcn.004036fe
movzx eax, ax
mov dword [esi + 0x18], eax
mov eax, esi
call fcn.004036fe
cmp dword [esi + 8], 0
movzx eax, ax
jne 0x404a4c
movzx eax, ax
cmp eax, dword [esi + 0x18]
jne 0x404b01
test di, di
jne 0x404b01
cmp word [ebp - 0x14], di
jne 0x404b01
mov eax, esi
call fcn.0040375c
mov edi, eax
mov eax, esi
mov dword [ebp - 0x14], edi
call fcn.0040375c
mov dword [esi + 0x2c], eax
mov eax, esi
call fcn.004036fe
cmp dword [esi + 8], 0
movzx eax, ax
mov dword [esi + 0x1c], eax
jne 0x404a4c
mov ecx, dword [esi + 0x2c]
mov eax, dword [esi + 0xc]
lea edx, [ecx + edi]
lea edi, [eax + ebx]
cmp edi, edx
jb 0x404a4c
sub eax, ecx
sub eax, dword [ebp - 0x14]
add eax, ebx
xor ebx, ebx
jmp 0x404b20
push 8
jmp 0x404b5e
push 2
jmp 0x404b5e
mov dword [esi + 0x2c], 3
mov eax, dword [esi + 0xc]
or dword [esi], 4
mov dword [esi + 8], ebx
mov dword [esi + 0x18], 1
mov dword [esi + 0x20], eax
lea eax, [esi + 0xa4]
push eax
push 0x1ff
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
cmp eax, ebx
je 0x404b43
cmp byte [eax + esi + 0xa3], 0x5c
je 0x404b53
add eax, esi
mov byte [eax + 0xa4], 0x5c
mov byte [eax + 0xa5], 0
mov eax, dword [ebp + 8]
mov dword [eax], esi
xor eax, eax
jmp 0x404b68
push 4
pop edi
mov eax, esi
call fcn.004046a8
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret