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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push 0x2a4
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x40719b
mov dword [ebp + 0x14], 2
mov eax, dword [ebp + 0x14]
jmp 0x407761
push 0xa4
push 0
mov eax, dword [ebp - 8]
push eax
call fcn.00511c50
add esp, 0xc
cmp dword [ebp + 0x18], 0
je 0x4071f6
mov ecx, dword [ebp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, 1
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edx, dword [ebp - 8]
mov dword [edx + 0x30], eax
mov eax, dword [ebp - 8]
cmp dword [eax + 0x30], 0
jne 0x4071e5
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x40718c
mov edx, dword [ebp + 0x18]
push edx
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov edx, dword [ebp - 8]
mov dword [edx + 0x24], 0xffffffff
mov eax, dword [ebp + 0x14]
and eax, 0x3ffffff7
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 1
je 0x407307
cmp dword [ebp - 0x3c], 2
je 0x40725c
cmp dword [ebp - 0x3c], 4
je 0x407226
jmp 0x4073a4
push 2
push 0
push 0
mov ecx, dword [ebp - 8]
add ecx, 4
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
jne 0x407251
jmp 0x4072ce
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + 0xc]
mov dword [eax + 4], ecx
jmp 0x4072d7
mov edx, dword [ebp + 0x14]
and edx, 0x80000000
je 0x40728b
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [ebp - 8]
mov dword [ecx + 4], eax
jmp 0x4072ad
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [ebp - 8]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 8]
cmp dword [edx + 4], 0xffffffff
jne 0x4072ce
mov dword [ebp + 0x14], 1
mov eax, dword [ebp - 8]
push eax
call fcn.00406410
add esp, 4
jmp 0x407193
mov ecx, dword [ebp - 8]
mov dword [ecx], 2
push 1
push 0
push 0
mov edx, dword [ebp - 8]
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp - 8]
mov dword [ecx + 0xc], eax
mov edx, dword [ebp - 8]
cmp dword [edx + 0xc], 0xffffffff
jne 0x407302
mov dword [ebp + 0x14], 0x10
jmp 0x4072bd
jmp 0x4073a4
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + 0xc]
mov dword [eax + 4], ecx
cmp dword [ebp + 0xc], 0
je 0x407321
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 0x10]
mov dword [edx + 0x10], eax
jmp 0x40739b
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp + 0xc], eax
push 0xa
movzx ecx, word [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x40735d
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x407369
mov dword [ebp + 0x14], 4
jmp 0x4072bd
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ecx, dword [ebp - 8]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 8]
cmp dword [edx + 4], 0
jne 0x407387
jmp 0x40758a
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edx, dword [ebp - 8]
mov dword [edx + 0x10], eax
mov eax, dword [ebp - 8]
mov dword [eax], 1
mov ecx, dword [ebp + 0x14]
and ecx, 8
je 0x4073f3
push 0x2a
push 0
mov edx, dword [ebp - 8]
add edx, 0x38
push edx
call fcn.00511c50
add esp, 0xc
mov eax, 8
mov ecx, dword [ebp - 8]
mov word [ecx + 0x3e], ax
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 0xc]
mov dword [edx + 0x5e], ecx
mov edx, dword [ebp - 8]
mov eax, dword [edx]
or eax, 8
mov ecx, dword [ebp - 8]
mov dword [ecx], eax
mov edx, dword [ebp - 8]
mov dword [edx + 0x24], 0
jmp 0x4075d7
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
and ecx, 1
jne 0x40741b
push 2
push 0
push 0
mov edx, dword [ebp - 8]
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp - 8]
sub eax, dword [ecx + 0xc]
mov dword [ebp - 0x14], eax
jmp 0x407430
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 0x10]
mov dword [edx + 0x14], ecx
mov edx, dword [ebp - 8]
mov eax, dword [edx + 0x14]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x20], 0xffff
mov ecx, dword [ebp - 0x20]
cmp ecx, dword [ebp - 0x14]
jbe 0x407445
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x20], edx
push 0x404
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x407584
mov dword [ebp - 0x18], 4
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x20]
jae 0x40757a
mov ecx, dword [ebp - 0x18]
add ecx, 0x400
cmp ecx, dword [ebp - 0x20]
jbe 0x407488
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0x18], edx
jmp 0x407493
mov eax, dword [ebp - 0x18]
add eax, 0x400
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x14]
sub ecx, dword [ebp - 0x18]
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 0x14]
sub edx, dword [ebp - 4]
cmp edx, 0x404
jbe 0x4074b3
mov dword [ebp - 0x40], 0x404
jmp 0x4074bc
mov eax, dword [ebp - 0x14]
sub eax, dword [ebp - 4]
mov dword [ebp - 0x40], eax
mov ecx, dword [ebp - 0x40]
mov dword [ebp - 0x28], ecx
push 0
mov edx, dword [ebp - 4]
push edx
mov eax, dword [ebp - 8]
push eax
call fcn.00406320
add esp, 0xc
test eax, eax
jne 0x4074f0
mov ecx, dword [ebp - 0x28]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 8]
push eax
call fcn.00405920
add esp, 0xc
test eax, eax
jne 0x4074f5
jmp 0x40757a
mov ecx, dword [ebp - 0x28]
sub ecx, 3
mov dword [ebp - 0x24], ecx
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x24]
sub eax, 1
mov dword [ebp - 0x24], eax
test edx, edx
jl 0x407575
mov ecx, dword [ebp - 0x1c]
add ecx, dword [ebp - 0x24]
movzx edx, byte [ecx]
cmp edx, 0x50
jne 0x407573
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x24]
movzx ecx, byte [eax + 1]
cmp ecx, 0x4b
jne 0x407573
mov edx, dword [ebp - 0x1c]
add edx, dword [ebp - 0x24]
movzx eax, byte [edx + 2]
cmp eax, 5
jne 0x407573
mov ecx, dword [ebp - 0x1c]
add ecx, dword [ebp - 0x24]
movzx edx, byte [ecx + 3]
cmp edx, 6
jne 0x407573
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [ebp - 4]
add ecx, dword [ebp - 0x24]
mov dword [ebp - 4], ecx
push 0
mov edx, dword [ebp - 4]
push edx
mov eax, dword [ebp - 8]
push eax
call fcn.00406320
add esp, 0xc
jmp 0x407609
jmp 0x4074fe
jmp 0x407466
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp dword [ebp - 0x1c], 0
jne 0x407596
mov dword [ebp + 0x14], 2
jmp 0x4072bd
push 0
push 0
mov edx, dword [ebp - 8]
push edx
call fcn.00406320
add esp, 0xc
mov eax, dword [ebp - 8]
push eax
call fcn.00407770
add esp, 4
movzx ecx, ax
mov dword [ebp + 0x14], ecx
cmp dword [ebp + 0x14], 0x8b1f
je 0x4075cd
mov dword [ebp + 0x14], 6
jmp 0x4072bd
mov edx, dword [ebp - 8]
mov dword [edx + 0x2c], 3
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 8]
mov edx, dword [ecx + 0xc]
mov dword [eax + 0x20], edx
mov eax, dword [ebp - 8]
mov dword [eax + 8], 0
mov ecx, dword [ebp - 8]
mov edx, dword [ecx]
or edx, 4
mov eax, dword [ebp - 8]
mov dword [eax], edx
mov ecx, dword [ebp - 8]
mov dword [ecx + 0x18], 1
jmp 0x407704
mov edx, dword [ebp - 8]
push edx
call fcn.004070c0
add esp, 4
mov eax, dword [ebp - 8]
push eax
call fcn.00407770
add esp, 4
mov word [ebp - 0x2c], ax
mov ecx, dword [ebp - 8]
push ecx
call fcn.00407770
add esp, 4
mov word [ebp - 0x38], ax
mov edx, dword [ebp - 8]
push edx
call fcn.00407770
add esp, 4
movzx eax, ax
mov ecx, dword [ebp - 8]
mov dword [ecx + 0x18], eax
mov edx, dword [ebp - 8]
push edx
call fcn.00407770
add esp, 4
mov word [ebp - 0x34], ax
mov eax, dword [ebp - 8]
cmp dword [eax + 8], 0
je 0x407668
jmp 0x4075c1
movzx ecx, word [ebp - 0x34]
mov edx, dword [ebp - 8]
cmp ecx, dword [edx + 0x18]
jne 0x407684
movzx eax, word [ebp - 0x38]
test eax, eax
jne 0x407684
movzx ecx, word [ebp - 0x2c]
test ecx, ecx
je 0x407690
mov dword [ebp + 0x14], 8
jmp 0x4072bd
mov edx, dword [ebp - 8]
push edx
call fcn.004070c0
add esp, 4
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 8]
push eax
call fcn.004070c0
add esp, 4
mov ecx, dword [ebp - 8]
mov dword [ecx + 0x2c], eax
mov edx, dword [ebp - 8]
push edx
call fcn.00407770
add esp, 4
movzx eax, ax
mov ecx, dword [ebp - 8]
mov dword [ecx + 0x1c], eax
mov edx, dword [ebp - 8]
cmp dword [edx + 8], 0
jne 0x4076e5
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
add ecx, dword [eax + 0xc]
mov edx, dword [ebp - 8]
mov eax, dword [edx + 0x2c]
add eax, dword [ebp - 0x30]
cmp ecx, eax
jae 0x4076ea
jmp 0x4075c1
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 4]
add edx, dword [ecx + 0xc]
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 0x2c]
add ecx, dword [ebp - 0x30]
sub edx, ecx
mov eax, dword [ebp - 8]
mov dword [eax + 0x20], edx
mov ecx, dword [ebp - 8]
add ecx, 0xa4
push ecx
push 0x1ff
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x407734
mov edx, dword [ebp - 8]
add edx, dword [ebp - 4]
movzx eax, byte [edx + 0xa3]
cmp eax, 0x5c
je 0x407757
mov ecx, dword [ebp - 8]
add ecx, dword [ebp - 4]
mov byte [ecx + 0xa4], 0x5c
mov edx, dword [ebp - 4]
add edx, 1
mov dword [ebp - 4], edx
mov eax, dword [ebp - 8]
add eax, dword [ebp - 4]
mov byte [eax + 0xa4], 0
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 8]
mov dword [ecx], edx
xor eax, eax
mov esp, ebp
pop ebp
ret