Function at 0x413030
Capabilities:
Extract resource via kernel32 functions
Get common file path
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x218
mov eax, dword [0x4d9694]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov ebx, ecx
push edi
push 0x4bc5fc
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov edi, eax
test edi, edi
je 0x413277
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0x210], eax
lea eax, [ebp - 0x20c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push str.theme.ini
lea eax, [ebp - 0x20c]
push 0x104
push eax
call fcn.0048d15d
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0
push 0
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x214], eax
cmp eax, 0xffffffff
je 0x413277
push edi
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
je 0x413277
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
test eax, eax
je 0x413277
mov edi, dword [ebp - 0x214]
lea ecx, [ebp - 0x218]
push 0
push ecx
push dword [ebp - 0x210]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x413261
lea eax, [ebp - 0x210]
push eax
call fcn.0040fb30
mov esi, dword [ebp - 0x210]
lea eax, [ebp - 0x20c]
add esp, 4
mov ecx, esi
push eax
call fcn.0040f060
test al, al
jne 0x413167
test esi, esi
je 0x41314d
push esi
lea ecx, [ebp - 0x210]
call fcn.004100c0
xor esi, esi
pop edi
test esi, esi
pop esi
setne al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00448f14
mov esp, ebp
pop ebp
ret 8
lea ecx, [ebx + 4]
mov byte [ebx + 0x48], 0
lea eax, [ebp - 0x210]
cmp ecx, eax
je 0x4131a7
mov eax, dword [ecx]
mov dword [ecx], esi
test eax, eax
je 0x41325a
push eax
call fcn.004100c0
mov esi, 1
pop edi
test esi, esi
pop esi
setne al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00448f14
mov esp, ebp
pop ebp
ret 8
test esi, esi
je 0x41325a
mov ecx, dword [sym.imp.GDI32.dll_DeleteObject]
lea edi, [esi + 0x104]
mov ebx, 0x1f
mov eax, dword [edi - 4]
lea edi, [edi - 4]
dec ebx
test eax, eax
je 0x4131de
push eax
call ecx
mov ecx, dword [sym.imp.GDI32.dll_DeleteObject]
test eax, eax
je 0x4131de
mov dword [edi], 0
test ebx, ebx
jne 0x4131c0
mov eax, dword [esi + 0x84]
test eax, eax
je 0x4131f9
push eax
call ecx
test eax, eax
je 0x4131f9
mov dword [esi + 0x84], ebx
mov eax, dword [esi + 0x80]
test eax, eax
je 0x413218
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
test eax, eax
je 0x413218
mov dword [esi + 0x80], 0
mov edx, dword [esi + 4]
or edi, 0xffffffff
sub edx, 0x10
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x413235
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [esi]
sub edx, 0x10
lock xadd dword [edx + 0xc], edi
dec edi
test edi, edi
jg 0x41324c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push 0x184
push esi
call fcn.00449178
add esp, 8
mov esi, 1
test esi, esi
pop edi
pop esi
setne al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00448f14
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [ebp - 4]
xor al, al
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00448f14
mov esp, ebp
pop ebp
ret 8