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

Disassembly:
sub esp, 0x208
mov eax, dword [0x40e004]
xor eax, esp
mov dword [esp + 0x204], eax
cmp dword [0x40f0c0], 0
je 0x4011a7
mov eax, 1
mov ecx, dword [esp + 0x204]
xor ecx, esp
call fcn.00401720
add esp, 0x208
ret
push ebx
push ebp
push esi
push edi
push 0x40b1d4
push 0x6d
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov ebx, dword [sym.imp.KERNEL32.dll_LoadResource]
mov ebp, dword [sym.imp.KERNEL32.dll_LockResource]
mov esi, eax
test esi, esi
je 0x40120a
push esi
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edi, eax
cmp edi, 0x64
ja 0x4012e8
push esi
push 0
call ebx
push eax
call ebp
mov esi, eax
push edi
push esi
call fcn.00401130
add esp, 8
test eax, eax
je 0x4012e8
push esi
call fcn.00401b9d
add esp, 4
mov dword [0x40f0cc], eax
push 0x40b1d0
push 0x6e
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
test esi, esi
je 0x40125d
push esi
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edi, eax
cmp edi, 0x64
ja 0x4012e8
push esi
push 0
call ebx
push eax
call ebp
mov esi, eax
push edi
push esi
call fcn.00401130
add esp, 8
test eax, eax
je 0x4012e8
push esi
call fcn.00401b9d
add esp, 4
mov dword [0x40f0c4], eax
push 0x40b1cc
push 0x6f
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
test esi, esi
je 0x4012ac
push esi
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edi, eax
cmp edi, 0x64
ja 0x4012e8
push esi
push 0
call ebx
push eax
call ebp
mov esi, eax
push edi
push esi
call fcn.00401130
add esp, 8
test eax, eax
je 0x4012e8
push 0x64
push esi
push 0x64
push 0x40f058
call fcn.00401ad9
add esp, 0x10
push 0x40b1c8
push 0x70
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
test esi, esi
je 0x4013e9
push esi
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push esi
push 0
mov edi, eax
call ebx
push eax
call ebp
mov esi, eax
push edi
push esi
call fcn.00401130
add esp, 8
test eax, eax
jne 0x4012ef
xor eax, eax
jmp 0x4013ee
lea eax, [esp + 0x114]
push eax
push 0xff
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea ecx, [esp + 0x14]
push ecx
push 0
push 0x40b1c4
lea edx, [esp + 0x120]
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
push 0x40b1c0
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x18]
push ecx
mov dword [esp + 0x1c], 0
call fcn.00401a89
mov eax, dword [esp + 0x1c]
add esp, 0xc
test eax, eax
je 0x4013e9
push eax
push 1
push edi
push esi
call fcn.00401938
mov edx, dword [esp + 0x20]
mov esi, eax
sub esi, 1
neg esi
sbb esi, esi
push edx
add esi, 1
call fcn.004017a2
add esp, 0x14
test esi, esi
je 0x4013d5
lea eax, [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x4013d5
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x40b1c8
push esi
call edi
push 0x40b1cc
push esi
mov dword [0x40f0d0], eax
call edi
push 0x40b1d4
push esi
mov dword [0x40f0d4], eax
call edi
cmp dword [0x40f0d0], 0
mov dword [0x40f0d8], eax
je 0x4013ce
cmp dword [0x40f0d4], 0
je 0x4013ce
test eax, eax
je 0x4013ce
mov dword [0x40f0c0], 1
jmp 0x4013e9
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp dword [0x40f0c0], 0
jne 0x4013e9
lea ecx, [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov eax, dword [0x40f0c0]
mov ecx, dword [esp + 0x214]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00401720
add esp, 0x208
ret