Function at 0x40f6f0
Capabilities:
Check if file exists
Delete file
Extract resource via kernel32 functions
Get common file path
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5c8999
mov eax, dword fs:[0]
push eax
sub esp, 0x5b4
mov eax, dword [0x64a3a4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x5a8], ecx
cmp dword [0x658288], 0
mov edi, dword [ebp + 8]
mov ebx, dword [ebp + 0x10]
jne 0x40f738
call fcn.00409f60
mov ecx, dword [0x658288]
call fcn.00429fd1
mov edx, eax
mov dword [ebp - 0x380], 7
xor eax, eax
mov dword [ebp - 0x384], 0
mov word [ebp - 0x394], ax
cmp word [edx], ax
jne 0x40f76b
xor ecx, ecx
jmp 0x40f77f
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f770
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x394]
call fcn.00404c10
xor eax, eax
mov dword [ebp - 4], 0
mov dword [ebp - 0x398], 7
mov dword [ebp - 0x39c], 0
mov word [ebp - 0x3ac], ax
cmp word [ebx], ax
jne 0x40f7b9
xor ecx, ecx
jmp 0x40f7cf
mov ecx, ebx
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f7c0
sub ecx, edx
sar ecx, 1
push ecx
push ebx
lea ecx, [ebp - 0x3ac]
call fcn.00404c10
xor eax, eax
mov byte [ebp - 4], 1
push 0xffffffffffffffff
push eax
mov word [ebp - 0x37c], ax
lea ecx, [ebp - 0x37c]
lea eax, [ebp - 0x394]
mov dword [ebp - 0x368], 7
push eax
mov dword [ebp - 0x36c], 0
call fcn.00404af0
xor eax, eax
mov byte [ebp - 4], 2
push 0xffffffffffffffff
push eax
mov word [ebp - 0x364], ax
lea ecx, [ebp - 0x364]
lea eax, [ebp - 0x3ac]
mov dword [ebp - 0x350], 7
push eax
mov dword [ebp - 0x354], 0
call fcn.00404af0
lea eax, [ebp - 0x37c]
mov byte [ebp - 4], 3
push eax
call fcn.00429a40
lea eax, [ebp - 0x364]
push eax
call fcn.00429a40
cmp dword [ebp - 0x350], 8
lea ecx, [ebp - 0x364]
push dword [ebp - 0x354]
cmovae ecx, dword [ebp - 0x364]
lea eax, [ebp - 0x37c]
cmp dword [ebp - 0x368], 8
push ecx
cmovae eax, dword [ebp - 0x37c]
push dword [ebp - 0x36c]
push eax
call fcn.004044e0
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 0x18
test eax, eax
je 0x40f8ee
cmp dword [ebp - 0x380], 8
lea eax, [ebp - 0x394]
cmovae eax, dword [ebp - 0x394]
push eax
call esi
test eax, eax
je 0x40f8ee
cmp dword [ebp - 0x380], 8
lea eax, [ebp - 0x394]
cmovae eax, dword [ebp - 0x394]
sub esp, 0x18
mov ecx, esp
push eax
call fcn.004020e0
call fcn.0042f990
add esp, 0x18
push ebx
call esi
test eax, eax
je 0x40f908
sub esp, 0x18
mov ecx, esp
push ebx
call fcn.004020e0
call fcn.0042f990
add esp, 0x18
mov ecx, dword [ebp - 0x5a8]
call fcn.00410410
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.00492210
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x218]
push eax
call fcn.0042f3c5
add esp, 4
mov dword [ebp - 0x338], 7
xor eax, eax
mov dword [ebp - 0x33c], 0
lea ecx, [ebp - 0x34c]
mov word [ebp - 0x34c], ax
push 1
push 0x5d9ca4
call fcn.00404c10
push 0xb
push 0x5dad0c
lea ecx, [ebp - 0x34c]
mov byte [ebp - 4], 4
call fcn.00404790
push 1
push 0x5d9ca4
lea ecx, [ebp - 0x34c]
call fcn.00404790
push 1
xor eax, eax
mov dword [ebp - 0x320], 7
push 0x5d9ca4
lea ecx, [ebp - 0x334]
mov dword [ebp - 0x324], 0
mov word [ebp - 0x334], ax
call fcn.00404c10
push 0xb
push str.aa9366f59ef
lea ecx, [ebp - 0x334]
mov byte [ebp - 4], 5
call fcn.00404790
push 1
push 0x5d9ca4
lea ecx, [ebp - 0x334]
call fcn.00404790
cmp dword [ebp - 0x320], 8
lea ecx, [ebp - 0x334]
lea eax, [ebp - 0x34c]
cmovae ecx, dword [ebp - 0x334]
cmp dword [ebp - 0x338], 8
push ecx
cmovae eax, dword [ebp - 0x34c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
je 0x410240
push esi
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push esi
push edi
mov dword [ebp - 0x5b8], eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push 0x1869f
push 0x2710
mov dword [ebp - 0x5a8], eax
call fcn.00430f16
cdq
push edx
push eax
lea eax, [ebp - 0x424]
push eax
call fcn.00430e89
add esp, 0x14
lea ecx, [ebp - 0x218]
mov byte [ebp - 4], 6
add ecx, 0xfffffffe
mov ax, word [ecx + 2]
lea ecx, [ecx + 2]
test ax, ax
jne 0x40fa84
mov eax, dword [str.WorthyShop]
lea edi, [ebp - 0x218]
mov dword [ecx], eax
add edi, 0xfffffffe
mov eax, dword [0x5d9dec]
mov dword [ecx + 4], eax
mov eax, dword [0x5d9df0]
mov dword [ecx + 8], eax
mov eax, dword [0x5d9df4]
mov dword [ecx + 0xc], eax
mov eax, dword [0x5d9df8]
mov dword [ecx + 0x10], eax
mov ax, word [0x5d9dfc]
mov word [ecx + 0x14], ax
nop word [eax + eax]
mov ax, word [edi + 2]
lea edi, [edi + 2]
test ax, ax
jne 0x40fad0
cmp dword [ebp - 0x410], 8
lea edx, [ebp - 0x424]
mov eax, dword [0x5dad3c]
cmovae edx, dword [ebp - 0x424]
mov dword [edi], eax
mov esi, edx
nop dword [eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40fb00
lea edi, [ebp - 0x218]
sub edx, esi
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x40fb16
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x218]
add ecx, 0xfffffffe
nop dword [eax]
mov ax, word [ecx + 2]
lea ecx, [ecx + 2]
test ax, ax
jne 0x40fb40
mov eax, dword [0x5dad40]
mov dword [ecx], eax
mov eax, dword [0x5dad44]
mov dword [ecx + 4], eax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40fb7b
lea eax, [ebp - 0x218]
push eax
call fcn.00430ab0
add esp, 4
push 0
push 0x80
push 1
push 0
push 1
push 0x40000000
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40fbce
push 0
lea eax, [ebp - 0x5c0]
mov dword [ebp - 0x5c0], 0
push eax
push dword [ebp - 0x5a8]
push dword [ebp - 0x5b8]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x104
lea eax, [ebp - 0x31c]
push 0
push eax
call fcn.00492210
lea eax, [ebp - 0x31c]
push eax
lea eax, [ebp - 0x218]
push eax
call fcn.00429a11
add esp, 0x14
cmp dword [0x658288], 0
jne 0x40fc05
call fcn.00409f60
mov ecx, dword [0x658288]
call fcn.00407750
cmp dword [0x658288], 0
jne 0x40fc1e
call fcn.00409f60
mov ecx, dword [0x658288]
call fcn.00405b90
cmp dword [ebp - 0x398], 8
lea ecx, [ebp - 0x5bc]
push ecx
push fcn.004103b0
lea ecx, [ebp - 0x31c]
mov dword [ebp - 0x5bc], 0
lea eax, [ebp - 0x3ac]
cmovae eax, dword [ebp - 0x3ac]
push ecx
push eax
call fcn.004311fc
add esp, 0x10
mov dword [ebp - 0x3f8], 7
xor eax, eax
mov dword [ebp - 0x3fc], 0
lea ecx, [ebp - 0x40c]
mov word [ebp - 0x40c], ax
push eax
push 0x5d98a0
call fcn.00404c10
xor eax, eax
mov byte [ebp - 4], 7
push eax
push 0x5d98a0
lea ecx, [ebp - 0x3c4]
mov dword [ebp - 0x3b0], 7
mov dword [ebp - 0x3b4], 0
mov word [ebp - 0x3c4], ax
call fcn.00404c10
push ebx
lea ecx, [ebp - 0x3dc]
mov byte [ebp - 4], 8
call fcn.004020e0
push 0xb
push str.Vectrya.exe
lea ecx, [ebp - 0x3dc]
mov byte [ebp - 4], 9
call fcn.00404790
cmp dword [0x658288], 0
jne 0x40fcf7
call fcn.00409f60
mov ecx, dword [0x658288]
call fcn.00406750
cmp dword [0x658288], 0
mov dword [ebp - 0x5a8], eax
jne 0x40fd16
call fcn.00409f60
mov ecx, dword [0x658288]
call fcn.00406730
mov edi, eax
lea ecx, [ebp - 0x58c]
push edi
call fcn.004020e0
push 2
push 0
push 0x5dad48
lea ecx, [ebp - 0x58c]
mov byte [ebp - 4], 0xa
call fcn.00408520
cmp dword [0x658288], 0
mov dword [ebp - 0x5b8], eax
jne 0x40fd5b
call fcn.00409f60
mov ecx, dword [0x658288]
call fcn.00406720
test eax, eax
mov esi, 1
mov ebx, 0
cmovne ebx, esi
cmp dword [0x658288], 0
jne 0x40fd83
call fcn.00409f60
mov ecx, dword [0x658288]
call fcn.004066f0
neg eax
mov dword [ebp - 0x5b4], 0
mov dword [ebp - 0x5b0], 0
sbb eax, eax
mov dword [ebp - 0x5ac], 0
neg eax
cmp dword [ebp + 0xc], 0
cmove esi, eax
mov ecx, dword [ebp - 0x5a8]
mov byte [ebp - 4], 0xb
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40fdc6
sub ecx, edx
sar ecx, 1
je 0x40fede
push 0x5dad50
lea ecx, [ebp - 0x43c]
call fcn.004020e0
lea eax, [ebp - 0x43c]
mov byte [ebp - 4], 0xc
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
mov eax, dword [ebp - 0x428]
mov byte [ebp - 4], 0xb
cmp eax, 8
jb 0x40fe23
inc eax
lea ecx, [ebp - 0x43c]
push eax
push dword [ebp - 0x43c]
call fcn.00404d60
push dword [ebp - 0x5a8]
lea ecx, [ebp - 0x454]
call fcn.004020e0
lea eax, [ebp - 0x454]
mov byte [ebp - 4], 0xd
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
mov eax, dword [ebp - 0x440]
mov byte [ebp - 4], 0xb
cmp eax, 8
jb 0x40fe6c
inc eax
lea ecx, [ebp - 0x454]
push eax
push dword [ebp - 0x454]
call fcn.00404d60
push 0x5dad58
lea ecx, [ebp - 0x3f4]
call fcn.004020e0
lea eax, [ebp - 0x3f4]
mov byte [ebp - 4], 0xe
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
mov eax, dword [ebp - 0x3e0]
mov byte [ebp - 4], 0xb
cmp eax, 8
jb 0x40feb4
inc eax
lea ecx, [ebp - 0x3f4]
push eax
push dword [ebp - 0x3f4]
call fcn.00404d60
push edi
lea ecx, [ebp - 0x46c]
call fcn.004020e0
lea eax, [ebp - 0x46c]
mov byte [ebp - 4], 0xf
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
lea ecx, [ebp - 0x46c]
jmp 0x40ff3b
push 0x5dad58
lea ecx, [ebp - 0x484]
call fcn.004020e0
lea eax, [ebp - 0x484]
mov byte [ebp - 4], 0x10
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
lea ecx, [ebp - 0x484]
mov byte [ebp - 4], 0xb
call fcn.0040d0b0
push edi
lea ecx, [ebp - 0x49c]
call fcn.004020e0
lea eax, [ebp - 0x49c]
mov byte [ebp - 4], 0x11
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
lea ecx, [ebp - 0x49c]
mov byte [ebp - 4], 0xb
call fcn.0040d0b0
cmp dword [ebp - 0x5b8], 0xffffffff
je 0x40ffb7
push 0x5dad60
lea ecx, [ebp - 0x4b4]
call fcn.004020e0
lea eax, [ebp - 0x4b4]
mov byte [ebp - 4], 0x12
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
lea ecx, [ebp - 0x4b4]
mov byte [ebp - 4], 0xb
call fcn.0040d0b0
push 0x5dad68
lea ecx, [ebp - 0x4cc]
call fcn.004020e0
lea eax, [ebp - 0x4cc]
mov byte [ebp - 4], 0x13
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
lea ecx, [ebp - 0x4cc]
mov byte [ebp - 4], 0xb
call fcn.0040d0b0
test esi, esi
jne 0x410025
push 0x5dad74
lea ecx, [ebp - 0x4e4]
call fcn.004020e0
lea eax, [ebp - 0x4e4]
mov byte [ebp - 4], 0x14
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
lea ecx, [ebp - 0x4e4]
mov byte [ebp - 4], 0xb
call fcn.0040d0b0
push 0x5da188
lea ecx, [ebp - 0x4fc]
call fcn.004020e0
lea eax, [ebp - 0x4fc]
mov byte [ebp - 4], 0x15
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
lea ecx, [ebp - 0x4fc]
mov byte [ebp - 4], 0xb
call fcn.0040d0b0
test ebx, ebx
jne 0x410093
push 0x5dad7c
lea ecx, [ebp - 0x514]
call fcn.004020e0
lea eax, [ebp - 0x514]
mov byte [ebp - 4], 0x16
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
lea ecx, [ebp - 0x514]
mov byte [ebp - 4], 0xb
call fcn.0040d0b0
push 0x5da188
lea ecx, [ebp - 0x52c]
call fcn.004020e0
lea eax, [ebp - 0x52c]
mov byte [ebp - 4], 0x17
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
lea ecx, [ebp - 0x52c]
mov byte [ebp - 4], 0xb
call fcn.0040d0b0
cmp dword [ebp + 0xc], 0
jne 0x410103
push 0x5dad84
lea ecx, [ebp - 0x544]
call fcn.004020e0
lea eax, [ebp - 0x544]
mov byte [ebp - 4], 0x18
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
lea ecx, [ebp - 0x544]
mov byte [ebp - 4], 0xb
call fcn.0040d0b0
push 0x5da188
lea ecx, [ebp - 0x55c]
call fcn.004020e0
lea eax, [ebp - 0x55c]
mov byte [ebp - 4], 0x19
push eax
lea ecx, [ebp - 0x5b4]
call fcn.00405360
lea ecx, [ebp - 0x55c]
mov byte [ebp - 4], 0xb
call fcn.0040d0b0
push 0x5dad8c
lea ecx, [ebp - 0x574]
call fcn.004020e0
lea eax, [ebp - 0x5b4]
mov byte [ebp - 4], 0x1a
push eax
lea eax, [ebp - 0x574]
push eax
lea eax, [ebp - 0x5a4]
push eax
call fcn.004296b1
add esp, 0xc
lea ecx, [ebp - 0x3c4]
push eax
call fcn.004029a0
lea ecx, [ebp - 0x5a4]
call fcn.0040d0b0
lea ecx, [ebp - 0x574]
mov byte [ebp - 4], 0xb
call fcn.0040d0b0
cmp dword [ebp - 0x3b0], 8
lea ecx, [ebp - 0x3c4]
push 0x2710
cmovae ecx, dword [ebp - 0x3c4]
lea eax, [ebp - 0x3dc]
cmp dword [ebp - 0x3c8], 8
push 1
cmovae eax, dword [ebp - 0x3dc]
push ecx
push eax
call fcn.004281c2
mov esi, dword [ebp - 0x5bc]
mov edi, 0x64
mov ecx, edi
mov eax, 0x55555556
sub ecx, esi
imul ecx
push edi
mov eax, edx
shr eax, 0x1f
add eax, edx
add esi, eax
push esi
mov dword [ebp - 0x5bc], esi
call fcn.004103b0
mov ecx, dword [ebp - 0x5bc]
mov eax, 0x55555556
sub edi, ecx
imul edi
push 0x64
mov eax, edx
shr eax, 0x1f
add eax, edx
add ecx, eax
push ecx
mov dword [ebp - 0x5bc], ecx
call fcn.004103b0
add esp, 0x20
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0x64
push 0x64
call fcn.004103b0
add esp, 8
lea ecx, [ebp - 0x5b4]
call fcn.004026b0
lea ecx, [ebp - 0x58c]
call fcn.0040d0b0
lea ecx, [ebp - 0x3dc]
call fcn.0040d0b0
lea ecx, [ebp - 0x3c4]
call fcn.0040d0b0
lea ecx, [ebp - 0x40c]
call fcn.0040d0b0
lea ecx, [ebp - 0x424]
call fcn.0040d0b0
mov eax, dword [ebp - 0x320]
cmp eax, 8
jb 0x41025e
inc eax
lea ecx, [ebp - 0x334]
push eax
push dword [ebp - 0x334]
call fcn.00404d60
xor eax, eax
mov dword [ebp - 0x320], 7
mov word [ebp - 0x334], ax
mov eax, dword [ebp - 0x338]
mov dword [ebp - 0x324], 0
cmp eax, 8
jb 0x410299
inc eax
lea ecx, [ebp - 0x34c]
push eax
push dword [ebp - 0x34c]
call fcn.00404d60
xor eax, eax
mov dword [ebp - 0x338], 7
mov word [ebp - 0x34c], ax
mov eax, dword [ebp - 0x350]
mov dword [ebp - 0x33c], 0
cmp eax, 8
jb 0x4102d4
inc eax
lea ecx, [ebp - 0x364]
push eax
push dword [ebp - 0x364]
call fcn.00404d60
xor eax, eax
mov dword [ebp - 0x350], 7
mov word [ebp - 0x364], ax
mov eax, dword [ebp - 0x368]
mov dword [ebp - 0x354], 0
cmp eax, 8
jb 0x41030f
inc eax
lea ecx, [ebp - 0x37c]
push eax
push dword [ebp - 0x37c]
call fcn.00404d60
xor eax, eax
mov dword [ebp - 0x368], 7
mov word [ebp - 0x37c], ax
mov eax, dword [ebp - 0x398]
mov dword [ebp - 0x36c], 0
cmp eax, 8
jb 0x41034a
inc eax
lea ecx, [ebp - 0x3ac]
push eax
push dword [ebp - 0x3ac]
call fcn.00404d60
xor eax, eax
mov dword [ebp - 0x398], 7
mov word [ebp - 0x3ac], ax
mov eax, dword [ebp - 0x380]
mov dword [ebp - 0x39c], 0
cmp eax, 8
jb 0x410385
inc eax
lea ecx, [ebp - 0x394]
push eax
push dword [ebp - 0x394]
call fcn.00404d60
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00426902
mov esp, ebp
pop ebp
ret 0xc