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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push 0x1a8
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x407e5b
mov dword [ebp + 0x14], 2
mov eax, dword [ebp + 0x14]
jmp 0x408421
push 0xa4
push 0
mov eax, dword [ebp - 8]
push eax
call fcn.00415590
add esp, 0xc
cmp dword [ebp + 0x18], 0
je 0x407eb6
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 0x407ea5
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x407e4c
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 0x407fc7
cmp dword [ebp - 0x3c], 2
je 0x407f1c
cmp dword [ebp - 0x3c], 4
je 0x407ee6
jmp 0x408064
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 0x407f11
jmp 0x407f8e
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + 0xc]
mov dword [eax + 4], ecx
jmp 0x407f97
mov edx, dword [ebp + 0x14]
and edx, 0x80000000
je 0x407f4b
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
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 0x407f6d
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
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 0x407f8e
mov dword [ebp + 0x14], 1
mov eax, dword [ebp - 8]
push eax
call fcn.00407d50
add esp, 4
jmp 0x407e53
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 0x407fc2
mov dword [ebp + 0x14], 0x10
jmp 0x407f7d
jmp 0x408064
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + 0xc]
mov dword [eax + 4], ecx
cmp dword [ebp + 0xc], 0
je 0x407fe1
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 0x10]
mov dword [edx + 0x10], eax
jmp 0x40805b
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
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_FindResourceW]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x40801d
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 0x408029
mov dword [ebp + 0x14], 4
jmp 0x407f7d
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 0x408047
jmp 0x40824a
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 0x4080b3
push 0x2a
push 0
mov edx, dword [ebp - 8]
add edx, 0x38
push edx
call fcn.00415590
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 0x408297
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
and ecx, 1
jne 0x4080db
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 0x4080f0
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 0x408105
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 0x408244
mov dword [ebp - 0x18], 4
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x20]
jae 0x40823a
mov ecx, dword [ebp - 0x18]
add ecx, 0x400
cmp ecx, dword [ebp - 0x20]
jbe 0x408148
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0x18], edx
jmp 0x408153
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 0x408173
mov dword [ebp - 0x40], 0x404
jmp 0x40817c
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.00406270
add esp, 0xc
test eax, eax
jne 0x4081b0
mov ecx, dword [ebp - 0x28]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 8]
push eax
call fcn.00406300
add esp, 0xc
test eax, eax
jne 0x4081b5
jmp 0x40823a
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 0x408235
mov ecx, dword [ebp - 0x1c]
add ecx, dword [ebp - 0x24]
movzx edx, byte [ecx]
cmp edx, 0x50
jne 0x408233
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x24]
movzx ecx, byte [eax + 1]
cmp ecx, 0x4b
jne 0x408233
mov edx, dword [ebp - 0x1c]
add edx, dword [ebp - 0x24]
movzx eax, byte [edx + 2]
cmp eax, 5
jne 0x408233
mov ecx, dword [ebp - 0x1c]
add ecx, dword [ebp - 0x24]
movzx edx, byte [ecx + 3]
cmp edx, 6
jne 0x408233
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.00406270
add esp, 0xc
jmp 0x4082c9
jmp 0x4081be
jmp 0x408126
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp dword [ebp - 0x1c], 0
jne 0x408256
mov dword [ebp + 0x14], 2
jmp 0x407f7d
push 0
push 0
mov edx, dword [ebp - 8]
push edx
call fcn.00406270
add esp, 0xc
mov eax, dword [ebp - 8]
push eax
call fcn.004063e0
add esp, 4
movzx ecx, ax
mov dword [ebp + 0x14], ecx
cmp dword [ebp + 0x14], 0x8b1f
je 0x40828d
mov dword [ebp + 0x14], 6
jmp 0x407f7d
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 0x4083c4
mov edx, dword [ebp - 8]
push edx
call fcn.00406480
add esp, 4
mov eax, dword [ebp - 8]
push eax
call fcn.004063e0
add esp, 4
mov word [ebp - 0x2c], ax
mov ecx, dword [ebp - 8]
push ecx
call fcn.004063e0
add esp, 4
mov word [ebp - 0x38], ax
mov edx, dword [ebp - 8]
push edx
call fcn.004063e0
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.004063e0
add esp, 4
mov word [ebp - 0x34], ax
mov eax, dword [ebp - 8]
cmp dword [eax + 8], 0
je 0x408328
jmp 0x408281
movzx ecx, word [ebp - 0x34]
mov edx, dword [ebp - 8]
cmp ecx, dword [edx + 0x18]
jne 0x408344
movzx eax, word [ebp - 0x38]
test eax, eax
jne 0x408344
movzx ecx, word [ebp - 0x2c]
test ecx, ecx
je 0x408350
mov dword [ebp + 0x14], 8
jmp 0x407f7d
mov edx, dword [ebp - 8]
push edx
call fcn.00406480
add esp, 4
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 8]
push eax
call fcn.00406480
add esp, 4
mov ecx, dword [ebp - 8]
mov dword [ecx + 0x2c], eax
mov edx, dword [ebp - 8]
push edx
call fcn.004063e0
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 0x4083a5
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 0x4083aa
jmp 0x408281
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 0x103
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x4083f4
mov edx, dword [ebp - 8]
add edx, dword [ebp - 4]
movzx eax, byte [edx + 0xa3]
cmp eax, 0x5c
je 0x408417
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