Function at 0x40fa8c
Capabilities:
Extract resource via kernel32 functions
Get common file path
Set current directory
Write file on windows

Disassembly:
push ebp
sub esp, 0x104
lea ebp, [esp - 4]
mov eax, dword [0x5c4954]
xor eax, ebp
mov dword [ebp + 0x104], eax
push 0x1fc
mov eax, 0x556ac1
call fcn.0052b4a7
xor ebx, ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x18], ecx
cmp dword [ecx + 4], ebx
je 0x40fac7
mov al, 1
jmp 0x41033b
mov dword [ebp - 0x64], ebx
call fcn.0048fb30
mov dword [ebp - 0x60], eax
lea eax, [ebp - 0x40]
push eax
call fcn.00440a10
pop ecx
push ebx
push eax
lea ecx, [ebp - 0x5c]
mov dword [ebp - 4], ebx
call fcn.0040a35f
lea eax, [ebp - 0x64]
push eax
lea eax, [ebp - 0x5c]
push eax
mov byte [ebp - 4], 1
call fcn.0040f1f3
pop ecx
neg al
sbb al, al
pop ecx
xor esi, esi
push ebx
inc al
inc esi
push esi
lea ecx, [ebp - 0x5c]
mov byte [ebp - 0x11], al
mov byte [ebp - 4], bl
call fcn.0040a269
or dword [ebp - 4], 0xffffffff
push ebx
push esi
lea ecx, [ebp - 0x40]
call fcn.00402cff
cmp byte [ebp - 0x11], bl
je 0x40fb2f
xor al, al
jmp 0x41033b
lea eax, [ebp - 0x40]
push eax
mov dword [ebp - 0x1c], 0x73
call fcn.00440ded
pop ecx
cmp dword [eax + 0x18], 0x10
mov dword [ebp - 4], 2
jb 0x40fb52
mov eax, dword [eax + 4]
jmp 0x40fb55
add eax, 4
push eax
call fcn.0052b705
pop ecx
cmp eax, 0x16
push ebx
setge byte [ebp - 0x11]
or dword [ebp - 4], 0xffffffff
push esi
lea ecx, [ebp - 0x40]
call fcn.00402cff
mov dword [ebp - 0x24], ebx
call fcn.0048fb30
mov dword [ebp - 0x20], eax
push ebx
cmp byte [ebp - 0x11], bl
je 0x40fcf0
mov edi, 0x571870
push edi
lea ecx, [ebp - 0x5c]
call fcn.00449faa
lea eax, [ebp - 0x80]
push eax
mov dword [ebp - 4], 3
call fcn.00440cc2
pop ecx
push ebx
push eax
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 4
call fcn.0040a35f
lea ecx, [ebp - 0x5c]
push ecx
push eax
lea eax, [ebp - 0x40]
push eax
mov byte [ebp - 4], 5
call fcn.0040f92f
lea ecx, [ebp - 0x24]
push ecx
push eax
mov byte [ebp - 4], 6
call fcn.0040f1f3
add esp, 0x14
neg al
sbb al, al
push ebx
inc al
push esi
lea ecx, [ebp - 0x40]
mov byte [ebp - 0x11], al
mov byte [ebp - 4], 5
call fcn.0040a269
push ebx
push esi
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 4
call fcn.0040a269
push ebx
push esi
lea ecx, [ebp - 0x80]
mov byte [ebp - 4], 3
call fcn.00402cff
or dword [ebp - 4], 0xffffffff
push ebx
push esi
lea ecx, [ebp - 0x5c]
call fcn.0040a269
cmp byte [ebp - 0x11], bl
jne 0x40fb28
push ebx
push edi
lea ecx, [ebp - 0x5c]
call fcn.00449faa
lea eax, [ebp - 0x128]
push eax
mov dword [ebp - 4], 7
call fcn.00440cc2
pop ecx
push ebx
push eax
lea ecx, [ebp - 0x80]
mov byte [ebp - 4], 8
call fcn.0040a35f
lea ecx, [ebp - 0x5c]
push ecx
push eax
lea eax, [ebp - 0x9c]
push eax
mov byte [ebp - 4], 9
call fcn.0040f92f
add esp, 0xc
lea ecx, [ebp - 0x40]
push ecx
mov ecx, eax
mov byte [ebp - 4], 0xa
call fcn.0040e015
mov ecx, dword [ebp - 0x18]
push eax
mov byte [ebp - 4], 0xb
call fcn.0040f2d2
neg al
sbb al, al
push ebx
inc al
push esi
lea ecx, [ebp - 0x40]
mov byte [ebp - 0x11], al
mov byte [ebp - 4], 0xa
call fcn.00402cff
push ebx
push esi
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 9
call fcn.0040a269
push ebx
push esi
lea ecx, [ebp - 0x80]
mov byte [ebp - 4], 8
call fcn.0040a269
push ebx
push esi
lea ecx, [ebp - 0x128]
mov byte [ebp - 4], 7
call fcn.00402cff
or dword [ebp - 4], 0xffffffff
push ebx
push esi
lea ecx, [ebp - 0x5c]
call fcn.0040a269
cmp byte [ebp - 0x11], bl
jne 0x40fb28
mov dword [ebp - 0x1c], 0x74
jmp 0x4101dc
push 0x571870
lea ecx, [ebp - 0x40]
call fcn.00449faa
lea eax, [ebp - 0xb8]
push eax
mov dword [ebp - 4], 0xc
mov dword [ebp - 0x10], esi
call fcn.00440cc2
pop ecx
push ebx
push eax
lea ecx, [ebp - 0xf0]
mov dword [ebp - 4], 0xd
mov dword [ebp - 0x10], 3
call fcn.0040a35f
lea ecx, [ebp - 0x40]
push ecx
push eax
lea eax, [ebp - 0x10c]
push eax
mov dword [ebp - 4], 0xe
mov dword [ebp - 0x10], 7
call fcn.0040f92f
push 0xf
pop ecx
mov dword [ebp - 4], ecx
mov dword [ebp - 0x10], ecx
lea ecx, [ebp - 0x24]
push ecx
push eax
call fcn.0040f1f3
add esp, 0x14
push 0x1a
pop edi
test al, al
je 0x40ff02
push ebx
push 0x571864
lea ecx, [ebp - 0x9c]
call fcn.00449faa
lea eax, [ebp - 0xd4]
push eax
mov dword [ebp - 4], 0x10
mov dword [ebp - 0x10], 0x1f
call fcn.00440cc2
pop ecx
push ebx
push eax
lea ecx, [ebp - 0x17c]
mov dword [ebp - 4], 0x11
mov dword [ebp - 0x10], 0x3f
call fcn.0040a35f
lea ecx, [ebp - 0x9c]
push ecx
push eax
lea eax, [ebp - 0x208]
push eax
mov dword [ebp - 4], 0x12
mov dword [ebp - 0x10], 0x7f
call fcn.0040f92f
lea ecx, [ebp - 0x24]
push ecx
push eax
mov dword [ebp - 4], 0x13
mov dword [ebp - 0x10], 0xff
call fcn.0040f1f3
add esp, 0x14
test al, al
je 0x40ff02
push ebx
push 0x571854
lea ecx, [ebp - 0x80]
call fcn.00449faa
lea eax, [ebp - 0x198]
push eax
mov dword [ebp - 4], 0x14
mov dword [ebp - 0x10], 0x1ff
call fcn.00440cc2
pop ecx
push ebx
push eax
lea ecx, [ebp - 0x160]
mov dword [ebp - 4], 0x15
mov dword [ebp - 0x10], 0x3ff
call fcn.0040a35f
lea ecx, [ebp - 0x80]
push ecx
push eax
lea eax, [ebp - 0x1b4]
push eax
mov dword [ebp - 4], 0x16
mov dword [ebp - 0x10], 0x7ff
call fcn.0040f92f
lea ecx, [ebp - 0x24]
push ecx
push eax
mov dword [ebp - 4], 0x17
mov dword [ebp - 0x10], 0xfff
call fcn.0040f1f3
add esp, 0x14
test al, al
je 0x40ff02
push ebx
push 0x571848
lea ecx, [ebp - 0x5c]
call fcn.00449faa
lea eax, [ebp - 0x1ec]
push eax
mov dword [ebp - 4], 0x18
mov dword [ebp - 0x10], 0x1fff
call fcn.00440cc2
pop ecx
push ebx
push eax
lea ecx, [ebp - 0x144]
mov dword [ebp - 4], 0x19
mov dword [ebp - 0x10], 0x3fff
call fcn.0040a35f
lea ecx, [ebp - 0x5c]
push ecx
push eax
lea eax, [ebp - 0x128]
push eax
mov dword [ebp - 4], edi
mov dword [ebp - 0x10], 0x7fff
call fcn.0040f92f
lea ecx, [ebp - 0x24]
push ecx
push eax
mov dword [ebp - 4], 0x1b
mov dword [ebp - 0x10], 0xffff
call fcn.0040f1f3
add esp, 0x14
mov byte [ebp - 0x11], bl
test al, al
jne 0x40ff06
mov byte [ebp - 0x11], 1
test dword [ebp - 0x10], 0x8000
mov dword [ebp - 4], edi
je 0x40ff26
and dword [ebp - 0x10], 0xffff7fff
push ebx
push esi
lea ecx, [ebp - 0x128]
call fcn.0040a269
test dword [ebp - 0x10], 0x4000
mov dword [ebp - 4], 0x19
je 0x40ff4a
and dword [ebp - 0x10], 0xffffbfff
push ebx
push esi
lea ecx, [ebp - 0x144]
call fcn.0040a269
test dword [ebp - 0x10], 0x2000
mov dword [ebp - 4], 0x18
je 0x40ff6e
and dword [ebp - 0x10], 0xffffdfff
push ebx
push esi
lea ecx, [ebp - 0x1ec]
call fcn.00402cff
test dword [ebp - 0x10], 0x1000
mov dword [ebp - 4], 0x17
je 0x40ff8f
and dword [ebp - 0x10], 0xffffefff
push ebx
push esi
lea ecx, [ebp - 0x5c]
call fcn.0040a269
test dword [ebp - 0x10], 0x800
mov dword [ebp - 4], 0x16
je 0x40ffb3
and dword [ebp - 0x10], 0xfffff7ff
push ebx
push esi
lea ecx, [ebp - 0x1b4]
call fcn.0040a269
test dword [ebp - 0x10], 0x400
mov dword [ebp - 4], 0x15
je 0x40ffd7
and dword [ebp - 0x10], 0xfffffbff
push ebx
push esi
lea ecx, [ebp - 0x160]
call fcn.0040a269
test dword [ebp - 0x10], 0x200
mov dword [ebp - 4], 0x14
je 0x40fffb
and dword [ebp - 0x10], 0xfffffdff
push ebx
push esi
lea ecx, [ebp - 0x198]
call fcn.00402cff
test dword [ebp - 0x10], 0x100
mov dword [ebp - 4], 0x13
je 0x41001c
and dword [ebp - 0x10], 0xfffffeff
push ebx
push esi
lea ecx, [ebp - 0x80]
call fcn.0040a269
test byte [ebp - 0x10], 0x80
mov dword [ebp - 4], 0x12
je 0x41003d
and dword [ebp - 0x10], 0xffffff7f
push ebx
push esi
lea ecx, [ebp - 0x208]
call fcn.0040a269
test byte [ebp - 0x10], 0x40
mov dword [ebp - 4], 0x11
je 0x41005b
and dword [ebp - 0x10], 0xffffffbf
push ebx
push esi
lea ecx, [ebp - 0x17c]
call fcn.0040a269
test byte [ebp - 0x10], 0x20
mov dword [ebp - 4], 0x10
je 0x410079
and dword [ebp - 0x10], 0xffffffdf
push ebx
push esi
lea ecx, [ebp - 0xd4]
call fcn.00402cff
test byte [ebp - 0x10], 0x10
mov dword [ebp - 4], 0xf
je 0x410097
and dword [ebp - 0x10], 0xffffffef
push ebx
push esi
lea ecx, [ebp - 0x9c]
call fcn.0040a269
test byte [ebp - 0x10], 8
mov dword [ebp - 4], 0xe
je 0x4100b5
and dword [ebp - 0x10], 0xfffffff7
push ebx
push esi
lea ecx, [ebp - 0x10c]
call fcn.0040a269
test byte [ebp - 0x10], 4
mov dword [ebp - 4], 0xd
je 0x4100d3
and dword [ebp - 0x10], 0xfffffffb
push ebx
push esi
lea ecx, [ebp - 0xf0]
call fcn.0040a269
test byte [ebp - 0x10], 2
mov dword [ebp - 4], 0xc
je 0x4100f1
and dword [ebp - 0x10], 0xfffffffd
push ebx
push esi
lea ecx, [ebp - 0xb8]
call fcn.00402cff
or dword [ebp - 4], 0xffffffff
test byte [ebp - 0x10], 1
je 0x410105
push ebx
push esi
lea ecx, [ebp - 0x40]
call fcn.0040a269
cmp byte [ebp - 0x11], bl
jne 0x40fb28
push ebx
push 0x571864
lea ecx, [ebp - 0x40]
call fcn.00449faa
lea eax, [ebp - 0xd4]
push eax
mov dword [ebp - 4], 0x1c
call fcn.00440cc2
pop ecx
push ebx
push eax
lea ecx, [ebp - 0x10c]
mov byte [ebp - 4], 0x1d
call fcn.0040a35f
lea ecx, [ebp - 0x40]
push ecx
push eax
lea eax, [ebp - 0xf0]
push eax
mov byte [ebp - 4], 0x1e
call fcn.0040f92f
add esp, 0xc
lea ecx, [ebp - 0xb8]
push ecx
mov ecx, eax
mov byte [ebp - 4], 0x1f
call fcn.0040e015
mov ecx, dword [ebp - 0x18]
push eax
mov byte [ebp - 4], 0x20
call fcn.0040f2d2
neg al
sbb al, al
push ebx
inc al
push esi
lea ecx, [ebp - 0xb8]
mov byte [ebp - 0x11], al
mov byte [ebp - 4], 0x1f
call fcn.00402cff
push ebx
push esi
lea ecx, [ebp - 0xf0]
mov byte [ebp - 4], 0x1e
call fcn.0040a269
push ebx
push esi
lea ecx, [ebp - 0x10c]
mov byte [ebp - 4], 0x1d
call fcn.0040a269
push ebx
push esi
lea ecx, [ebp - 0xd4]
mov byte [ebp - 4], 0x1c
call fcn.00402cff
or dword [ebp - 4], 0xffffffff
push ebx
push esi
lea ecx, [ebp - 0x40]
call fcn.0040a269
cmp byte [ebp - 0x11], bl
jne 0x40fb28
push 0x57147c
push dword [ebp - 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov edi, eax
cmp edi, ebx
je 0x410330
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x1c], eax
cmp eax, ebx
je 0x410330
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0x10], eax
cmp eax, ebx
jbe 0x410330
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x1c], eax
cmp eax, ebx
je 0x410330
mov eax, dword [ebp - 0x18]
cmp dword [eax + 0x20], 0x10
jb 0x41023d
mov eax, dword [eax + 0xc]
jmp 0x410240
add eax, 0xc
push 0x571844
push eax
call fcn.0052c823
mov edi, eax
pop ecx
pop ecx
cmp edi, ebx
je 0x410269
push edi
push esi
push dword [ebp - 0x10]
push dword [ebp - 0x1c]
call fcn.0052c27e
push edi
call fcn.0052c539
add esp, 0x14
mov edi, 0x104
push edi
lea eax, [ebp]
push ebx
push eax
call fcn.0052b710
add esp, 0xc
lea eax, [ebp]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov ecx, dword [ebp - 0x18]
lea eax, [ebp]
push eax
add ecx, 0x24
call fcn.00402cde
lea eax, [ebp - 0xb8]
push eax
call fcn.00440cc2
pop ecx
cmp dword [eax + 0x18], 0x10
mov dword [ebp - 4], 0x21
jb 0x4102b5
mov eax, dword [eax + 4]
jmp 0x4102b8
add eax, 4
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
or dword [ebp - 4], 0xffffffff
push ebx
push esi
lea ecx, [ebp - 0xb8]
call fcn.00402cff
lea eax, [ebp - 0x1d0]
push eax
call fcn.00440cc2
pop ecx
cmp dword [eax + 0x18], 0x10
mov dword [ebp - 4], 0x22
jb 0x4102ef
mov eax, dword [eax + 4]
jmp 0x4102f2
add eax, 4
push eax
call fcn.0040f212
or dword [ebp - 4], 0xffffffff
pop ecx
push ebx
push esi
lea ecx, [ebp - 0x1d0]
mov byte [ebp - 0x11], al
call fcn.00402cff
cmp byte [ebp - 0x11], bl
je 0x410330
mov esi, dword [ebp - 0x18]
cmp dword [esi + 0x20], 0x10
jb 0x410320
mov eax, dword [esi + 0xc]
jmp 0x410323
lea eax, [esi + 0xc]
push 8
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov dword [esi + 4], eax
mov ecx, dword [ebp - 0x18]
xor eax, eax
cmp dword [ecx + 4], ebx
setne al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x104]
xor ecx, ebp
call fcn.0052b498
add ebp, 0x108
leave
ret