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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4908b8
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 0x409daf
push 0x80070057
call fcn.00401ae0
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, edi
or eax, ecx
jge 0x409dc7
push edi
lea ecx, [ebp - 0x14]
call fcn.00401a40
mov esi, dword [ebp - 0x14]
lea ecx, [edi + 1]
push ecx
push esi
call fcn.0047041e
add esp, 8
cmp edi, dword [esi - 8]
jg 0x409da5
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.00409bb0
mov edi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409e05
sub eax, edx
mov esi, eax
call fcn.00409c90
mov esi, eax
push esi
lea eax, [ebp - 0x10]
push str.id__s
push eax
call fcn.0040c9d0
add esp, 0xc
test edi, edi
je 0x409e36
push edi
call fcn.0046f4c1
add esp, 4
test esi, esi
je 0x409e43
push esi
call fcn.0046f4c1
add esp, 4
mov esi, dword [ebp - 0x14]
push 0x2e
push esi
call fcn.0046e42e
add esp, 8
test eax, eax
jne 0x409e5a
or eax, 0xffffffff
jmp 0x409e5e
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 [0x4cd8a4]
push ebx
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
jne 0x409eb7
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 0x409eab
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 0x40a0b2
mov ecx, dword [0x4cd8a4]
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edx, dword [0x4cd8a4]
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 0x409f10
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 0x409f10
mov byte [ebp - 4], 2
lea eax, [ebx - 0x10]
jmp 0x40a08f
lea ecx, [ebp + 0xc]
push ecx
lea edx, [ebp - 0x24]
push edx
mov ebx, 0x4a53e4
call fcn.004066f0
mov byte [ebp - 4], 4
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x1c]
push edx
mov ebx, eax
call fcn.00407850
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 0x409f5b
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 0x40a067
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 0x409fc8
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 0x409fea
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 0x40a00d
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 0x40a02d
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 0x40a053
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 0x40a086
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 0x40a0a8
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 0x40a0cb
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 0x40a0eb
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 0x40a111
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