Function at 0x409d70
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x490d28
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x4c51d0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 4], 0
mov eax, dword [ebp + 8]
mov eax, dword [eax]
sub eax, 0x10
push eax
call fcn.004015d0
lea esi, [eax + 0x10]
add esp, 4
mov dword [ebp - 0x14], esi
mov ecx, 1
mov byte [ebp - 4], cl
mov edi, dword [esi - 0xc]
test edi, edi
jns 0x409dcf
push 0x80070057
call fcn.00401af0
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, edi
or eax, ecx
jge 0x409de7
push edi
lea ecx, [ebp - 0x14]
call fcn.00401a50
mov esi, dword [ebp - 0x14]
lea ecx, [edi + 1]
push ecx
push esi
call fcn.0047095e
add esp, 8
cmp edi, dword [esi - 8]
jg 0x409dc5
lea eax, [esi - 0x10]
xor edx, edx
mov dword [esi - 0xc], edi
push eax
mov word [esi + edi*2], dx
mov dword [ebp - 0x18], eax
call fcn.004015d0
lea ebx, [eax + 0x10]
add esp, 4
mov dword [ebp - 0x10], ebx
mov byte [ebp - 4], 2
call fcn.00409bd0
mov edi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409e25
sub eax, edx
mov esi, eax
call fcn.00409cb0
mov esi, eax
push esi
lea eax, [ebp - 0x10]
push 0x4a56d8
push eax
call fcn.0040d860
add esp, 0xc
test edi, edi
je 0x409e56
push edi
call fcn.0046fa01
add esp, 4
test esi, esi
je 0x409e63
push esi
call fcn.0046fa01
add esp, 4
mov esi, dword [ebp - 0x14]
push 0x2e
push esi
call fcn.0046e96e
add esp, 8
test eax, eax
jne 0x409e7a
or eax, 0xffffffff
jmp 0x409e7e
sub eax, esi
sar eax, 1
lea ecx, [eax + 1]
lea esi, [ebp - 0x20]
lea edx, [ebp - 0x14]
call fcn.004013e0
mov byte [ebp - 4], 3
mov ebx, dword [ebp - 0x20]
mov edi, dword [ebp - 0x10]
mov ecx, dword [0x4cd844]
push ebx
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
jne 0x409ed7
lea eax, [ebx - 0x10]
mov byte [ebp - 4], 2
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x409ecb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 1
lea eax, [edi - 0x10]
jmp 0x40a0d2
mov ecx, dword [0x4cd844]
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edx, dword [0x4cd844]
push esi
push edx
mov dword [ebp - 0x28], eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov edi, eax
mov eax, dword [ebp + 0xc]
push eax
call esi
test eax, eax
jne 0x409f30
mov ecx, dword [ebp + 0xc]
push ecx
push eax
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
mov edx, dword [ebp + 0xc]
push edx
call esi
test eax, eax
jne 0x409f30
mov byte [ebp - 4], 2
lea eax, [ebx - 0x10]
jmp 0x40a0af
lea ecx, [ebp + 0xc]
push ecx
lea edx, [ebp - 0x24]
push edx
mov ebx, 0x4a56e4
call fcn.00406750
mov byte [ebp - 4], 4
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x1c]
push edx
mov ebx, eax
call fcn.004078b0
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x24]
add eax, 0xfffffff0
add esp, 0x10
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x409f7b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0x1c]
push 0
push 0x80
mov ebx, 2
push ebx
push 0
push 0
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40a087
mov eax, dword [ebp - 0x28]
push 0
lea edx, [ebp + 8]
push edx
push edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1c]
xor ecx, ecx
cmp dword [ebp + 8], edi
sete cl
add eax, 0xfffffff0
lea edx, [eax + 0xc]
mov esi, ecx
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x409fe8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], bl
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a00a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a02d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x18]
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a04d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a073
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a0a6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], bl
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a0c8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a0eb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x18]
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a10b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a131
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret