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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x48c158
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x4bf1d0]
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 0x409c2f
push 0x80070057
call fcn.00401ae0
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, edi
or eax, ecx
jge 0x409c47
push edi
lea ecx, [ebp - 0x14]
call fcn.00401a40
mov esi, dword [ebp - 0x14]
lea ecx, [edi + 1]
push ecx
push esi
call fcn.0046be7e
add esp, 8
cmp edi, dword [esi - 8]
jg 0x409c25
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.00409a30
mov edi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409c85
sub eax, edx
mov esi, eax
call fcn.00409b10
mov esi, eax
push esi
lea eax, [ebp - 0x10]
push str.id__s
push eax
call fcn.0040c7b0
add esp, 0xc
test edi, edi
je 0x409cb6
push edi
call fcn.0046af21
add esp, 4
test esi, esi
je 0x409cc3
push esi
call fcn.0046af21
add esp, 4
mov esi, dword [ebp - 0x14]
push 0x2e
push esi
call fcn.00469e94
add esp, 8
test eax, eax
jne 0x409cda
or eax, 0xffffffff
jmp 0x409cde
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 [0x4c7824]
push ebx
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
jne 0x409d37
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 0x409d2b
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 0x409f32
mov ecx, dword [0x4c7824]
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edx, dword [0x4c7824]
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 0x409d90
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 0x409d90
mov byte [ebp - 4], 2
lea eax, [ebx - 0x10]
jmp 0x409f0f
lea ecx, [ebp + 0xc]
push ecx
lea edx, [ebp - 0x24]
push edx
mov ebx, 0x4a0094
call fcn.00406530
mov byte [ebp - 4], 4
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x1c]
push edx
mov ebx, eax
call fcn.004076f0
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 0x409ddb
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 0x409ee7
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 0x409e48
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 0x409e6a
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 0x409e8d
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 0x409ead
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 0x409ed3
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 0x409f06
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 0x409f28
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 0x409f4b
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 0x409f6b
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 0x409f91
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