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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x487418
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x4b91d0]
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.004015c0
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 0x409d2f
push 0x80070057
call fcn.00401ad0
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, edi
or eax, ecx
jge 0x409d47
push edi
lea ecx, [ebp - 0x14]
call fcn.00401a30
mov esi, dword [ebp - 0x14]
lea ecx, [edi + 1]
push ecx
push esi
call fcn.0046775e
add esp, 8
cmp edi, dword [esi - 8]
jg 0x409d25
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.004015c0
lea ebx, [eax + 0x10]
add esp, 4
mov dword [ebp - 0x10], ebx
mov byte [ebp - 4], 2
call fcn.00409b30
mov edi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409d85
sub eax, edx
mov esi, eax
call fcn.00409c10
mov esi, eax
push esi
lea eax, [ebp - 0x10]
push str.id__s
push eax
call fcn.0040c8a0
add esp, 0xc
test edi, edi
je 0x409db6
push edi
call fcn.00466801
add esp, 4
test esi, esi
je 0x409dc3
push esi
call fcn.00466801
add esp, 4
mov esi, dword [ebp - 0x14]
push 0x2e
push esi
call fcn.0046576e
add esp, 8
test eax, eax
jne 0x409dda
or eax, 0xffffffff
jmp 0x409dde
sub eax, esi
sar eax, 1
lea ecx, [eax + 1]
lea esi, [ebp - 0x20]
lea edx, [ebp - 0x14]
call fcn.004013d0
mov byte [ebp - 4], 3
mov ebx, dword [ebp - 0x20]
mov edi, dword [ebp - 0x10]
mov ecx, dword [0x4c1184]
push ebx
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
jne 0x409e37
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 0x409e2b
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 0x40a032
mov ecx, dword [0x4c1184]
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edx, dword [0x4c1184]
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 0x409e90
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 0x409e90
mov byte [ebp - 4], 2
lea eax, [ebx - 0x10]
jmp 0x40a00f
lea ecx, [ebp + 0xc]
push ecx
lea edx, [ebp - 0x24]
push edx
mov ebx, 0x49b2ec
call fcn.004065d0
mov byte [ebp - 4], 4
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x1c]
push edx
mov ebx, eax
call fcn.00407790
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 0x409edb
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 0x409fe7
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 0x409f48
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 0x409f6a
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 0x409f8d
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 0x409fad
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 0x409fd3
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 0x40a006
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 0x40a028
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 0x40a04b
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 0x40a06b
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 0x40a091
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