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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x3c
mov eax, dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push ebx
push esi
push edi
push 0x218
push 0
mov ebx, edx
mov dword [esp + 0x44], ecx
mov byte [esp + 0x17], 0
mov dword [esp + 0x2c], eax
call eax
mov edi, eax
test edi, edi
je 0x4200b3
push 0x114
push 0
push edi
call sub.VCRUNTIME140.dll_memset
mov esi, dword [ebp + 0x10]
add esp, 0xc
test esi, esi
je 0x4200c9
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
inc eax
push eax
push 0
call dword [esp + 0x2c]
mov dword [edi + 0x48], eax
test eax, eax
jne 0x4200c1
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov esi, 2
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ecx, dword [ebp + 0xc]
mov eax, ecx
and eax, 0x3ffffff7
mov dword [edi + 0x30], 0xffffffff
mov dword [edi + 0x34], 0xffffffff
mov dword [esp + 0x30], ecx
sub eax, 1
je 0x420197
sub eax, 1
je 0x420122
sub eax, 2
jne 0x4201ff
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea eax, [edi + 4]
push 2
push 0
push 0
push eax
call esi
push eax
push ebx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x420164
mov dword [edi + 4], ebx
jmp 0x42016d
push 0
push 0x80
push 3
push 0
push 3
push connect
push ebx
test ecx, ecx
jns 0x420141
call dword [sym.imp.KERNEL32.dll_CreateFileW]
jmp 0x420147
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [edi + 4], eax
cmp eax, 0xffffffff
jne 0x420164
mov ecx, edi
mov esi, 1
call fcn.0041ff50
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [edi + 4]
mov dword [edi], 2
push 1
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [edi + 0xc], eax
cmp eax, 0xffffffff
jne 0x4201ff
mov ecx, edi
mov esi, 0x10
call fcn.0041ff50
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [edi + 4], ebx
test ebx, ebx
je 0x4201a3
mov eax, dword [ebp + 8]
jmp 0x4201ef
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
movzx ecx, word [ebp + 8]
mov esi, eax
push 0xa
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov ebx, eax
test ebx, ebx
je 0x420742
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
je 0x420742
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [edi + 4], eax
test eax, eax
je 0x42072d
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [edi + 0x10], eax
mov dword [edi + 0x14], 0
mov dword [edi], 1
test byte [esp + 0x30], 8
je 0x42024d
push 0x2a
lea eax, [edi + 0x50]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
mov edx, dword [edi + 0xc]
mov eax, 8
mov word [edi + 0x56], ax
add esp, 0xc
mov eax, dword [edi]
mov dword [edi + 0x76], edx
or eax, 8
mov dword [edi + 0x8a], edx
mov dword [edi + 0x8e], 0
mov dword [edi + 0x30], 0
mov dword [edi + 0x34], 0
jmp 0x4206d0
test byte [edi], 1
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov dword [esp + 0x18], eax
jne 0x420288
push 2
lea ecx, [esp + 0x34]
xorps xmm0, xmm0
push ecx
movlpd qword [esp + 0x38], xmm0
push dword [esp + 0x3c]
push dword [esp + 0x3c]
push dword [edi + 4]
call eax
mov ecx, dword [esp + 0x30]
sub ecx, dword [edi + 0xc]
mov edx, dword [esp + 0x34]
sbb edx, 0
jmp 0x420294
mov ecx, dword [edi + 0x10]
mov edx, dword [edi + 0x14]
mov dword [edi + 0x18], ecx
mov dword [edi + 0x1c], edx
xor eax, eax
mov dword [esp + 0x2c], edx
mov dword [esp + 0x1c], ecx
mov ebx, 0xffff
mov dword [esp + 0x28], ebx
mov dword [esp + 0x20], eax
test edx, edx
jg 0x4202bf
jl 0x4202b5
cmp ecx, ebx
jae 0x4202bf
mov ebx, ecx
mov dword [esp + 0x20], edx
mov dword [esp + 0x28], ebx
push 0x404
push 0
call dword [esp + 0x2c]
mov esi, eax
test esi, esi
je 0x42072d
mov edx, dword [esp + 0x20]
xor ecx, ecx
mov eax, 4
cmp ecx, edx
jg 0x420371
jl 0x4202f1
cmp eax, ebx
jae 0x420371
add eax, 0x400
mov dword [esp + 0x24], eax
adc ecx, 0
mov dword [esp + 0x30], ecx
cmp ecx, edx
jl 0x420317
jg 0x42030b
cmp eax, ebx
jbe 0x420317
mov eax, ebx
mov dword [esp + 0x30], edx
mov dword [esp + 0x24], eax
mov ecx, edx
mov edx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x2c]
sub edx, eax
mov dword [esp + 0x14], edx
sbb ebx, ecx
mov dword [esp + 0x10], ebx
test ecx, ecx
jb 0x42033f
ja 0x420338
cmp eax, 0x404
jbe 0x42033f
mov ebx, 0x404
jmp 0x420345
mov ebx, dword [esp + 0x1c]
sub ebx, edx
test byte [edi], 1
jne 0x4203a6
mov ecx, dword [edi + 0xc]
xor eax, eax
add ecx, edx
lea edx, [esp + 0x40]
push 0
adc eax, dword [esp + 0x14]
push edx
push eax
push ecx
push dword [edi + 4]
mov dword [esp + 0x54], ecx
mov dword [esp + 0x58], eax
call dword [esp + 0x2c]
test eax, eax
jne 0x4203b0
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test byte [edi], 1
jne 0x42065c
mov eax, dword [edi + 0xc]
lea ecx, [esp + 0x40]
push 0
push ecx
push 0
push eax
push dword [edi + 4]
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], 0
call dword [esp + 0x2c]
jmp 0x42066a
mov eax, dword [esp + 0x10]
mov dword [edi + 0x18], edx
mov dword [edi + 0x1c], eax
push ebx
mov edx, esi
mov ecx, edi
call fcn.0041e750
add esp, 4
test eax, eax
je 0x420371
lea eax, [ebx - 3]
test eax, eax
js 0x4203e9
mov ecx, eax
dec eax
cmp byte [eax + esi], 0x50
jne 0x4203e5
cmp byte [ecx + esi], 0x4b
jne 0x4203e5
cmp byte [eax + esi + 2], 5
jne 0x4203e5
cmp byte [eax + esi + 3], 6
je 0x42040c
test eax, eax
jns 0x4203c8
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x20]
cmp ecx, edx
jg 0x420371
mov eax, dword [esp + 0x24]
mov ebx, dword [esp + 0x28]
jge 0x4202e9
jmp 0x4202f1
cmp byte [eax + esi - 0x14], 0x50
lea ecx, [eax + esi]
jne 0x42043f
cmp byte [ecx - 0x13], 0x4b
jne 0x42043f
cmp byte [ecx - 0x12], 6
jne 0x42043f
cmp byte [ecx - 0x11], 7
jne 0x42043f
mov eax, dword [ecx - 0xc]
mov ebx, eax
mov ecx, dword [ecx - 8]
mov byte [esp + 0xf], 1
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ecx
jmp 0x420456
mov ecx, dword [esp + 0x14]
cdq
add ecx, eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x14], ecx
mov ebx, ecx
adc eax, edx
mov dword [esp + 0x10], eax
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test byte [edi], 1
jne 0x420487
mov ecx, dword [edi + 0xc]
lea edx, [esp + 0x40]
xor eax, eax
add ecx, ebx
push 0
adc eax, dword [esp + 0x14]
push edx
push eax
push ecx
push dword [edi + 4]
mov dword [esp + 0x54], ecx
mov dword [esp + 0x58], eax
call dword [esp + 0x2c]
jmp 0x420495
mov eax, dword [esp + 0x14]
mov dword [edi + 0x18], eax
mov eax, dword [esp + 0x10]
mov dword [edi + 0x1c], eax
mov ecx, edi
call fcn.0041e840
cmp byte [esp + 0xf], 0
xorps xmm0, xmm0
movlpd qword [esp + 0x40], xmm0
mov ecx, edi
je 0x4204d6
call fcn.0041e890
mov ecx, edi
mov dword [esp + 0x2c], eax
mov dword [esp + 0x24], edx
call fcn.0041e840
mov ecx, edi
call fcn.0041e840
mov ecx, edi
mov ebx, eax
call fcn.0041e840
mov esi, eax
jmp 0x4204f8
call fcn.0041e7d0
mov ecx, edi
movzx ebx, ax
call fcn.0041e7d0
movzx esi, ax
mov eax, dword [esp + 0x44]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0x2c], eax
cmp byte [esp + 0xf], 0
mov ecx, edi
je 0x420508
call fcn.0041e890
jmp 0x420511
call fcn.0041e7d0
movzx eax, ax
cdq
cmp byte [esp + 0xf], 0
mov ecx, edi
mov dword [edi + 0x20], eax
mov dword [edi + 0x24], edx
je 0x420527
call fcn.0041e890
jmp 0x420530
call fcn.0041e7d0
movzx eax, ax
cdq
cmp dword [edi + 8], 0
jne 0x4206a8
cmp eax, dword [edi + 0x20]
jne 0x420647
cmp edx, dword [edi + 0x24]
jne 0x420647
test esi, esi
jne 0x420647
test ebx, ebx
jne 0x420647
mov bl, byte [esp + 0xf]
mov ecx, edi
test bl, bl
je 0x420571
call fcn.0041e890
mov dword [esp + 0x28], edx
jmp 0x42057e
call fcn.0041e840
mov dword [esp + 0x28], 0
mov esi, eax
mov ecx, edi
test bl, bl
je 0x420595
call fcn.0041e890
mov ecx, eax
mov dword [esp + 0x30], edx
mov eax, edx
jmp 0x4205a2
call fcn.0041e840
mov ecx, eax
xor eax, eax
mov dword [esp + 0x30], eax
mov dword [edi + 0x40], ecx
mov dword [edi + 0x44], eax
test bl, bl
je 0x4205f7
mov edx, dword [edi + 0xc]
xor ebx, ebx
mov eax, edx
add eax, ecx
mov ecx, ebx
adc ecx, dword [esp + 0x30]
add eax, esi
adc ecx, dword [esp + 0x28]
add eax, dword [esp + 0x2c]
adc ecx, dword [esp + 0x24]
add eax, 0x34
adc ecx, ebx
test byte [edi], 1
jne 0x4205f1
add edx, eax
lea eax, [esp + 0x40]
push 0
push eax
adc ebx, ecx
mov dword [esp + 0x48], edx
push ebx
push edx
push dword [edi + 4]
mov dword [esp + 0x58], ebx
call dword [esp + 0x2c]
jmp 0x4205f7
mov dword [edi + 0x18], eax
mov dword [edi + 0x1c], ecx
mov ecx, edi
call fcn.0041e7d0
cmp dword [edi + 8], 0
movzx eax, ax
mov dword [edi + 0x28], eax
jne 0x4206a8
mov edx, dword [edi + 0xc]
xor eax, eax
mov ecx, dword [edi + 0x44]
mov ebx, edx
add ebx, dword [esp + 0x14]
mov dword [esp + 0x30], ebx
adc eax, dword [esp + 0x10]
mov ebx, dword [edi + 0x40]
add ebx, esi
adc ecx, dword [esp + 0x28]
cmp eax, ecx
jb 0x4206a8
ja 0x420639
cmp dword [esp + 0x30], ebx
jb 0x4206a8
sub edx, dword [edi + 0x40]
sub edx, esi
add edx, dword [esp + 0x14]
jmp 0x4206ea
mov ecx, edi
mov esi, 8
call fcn.0041ff50
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [edi + 0x18], 0
mov dword [edi + 0x1c], 0
cmp dword [edi + 8], 0
jne 0x42069a
push 2
lea edx, [esp + 0x34]
mov ecx, edi
call fcn.0041e750
add esp, 4
test eax, eax
je 0x42069a
mov eax, dword [esp + 0x30]
movzx ecx, ah
movzx eax, al
shl cx, 8
or cx, ax
movzx eax, cx
jmp 0x42069e
mov eax, dword [esp + 0x30]
mov ecx, 0x8b1f
cmp ax, cx
je 0x4206bd
mov ecx, edi
mov esi, 6
call fcn.0041ff50
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [edi + 0xc]
mov eax, dword [edi]
mov dword [edi + 0x40], 3
mov dword [edi + 0x44], 0
or eax, 4
mov dword [edi + 8], 0
mov dword [edi], eax
mov dword [edi + 0x20], 1
mov dword [edi + 0x24], 0
lea eax, [edi + 0x110]
mov dword [edi + 0x2c], edx
push eax
push 0x103
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov ecx, eax
or ecx, 0
je 0x420712
cmp byte [eax + edi + 0x10f], 0x5c
je 0x42071e
jmp 0x420714
xor eax, eax
mov word [eax + edi + 0x110], 0x5c
mov eax, dword [esp + 0x3c]
mov dword [eax], edi
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, edi
mov esi, 2
call fcn.0041ff50
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, 4
mov ecx, edi
call fcn.0041ff50
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret