Function at 0x4066b0
Capabilities:
Check if file exists
Delete file
Extract resource via kernel32 functions
Read .ini file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x594
mov eax, dword [0x4a3300]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x63
lea eax, [ebp - 0xd7]
mov byte [ebp - 0xd8], 0
push 0
push eax
call fcn.00453200
add esp, 0xc
mov byte [ebp - 0x70], 0
lea eax, [ebp - 0x6f]
push 0x63
push 0
push eax
call fcn.00453200
add esp, 0xc
lea ecx, [ebp - 0xd8]
call fcn.00406590
test eax, eax
je 0x406a21
mov ebx, dword [0x7275f0]
test ebx, ebx
je 0x406a21
push 0x257
lea eax, [ebp - 0x587]
mov byte [ebp - 0x588], 0
push 0
push eax
call fcn.00453200
add esp, 0xc
call fcn.00406470
push 0x4a78b0
push 0x258
cmp eax, 1
lea eax, [ebp - 0x588]
push eax
push 0
jne 0x406756
push str.Start
jmp 0x40675b
push str.Game
push str.PATH
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
test eax, eax
je 0x406a21
lea eax, [ebp - 0x588]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x406a21
push 0x257
lea eax, [ebp - 0x32f]
mov byte [ebp - 0x330], 0
push 0
push eax
call fcn.00453200
lea edx, [ebp - 0x588]
add esp, 0xc
mov esi, edx
mov al, byte [edx]
inc edx
test al, al
jne 0x4067a8
lea edi, [ebp - 0x330]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4067b8
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 edi, [ebp - 0x330]
dec edi
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x4067d5
mov ax, word [0x481cd0]
mov edx, 0x727770
mov word [edi], ax
mov esi, edx
nop
mov al, byte [edx]
inc edx
test al, al
jne 0x4067f0
lea edi, [ebp - 0x330]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x406800
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]
mov ecx, 0x7277d4
lea edx, [ecx + 1]
mov edi, edi
mov al, byte [ecx]
inc ecx
test al, al
jne 0x406820
sub ecx, edx
je 0x406876
lea edi, [ebp - 0x330]
dec edi
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x406832
mov ax, word [0x481d50]
mov edx, 0x7277d4
mov word [edi], ax
mov esi, edx
lea esp, [esp]
mov al, byte [edx]
inc edx
test al, al
jne 0x406850
lea edi, [ebp - 0x330]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x406860
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 edx, [ebp - 0x70]
lea ecx, [ebp - 0x330]
call fcn.00401470
cmp eax, 1
jne 0x4068b1
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp - 0xd8]
push eax
call fcn.004581f3
add esp, 8
test eax, eax
je 0x406a21
lea eax, [ebp - 0x330]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push 2
push 0x8b
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov edi, eax
test edi, edi
je 0x406a21
push edi
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov esi, eax
mov dword [ebp - 0x590], esi
test esi, esi
je 0x406a21
push edi
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
test eax, eax
jne 0x406908
push esi
call dword [sym.imp.KERNEL32.dll_FreeResource]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004524fc
mov esp, ebp
pop ebp
ret
cmp eax, ebx
jb 0x4068f0
push ebx
call fcn.00453a23
mov edi, eax
add esp, 4
test edi, edi
je 0x4068f0
test ebx, ebx
je 0x406942
add esi, 0x28
mov ecx, edi
sub esi, edi
mov edx, ebx
jmp 0x406930
mov al, byte [esi + ecx]
lea ecx, [ecx + 1]
mov byte [ecx - 1], al
dec edx
jne 0x406930
mov esi, dword [ebp - 0x590]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x330]
mov dword [ebp - 0x58c], 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x590], eax
cmp eax, 0xffffffff
je 0x4068f0
push 0
lea ecx, [ebp - 0x58c]
push ecx
push ebx
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x590]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push dword [ebp - 0x590]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
test ebx, ebx
je 0x4069bd
lea edx, [ebx + 0x27]
add edx, esi
nop
mov al, byte [edx]
lea edx, [edx - 1]
mov byte [ecx + edi], al
inc ecx
cmp ecx, ebx
jb 0x4069b0
push 0
push 0x80
push 4
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x330]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x590], eax
cmp eax, 0xffffffff
je 0x4068f0
push 0
lea ecx, [ebp - 0x58c]
push ecx
push ebx
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebx, dword [ebp - 0x590]
push ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_FreeResource]
push edi
call fcn.00454bdd
add esp, 4
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004524fc
mov esp, ebp
pop ebp
ret