Function at 0x406700
Capabilities:
Check if file exists
Delete file
Extract resource via kernel32 functions
Get file attributes
Write file on windows

Disassembly:
sub esp, 0x2c
mov edx, dword [esp + 0x34]
xor eax, eax
xor ecx, ecx
mov dword [esp + 0xd], eax
mov dword [esp + 0x1d], ecx
push ebx
push ebp
mov dword [esp + 0x19], eax
mov dword [esp + 0x29], ecx
push esi
push edi
mov dword [esp + 0x25], eax
mov dword [esp + 0x35], ecx
and edx, 0xffff
xor ebx, ebx
push str.FGDRIVERS
mov word [esp + 0x2d], ax
mov word [esp + 0x3d], cx
push edx
push ebx
mov dword [esp + 0x20], ebx
mov byte [esp + 0x28], bl
mov byte [esp + 0x37], al
mov byte [esp + 0x38], al
mov byte [esp + 0x47], cl
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
cmp esi, ebx
jne 0x406770
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret 8
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edi, eax
cmp edi, ebx
mov dword [esp + 0x44], edi
jne 0x406792
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret 8
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, ebx
jne 0x4067ae
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret 8
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
cmp eax, ebx
mov dword [esp + 0x18], eax
jne 0x4067cd
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret 8
lea ecx, [esp + 0x1c]
push ecx
push edi
push eax
call fcn.00416080
mov ebp, dword [esp + 0x40]
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x4067fb
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x406823
cmp eax, 3
je 0x406823
jmp 0x40681d
lea edx, [esp + 0x2c]
push edx
push ebp
call fcn.004160a0
test eax, eax
je 0x40681d
mov ecx, 4
lea edi, [esp + 0x1c]
lea esi, [esp + 0x2c]
xor eax, eax
repe cmpsd dword [esi], dword es:[edi]
je 0x406871
inc ebx
cmp ebx, 0x64
jl 0x4067d9
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push 0x80
push 1
push 0
push 2
push 0x40000000
push ebp
call esi
mov edi, eax
cmp edi, 0xffffffff
jne 0x40687d
push 0
push 0x80
push 5
push 0
push 2
push 0x40000000
push ebp
call esi
mov edi, eax
cmp edi, 0xffffffff
jne 0x40687d
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x2c
ret 8
mov esi, dword [esp + 0x44]
mov ebx, dword [esp + 0x18]
xor ebp, ebp
mov dword [esp + 0x10], 0
test esi, esi
jbe 0x4068d2
jmp 0x406899
mov esi, dword [esp + 0x44]
lea ecx, [ebp + 0x10000]
cmp ecx, esi
jae 0x4068aa
mov esi, 0x10000
jmp 0x4068ac
sub esi, ebp
lea edx, [esp + 0x10]
push 0
push edx
push esi
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x406907
mov eax, dword [esp + 0x10]
cmp esi, eax
jne 0x406907
add ebp, eax
add ebx, eax
cmp ebp, dword [esp + 0x44]
jb 0x406895
mov esi, dword [esp + 0x14]
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x4068f3
mov eax, dword [esp + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret 8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x4068d6