Function at 0x409870
Capabilities:
Create directory
Delete directory
Delete file
Get common file path

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x418]
push ebx
lea ebx, [ebp - 0x4c6]
sub esp, 0x520
mov dword [ebp - 0x508], ecx
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x510], eax
xor eax, eax
mov dword [ebp - 0x4fc], ecx
mov ecx, 0x40
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x314]
mov ecx, 0x40
mov dword [ebp - 0x500], edx
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x210]
mov ecx, 0x40
mov dword [ebp - 0x41c], 0
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x4c4]
mov ecx, ebx
mov dword [ebp - 0x4c6], 0
mov dword [ebp - 0x420], 0
sub ecx, edi
mov dword [ebp - 0x318], 0
add ecx, 0xaa
mov dword [ebp - 0x214], 0
shr ecx, 2
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x10c]
mov ecx, 0x40
mov dword [ebp - 0x110], 0
rep stosd dword es:[edi], eax
lea ecx, [ebp - 0x41c]
mov dword [esp], 0xfa
mov dword [esp + 4], ecx
call dword [sym.imp.kernel32.dll_GetTempPathA]
mov esi, eax
mov eax, dword [ebp - 0x510]
sub esp, 8
mov edi, dword fs:[0x18]
call fcn.004012e0
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.GetTempPathA_returned_error__lu._n
mov dword [esp + 8], eax
xor eax, eax
test esi, esi
setne al
mov dword [esp], eax
call fcn.00401dd0
lea ecx, [ebp - 0x41c]
add esi, ecx
mov dword [esi], 0x656e6977
mov dword [esi + 4], 0x7432336b
mov byte [esi + 8], 0x5c
mov dword [esp], ecx
mov ecx, dword [sym.imp.kernel32.dll_CreateDirectoryA]
mov dword [esp + 4], 0
mov dword [ebp - 0x504], ecx
call ecx
mov esi, eax
mov eax, dword [ebp - 0x510]
sub esp, 8
call fcn.004012e0
mov edx, dword [edi + 0x34]
mov eax, 1
test esi, esi
jne 0x4099c9
xor eax, eax
cmp edx, 0xb7
sete al
mov dword [esp + 8], edx
mov dword [esp + 4], str.CreateDirectoryA_returned_error__lu._n
mov dword [esp], eax
call fcn.00401dd0
cmp word [ebp - 0x4fc], 0
jne 0x409ff4
cmp word [ebp - 0x4c6], 0
je 0x409f92
lea edi, [ebp - 0x110]
lea eax, [ebp - 0x41c]
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], eax
mov dword [esp + 8], str._s_ls_
mov dword [esp + 4], 0x104
mov dword [ebp - 0x514], edi
mov dword [esp], edi
call fcn.00401170
mov esi, dword [ebp - 0x510]
mov ebx, eax
mov eax, esi
call fcn.004012e0
mov dword [esp + 8], ebx
sub ebx, 1
xor eax, eax
cmp ebx, 0x102
mov dword [esp + 4], 0x5818af
setbe al
mov dword [esp], eax
call fcn.00401dd0
mov dword [esp + 4], 0
mov dword [esp], edi
mov eax, dword [ebp - 0x504]
call eax
sub esp, 8
mov ebx, eax
mov eax, esi
call fcn.004012e0
mov eax, 1
mov edx, dword fs:[0x18]
mov ecx, dword [edx + 0x34]
test ebx, ebx
je 0x409f82
mov dword [esp + 8], ecx
mov dword [esp + 4], str.CreateDirectoryA_returned_error__lu._n
mov dword [esp], eax
call fcn.00401dd0
mov dword [esp + 0x10], str.sxs_dll.dll
mov eax, dword [ebp - 0x514]
mov dword [esp + 8], 0x581385
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x318]
mov dword [esp + 4], 0x104
mov dword [esp], eax
call fcn.00401170
mov edi, dword [ebp - 0x510]
mov ebx, eax
mov eax, edi
call fcn.004012e0
mov dword [esp + 8], ebx
sub ebx, 1
xor eax, eax
cmp ebx, 0x102
mov dword [esp + 4], 0x5818af
setbe al
mov dword [esp], eax
call fcn.00401dd0
mov ecx, 1
lock xadd dword [section..bss], ecx
mov eax, ecx
mov dword [esp + 8], str._sexe_08lx.manifest
add eax, 1
mov dword [esp + 4], 0x104
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x41c]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x214]
mov dword [esp], eax
call fcn.00401170
mov ebx, eax
mov eax, edi
call fcn.004012e0
mov dword [esp + 8], ebx
sub ebx, 1
xor eax, eax
cmp ebx, 0x102
mov dword [esp + 4], 0x5818af
setbe al
mov dword [esp], eax
call fcn.00401dd0
mov ecx, 0xffffffff
mov dword [esp + 4], 0
lea eax, [ebp - 0x214]
mov dword [esp], 0
mov edx, dword [ebp - 0x500]
call fcn.004025f0
lea eax, [ebp - 0x318]
call fcn.004049e0
mov eax, dword [ebp + 8]
mov edi, dword [eax]
xor eax, eax
test edi, edi
setne al
xor edx, edx
mov dword [ebp - 0x4f8], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xc]
mov dword [ebp - 0x4f4], eax
test ecx, ecx
je 0x409bdc
mov esi, dword [ecx]
test esi, esi
je 0x409bdc
lea eax, [ecx + 0xc]
lea esi, [esi]
mov ebx, dword [eax]
add eax, 0xc
add edx, 1
test ebx, ebx
jne 0x409bd0
lea eax, [ebp - 0x318]
mov dword [ebp - 0x4f0], edx
lea ebx, [ebp - 0x4f8]
mov dword [ebp - 0x4ec], ecx
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_BeginUpdateResourceA]
sub esp, 8
mov dword [ebp - 0x504], eax
mov edi, eax
mov eax, 0xf26
call fcn.004012e0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 4], str.BeginUpdateResourceA_returned_error__lu._n
mov dword [esp + 8], eax
xor eax, eax
test edi, edi
setne al
mov dword [esp], eax
call fcn.00401dd0
nop
mov eax, dword [ebx]
mov dword [ebp - 0x500], eax
test eax, eax
je 0x409cff
mov dword [ebp - 0x50c], ebx
mov esi, dword [ebx + 4]
xor edx, edx
mov edi, dword fs:[0x18]
lea esi, [esi]
mov ebx, dword [esi + 8]
mov dword [ebp - 0x4fc], edx
test ebx, ebx
cmove ebx, dword [ebp - 0x508]
add esi, 0xc
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll_strlen]
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], eax
movzx eax, word [esi - 8]
mov dword [esp + 0xc], eax
mov eax, dword [esi - 0xc]
mov dword [esp + 4], 0x18
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x504]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_UpdateResourceA]
sub esp, 0x18
mov ebx, eax
call fcn.0057d110
mov dword [eax], 0x58109f
mov dword [eax + 4], 0xf34
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.UpdateResourceA_returned_error__lu._n
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.00401dd0
mov edx, dword [ebp - 0x4fc]
mov eax, dword [ebp - 0x500]
add edx, 1
cmp edx, eax
jne 0x409c68
mov ebx, dword [ebp - 0x50c]
add ebx, 8
lea eax, [ebp - 0x4e8]
cmp ebx, eax
jne 0x409c40
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x504]
mov edi, dword fs:[0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_EndUpdateResourceA]
sub esp, 8
mov esi, eax
call fcn.0057d110
mov dword [eax], 0x58109f
mov dword [eax + 4], 0xf39
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.EndUpdateResourceA_returned_error__lu._n
mov dword [esp + 8], eax
mov dword [esp], esi
call fcn.00401dd0
lea eax, [ebp - 0x214]
mov dword [ebp - 0x4dc], 0
mov dword [ebp - 0x4e0], eax
lea eax, [ebp - 0x41c]
mov dword [ebp - 0x4d4], 0
mov dword [ebp - 0x4d0], 0
mov dword [ebp - 0x4cc], 0
mov dword [ebp - 0x4e8], 0x20
mov dword [ebp - 0x4d8], eax
mov dword [ebp - 0x4e4], 4
mov dword [edi + 0x34], 0xcccccccc
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CreateActCtxA]
sub esp, 4
mov ebx, eax
cmp eax, 0xffffffff
je 0x40a09e
mov eax, dword [ebp - 0x510]
call fcn.004012e0
xor eax, eax
test ebx, ebx
mov dword [esp + 8], ebx
setne al
mov dword [esp + 0xc], 0
mov dword [esp + 4], str.CreateActCtxA_returned__p__error__lu__n
mov dword [esp], eax
call fcn.00401dd0
mov dword [esp], ebx
xor ebx, ebx
call dword [sym.imp.kernel32.dll_ReleaseActCtx]
sub esp, 4
mov edi, dword [ebp - 0x510]
mov eax, edi
call fcn.004012e0
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x10]
mov dword [esp + 0xc], ebx
mov dword [esp + 4], str.expected_error__lu__got__lu_n
cmp eax, ebx
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401dd0
mov edx, dword [sym.imp.kernel32.dll_DeleteFileA]
lea eax, [ebp - 0x214]
mov dword [esp], eax
mov dword [ebp - 0x500], edx
call edx
sub esp, 4
mov esi, eax
call fcn.0057d110
mov dword [ebp - 0x510], edi
mov dword [eax + 4], edi
mov dword [eax], 0x58109f
lea eax, [ebp - 0x214]
mov edi, dword fs:[0x18]
mov ecx, dword [edi + 0x34]
mov dword [ebp - 0x4fc], ecx
call fcn.00401550
mov ecx, dword [ebp - 0x4fc]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 0xc], ecx
mov dword [esp + 4], str.DeleteFileA__s__returned_error__lu_n.
call fcn.00401dd0
lea eax, [ebp - 0x318]
mov dword [esp], eax
mov edx, dword [ebp - 0x500]
call edx
sub esp, 4
mov esi, eax
call fcn.0057d110
mov ecx, dword [ebp - 0x510]
mov dword [eax], 0x58109f
mov dword [eax + 4], ecx
mov edx, dword [edi + 0x34]
lea eax, [ebp - 0x318]
mov dword [ebp - 0x4fc], edx
call fcn.00401550
mov edx, dword [ebp - 0x4fc]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov dword [esp + 4], str.DeleteFileA__s__returned_error__lu_n.
call fcn.00401dd0
cmp word [ebp - 0x4c6], 0
jne 0x40a054
lea eax, [ebp - 0x41c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_RemoveDirectoryA]
mov esi, eax
mov eax, dword [ebp - 0x510]
sub esp, 4
call fcn.004012e0
mov eax, dword [ebp - 0x514]
call fcn.00401550
mov edi, eax
mov eax, dword fs:[0x18]
mov edx, dword [eax + 0x34]
lea eax, [ebp - 0x41c]
mov dword [ebp - 0x4fc], edx
call fcn.00401550
mov dword [esp + 0x10], edi
mov edx, dword [ebp - 0x4fc]
mov dword [esp + 8], eax
mov dword [esp], esi
mov dword [esp + 0xc], edx
mov dword [esp + 4], str.RemoveDirectoryA__s__returned_error__lu__s_n.
call fcn.00401dd0
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
xor eax, eax
cmp ecx, 0xb7
sete al
jmp 0x409a92
lea eax, [ebp - 0x41c]
mov dword [esp + 8], 0x5810c8
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x110]
mov dword [esp + 4], 0x104
mov dword [ebp - 0x514], eax
mov dword [esp], eax
call fcn.00401170
mov ebx, eax
mov eax, dword [ebp - 0x510]
call fcn.004012e0
mov dword [esp + 8], ebx
sub ebx, 1
xor eax, eax
cmp ebx, 0x102
mov dword [esp + 4], 0x5818af
setbe al
mov dword [esp], eax
call fcn.00401dd0
jmp 0x409aa6
mov dword [esp + 4], ebx
mov dword [esp + 0xc], 0x8000000
mov dword [esp + 8], 0x55
movzx edi, word [ebp - 0x4fc]
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_LCIDToLocaleName]
sub esp, 0x10
mov esi, eax
mov eax, 0xf5f
call fcn.004012e0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 8], edi
mov dword [esp + 4], str.lang_0x_04x__error__lu._n
mov dword [esp + 0xc], eax
xor eax, eax
test esi, esi
setg al
mov dword [esp], eax
call fcn.00401dd0
jmp 0x4099eb
mov eax, dword [ebp - 0x514]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_RemoveDirectoryA]
mov esi, eax
mov eax, dword [ebp - 0x510]
sub esp, 4
call fcn.004012e0
mov eax, dword [ebp - 0x514]
mov edi, dword [edi + 0x34]
call fcn.00401550
mov dword [esp + 0xc], edi
mov dword [esp + 8], eax
mov dword [esp + 4], str.RemoveDirectoryA__s__returned_error__lu_n.
mov dword [esp], esi
call fcn.00401dd0
jmp 0x409f10
mov ebx, dword [edi + 0x34]
mov eax, dword [ebp - 0x510]
call fcn.004012e0
xor eax, eax
test ebx, ebx
mov dword [esp + 8], ebx
setne al
mov dword [esp + 4], 0x582a48
mov dword [esp], eax
call fcn.00401dd0
jmp 0x409e0a