Function at 0x51b000
Capabilities:
Check for protected handle exception
Delete file
Get common file path

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
lea ebx, [ebp - 0x21c]
mov edi, dword fs:[0x18]
sub esp, 0x248
mov eax, dword [sym.imp.kernel32.dll_DuplicateHandle]
mov dword [esp + 0x18], 3
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0xffffffff
mov dword [ebp - 0x220], eax
call eax
sub esp, 0x1c
mov esi, eax
call fcn.0057d110
mov dword [eax], 0x5eee7f
mov dword [eax + 4], 0x9aa
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.DuplicateHandle_error__lu_n
call fcn.0050e8b0
lea edx, [ebp - 0x218]
mov dword [esp + 4], edx
mov edx, dword [sym.imp.kernel32.dll_GetHandleInformation]
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov dword [ebp - 0x224], edx
call edx
sub esp, 8
mov esi, eax
call fcn.0057d110
mov dword [eax], 0x5eee7f
mov dword [eax + 4], 0x9ac
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.GetHandleInformation_error__lu_n
call fcn.0050e8b0
call fcn.0057d110
mov dword [eax], 0x5eee7f
mov dword [eax + 4], 0x9ad
mov eax, dword [ebp - 0x218]
mov dword [esp + 4], str.info___lx_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0050e8b0
call fcn.0057d110
mov dword [eax], 0x5eee7f
mov dword [eax + 4], 0x9ae
xor eax, eax
mov dword [esp + 4], str.out__GetCurrentProcess___n
cmp dword [ebp - 0x21c], 0xffffffff
setne al
mov dword [esp], eax
call fcn.0050e8b0
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov dword [ebp - 0x228], esi
call esi
sub esp, 4
mov dword [esp + 0x18], 3
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0xffffffff
mov eax, dword [ebp - 0x220]
call eax
sub esp, 0x1c
mov esi, eax
call fcn.0057d110
mov dword [eax], 0x5eee7f
mov dword [eax + 4], 0x9b4
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.DuplicateHandle_error__lu_n
call fcn.0050e8b0
lea eax, [ebp - 0x218]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov edx, dword [ebp - 0x224]
call edx
sub esp, 8
mov esi, eax
call fcn.0057d110
mov dword [eax], 0x5eee7f
mov dword [eax + 4], 0x9b6
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.GetHandleInformation_error__lu_n
call fcn.0050e8b0
call fcn.0057d110
mov dword [eax], 0x5eee7f
mov dword [eax + 4], 0x9b7
mov eax, dword [ebp - 0x218]
mov dword [esp + 4], str.info___lx_n
cmp eax, 1
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0050e8b0
call fcn.0057d110
mov dword [eax], 0x5eee7f
mov dword [eax + 4], 0x9b8
xor eax, eax
mov dword [esp + 4], str.out__GetCurrentProcess___n
cmp dword [ebp - 0x21c], 0xffffffff
setne al
mov dword [esp], eax
call fcn.0050e8b0
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov esi, dword [ebp - 0x228]
call esi
lea esi, [ebp - 0x214]
sub esp, 4
mov dword [esp + 4], esi
mov dword [esp], 0x104
call dword [sym.imp.kernel32.dll_GetTempPathA]
lea eax, [ebp - 0x110]
sub esp, 8
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x5eee65
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_GetTempFileNameA]
lea eax, [ebp - 0x110]
sub esp, 0x10
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_CreateFileA]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40000000
mov dword [ebp - 0x22c], eax
call eax
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x51bd78
mov esi, eax
mov dword [esp + 0x18], 3
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], eax
mov dword [esp], 0xffffffff
mov eax, dword [ebp - 0x220]
call eax
sub esp, 0x1c
mov dword [ebp - 0x230], eax
mov eax, 0x9c6
call fcn.0050dc60
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.DuplicateHandle_error__lu_n
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x230]
mov dword [esp], ecx
call fcn.0050e8b0
mov eax, 0x9c7
call fcn.0050dc60
mov dword [esp + 4], str.f___out_n
xor eax, eax
cmp dword [ebp - 0x21c], esi
sete al
mov dword [esp], eax
call fcn.0050e8b0
lea edx, [ebp - 0x218]
mov dword [esp + 4], edx
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov edx, dword [ebp - 0x224]
call edx
sub esp, 8
mov dword [ebp - 0x230], eax
mov eax, 0x9c9
call fcn.0050dc60
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.GetHandleInformation_error__lu_n
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x230]
mov dword [esp], ecx
call fcn.0050e8b0
mov eax, 0x9ca
call fcn.0050dc60
mov eax, dword [ebp - 0x218]
mov dword [esp + 4], str.info___lx_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0050e8b0
mov dword [esp + 0x18], 3
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], esi
mov dword [esp], 0xffffffff
mov eax, dword [ebp - 0x220]
call eax
sub esp, 0x1c
mov dword [ebp - 0x230], eax
mov eax, 0x9ce
call fcn.0050dc60
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.DuplicateHandle_error__lu_n
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x230]
mov dword [esp], ecx
call fcn.0050e8b0
mov eax, 0x9cf
call fcn.0050dc60
mov dword [esp + 4], str.f___out_n
xor eax, eax
cmp dword [ebp - 0x21c], esi
sete al
mov dword [esp], eax
call fcn.0050e8b0
lea ecx, [ebp - 0x218]
mov dword [esp + 4], ecx
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov edx, dword [ebp - 0x224]
call edx
sub esp, 8
mov dword [ebp - 0x230], eax
mov eax, 0x9d1
call fcn.0050dc60
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.GetHandleInformation_error__lu_n
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x230]
mov dword [esp], ecx
call fcn.0050e8b0
mov eax, 0x9d2
call fcn.0050dc60
mov eax, dword [ebp - 0x218]
mov dword [esp + 4], str.info___lx_n
cmp eax, 1
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0050e8b0
mov ecx, dword [sym.imp.kernel32.dll_SetHandleInformation]
mov dword [esp + 8], 2
mov dword [esp + 4], 2
mov dword [esp], esi
mov dword [ebp - 0x230], ecx
call ecx
sub esp, 0xc
mov dword [ebp - 0x234], eax
mov eax, 0x9d5
call fcn.0050dc60
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.SetHandleInformation_error__lu_n
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x234]
mov dword [esp], ecx
call fcn.0050e8b0
mov dword [esp + 0x18], 3
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], esi
mov dword [esp], 0xffffffff
mov eax, dword [ebp - 0x220]
call eax
sub esp, 0x1c
mov dword [ebp - 0x234], eax
mov eax, 0x9d8
call fcn.0050dc60
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.DuplicateHandle_error__lu_n
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x234]
mov dword [esp], ecx
call fcn.0050e8b0
mov eax, 0x9d9
call fcn.0050dc60
mov dword [esp + 4], str.f__out_n
xor eax, eax
cmp dword [ebp - 0x21c], esi
setne al
mov dword [esp], eax
call fcn.0050e8b0
lea eax, [ebp - 0x218]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov edx, dword [ebp - 0x224]
call edx
sub esp, 8
mov dword [ebp - 0x234], eax
mov eax, 0x9db
call fcn.0050dc60
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.GetHandleInformation_error__lu_n
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x234]
mov dword [esp], ecx
call fcn.0050e8b0
mov eax, 0x9dc
call fcn.0050dc60
mov eax, dword [ebp - 0x218]
mov dword [esp + 4], str.info___lx_n
cmp eax, 1
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0050e8b0
mov dword [esp + 8], 0
mov dword [esp + 4], 2
mov dword [esp], esi
mov ecx, dword [ebp - 0x230]
call ecx
sub esp, 0xc
mov dword [ebp - 0x234], eax
mov eax, 0x9de
call fcn.0050dc60
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.SetHandleInformation_error__lu_n
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x234]
mov dword [esp], ecx
call fcn.0050e8b0
mov eax, dword [ebp - 0x21c]
cmp eax, esi
jae 0x51bd50
mov dword [esp], eax
mov edi, dword [ebp - 0x228]
call edi
sub esp, 4
mov dword [esp + 4], esi
mov dword [esp + 0x18], 3
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xffffffff
mov dword [esp], 0xffffffff
mov eax, dword [ebp - 0x220]
call eax
sub esp, 0x1c
mov dword [ebp - 0x238], eax
mov eax, 0x9ed
call fcn.0050dc60
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x34]
mov dword [ebp - 0x234], edx
mov dword [esp + 4], str.DuplicateHandle_error__lu_n
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x238]
mov dword [esp], ecx
call fcn.0050e8b0
mov eax, 0x9ee
call fcn.0050dc60
mov dword [esp + 4], str.f___out_n
xor eax, eax
cmp dword [ebp - 0x21c], esi
sete al
mov dword [esp], eax
call fcn.0050e8b0
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
call edi
lea edx, [ebp - 0x110]
sub esp, 4
mov dword [esp], edx
call dword [sym.imp.kernel32.dll_DeleteFileA]
sub esp, 4
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0xc0000000
mov dword [esp], str.CONIN_
mov edx, dword [ebp - 0x22c]
call edx
sub esp, 0x1c
mov esi, eax
mov eax, 0x9f3
call fcn.0050dc60
mov edx, dword [ebp - 0x234]
mov eax, dword [edx + 0x34]
mov dword [esp + 4], str.Failed_to_open_CONIN___lu_n
mov dword [esp + 8], eax
xor eax, eax
cmp esi, 0xffffffff
setne al
mov dword [esp], eax
call fcn.0050e8b0
mov dword [esp + 0x18], 3
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], esi
mov dword [esp], 0xffffffff
mov eax, dword [ebp - 0x220]
call eax
sub esp, 0x1c
mov edi, eax
mov eax, 0x9f6
call fcn.0050dc60
mov edx, dword [ebp - 0x234]
mov eax, dword [edx + 0x34]
mov dword [esp + 4], str.DuplicateHandle_error__lu_n
mov dword [esp], edi
mov dword [esp + 8], eax
call fcn.0050e8b0
mov eax, 0x9f7
call fcn.0050dc60
mov eax, 1
cmp dword [ebp - 0x21c], esi
je 0x51b886
and esi, 3
xor eax, eax
cmp esi, 3
je 0x51bd60
mov dword [esp], eax
mov dword [esp + 4], str.f___out_n
mov esi, dword fs:[0x18]
call fcn.0050e8b0
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov edi, dword [ebp - 0x228]
call edi
sub esp, 4
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x80000000
mov dword [esp], 0x5f0eba
mov edx, dword [ebp - 0x22c]
call edx
sub esp, 0x1c
mov edi, eax
mov eax, 0x9fc
call fcn.0050dc60
mov eax, dword [esi + 0x34]
mov dword [esp + 4], str.Failed_to_open_NUL__lu_n
mov dword [esp + 8], eax
xor eax, eax
cmp edi, 0xffffffff
setne al
mov dword [esp], eax
call fcn.0050e8b0
lea edx, [ebp - 0x218]
mov dword [esp + 4], edx
mov dword [ebp - 0x22c], edi
mov dword [esp], edi
mov edx, dword [ebp - 0x224]
call edx
sub esp, 8
mov edi, eax
mov eax, 0x9fe
call fcn.0050dc60
mov eax, dword [ebp - 0x218]
mov dword [esp + 4], str.Unexpected_info__lx_n
test eax, eax
mov dword [esp + 8], eax
sete cl
xor eax, eax
test edi, edi
setne al
and eax, ecx
mov dword [esp], eax
call fcn.0050e8b0
mov dword [esp + 0xc], ebx
mov dword [esp + 0x18], 6
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0xffffffff
mov edi, dword [ebp - 0x22c]
mov dword [esp], 0xffffffff
mov dword [esp + 4], edi
mov ecx, dword [ebp - 0x220]
call ecx
sub esp, 0x1c
mov edi, eax
mov eax, 0xa02
call fcn.0050dc60
mov eax, dword [esi + 0x34]
mov dword [esp], edi
mov dword [esp + 4], str.DuplicateHandle_error__lu_n
mov dword [esp + 8], eax
call fcn.0050e8b0
lea eax, [ebp - 0x218]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov edx, dword [ebp - 0x224]
call edx
sub esp, 8
mov edi, eax
mov eax, 0xa04
call fcn.0050dc60
mov eax, dword [ebp - 0x218]
mov dword [esp + 4], str.Unexpected_info__lx_n
test eax, eax
mov dword [esp + 8], eax
sete cl
xor eax, eax
test edi, edi
setne al
and eax, ecx
mov dword [esp], eax
call fcn.0050e8b0
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov eax, dword [ebp - 0x228]
call eax
sub esp, 4
mov dword [esp + 8], 3
mov dword [esp + 4], 3
mov edi, dword [ebp - 0x22c]
mov dword [esp], edi
mov eax, dword [ebp - 0x230]
call eax
sub esp, 0xc
mov edi, eax
mov eax, 0xa09
call fcn.0050dc60
mov eax, dword [esi + 0x34]
mov dword [esp], edi
mov dword [esp + 4], str.SetHandleInformation_error__lu_n
mov dword [esp + 8], eax
call fcn.0050e8b0
lea ecx, [ebp - 0x218]
mov dword [ebp - 0x218], 0xdeabeef
mov dword [esp + 4], ecx
mov edi, dword [ebp - 0x22c]
mov dword [esp], edi
mov edx, dword [ebp - 0x224]
call edx
sub esp, 8
mov edi, eax
mov eax, 0xa0c
call fcn.0050dc60
mov eax, dword [ebp - 0x218]
mov dword [esp + 4], str.Unexpected_info__lx_n
cmp eax, 3
mov dword [esp + 8], eax
sete cl
xor eax, eax
test edi, edi
setne al
and eax, ecx
mov dword [esp], eax
call fcn.0050e8b0
mov eax, 0xa0d
call fcn.0050dc60
mov eax, dword [esi + 0x34]
mov dword [esp], edi
mov dword [esp + 4], str.SetHandleInformation_error__lu_n
mov dword [esp + 8], eax
call fcn.0050e8b0
mov dword [esp + 0xc], ebx
mov dword [esp + 0x18], 6
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0xffffffff
mov edi, dword [ebp - 0x22c]
mov dword [esp], 0xffffffff
mov dword [esp + 4], edi
mov ecx, dword [ebp - 0x220]
call ecx
sub esp, 0x1c
mov edi, eax
mov eax, 0xa10
call fcn.0050dc60
mov eax, dword [esi + 0x34]
mov dword [esp], edi
mov dword [esp + 4], str.DuplicateHandle_error__lu_n
mov dword [esp + 8], eax
call fcn.0050e8b0
lea ecx, [ebp - 0x218]
mov dword [ebp - 0x218], 0xdeabeef
mov dword [esp + 4], ecx
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov edx, dword [ebp - 0x224]
call edx
sub esp, 8
mov edi, eax
mov eax, 0xa13
call fcn.0050dc60
mov eax, dword [ebp - 0x218]
test edi, edi
mov dword [esp + 4], str.Unexpected_info__lx_n
setne cl
cmp eax, 3
mov dword [esp + 8], eax
sete al
movzx eax, al
and eax, ecx
mov dword [esp], eax
call fcn.0050e8b0
mov dword [esp + 8], 0
mov dword [esp + 4], 2
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov eax, dword [ebp - 0x230]
call eax
sub esp, 0xc
mov edi, eax
mov eax, 0xa15
call fcn.0050dc60
mov eax, dword [esi + 0x34]
mov dword [esp], edi
mov dword [esp + 4], str.SetHandleInformation_error__lu_n
mov dword [esp + 8], eax
call fcn.0050e8b0
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov eax, dword [ebp - 0x228]
call eax
sub esp, 4
mov dword [esp + 8], 0
mov dword [esp + 4], 3
mov edi, dword [ebp - 0x22c]
mov dword [esp], edi
mov eax, dword [ebp - 0x230]
call eax
sub esp, 0xc
mov edi, eax
mov eax, 0xa18
call fcn.0050dc60
mov eax, dword [esi + 0x34]
mov dword [esp], edi
mov dword [esp + 4], str.SetHandleInformation_error__lu_n
mov dword [esp + 8], eax
call fcn.0050e8b0
mov edi, dword [ebp - 0x22c]
mov dword [esp], edi
mov edi, dword [ebp - 0x228]
call edi
sub esp, 4
mov dword [esp + 0xc], ebx
mov dword [esp + 0x18], 6
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0xffffffff
mov ecx, dword [ebp - 0x220]
call ecx
sub esp, 0x1c
mov ebx, eax
mov eax, 0xa1d
call fcn.0050dc60
mov eax, dword [esi + 0x34]
mov dword [esp], ebx
mov dword [esp + 4], str.DuplicateHandle_error__lu_n
mov dword [esp + 8], eax
call fcn.0050e8b0
lea eax, [ebp - 0x218]
mov dword [ebp - 0x218], 0xdeabeef
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
mov edx, dword [ebp - 0x224]
call edx
sub esp, 8
mov ebx, eax
mov eax, 0xa20
call fcn.0050dc60
mov eax, dword [ebp - 0x218]
mov dword [esp + 4], str.Unexpected_info__lx_n
test eax, eax
mov dword [esp + 8], eax
sete dl
xor eax, eax
test ebx, ebx
setne al
and eax, edx
mov dword [esp], eax
call fcn.0050e8b0
mov eax, dword [ebp - 0x21c]
mov dword [esp], eax
call edi
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, esi
mov esi, eax
mov eax, edx
jmp 0x51b6c4
mov edx, dword [0x8f0770]
xor eax, eax
test edx, edx
sete al
jmp 0x51b886
mov eax, 0x9c0
call fcn.0050dc60
lea eax, [ebp - 0x110]
mov dword [esp + 4], str.could_not_create__s_n
mov dword [esp + 8], eax
mov dword [esp], 0
call fcn.0050e8b0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret