Function at 0x581da0
Capabilities:
Check if file exists
Create directory
Move file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5a2863
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x606040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x18], esi
cmp dword [ebp + 8], 1
jg 0x581de9
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
call fcn.0040cb53
test eax, eax
je 0x581e18
lea eax, [esi + 0x4b9c]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x4b94]
lea ecx, [esi + 0x4b94]
mov bl, byte [esi + 0x4bb4]
call dword [eax + 0x14]
test bl, bl
je 0x581dd3
call fcn.0040a74d
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x581e34
push 0x80004005
call fcn.00401e70
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x14], esi
mov dword [ebp - 4], 0
call fcn.0040a74d
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x581e64
push 0x80004005
call fcn.00401e70
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
lea ebx, [eax + 0x10]
mov dword [ebp - 0x1c], ebx
mov eax, 1
mov byte [ebp - 4], 1
or edi, 0xffffffff
mov dword [ebp - 0x24], eax
cmp dword [ebp + 8], eax
jle 0x58209a
lea esp, [esp]
mov ecx, dword [ebp + 0xc]
push dword [ecx + eax*4]
lea ecx, [ebp - 0x10]
call fcn.00402cd0
mov byte [ebp - 4], 2
mov ecx, 1
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], ecx
mov edi, dword [eax - 0xc]
cmp edi, ecx
jge 0x581ebd
mov ecx, edi
mov dword [ebp - 0x20], ecx
test edi, edi
jle 0x581f15
sub edi, ecx
cmp dword [eax - 4], 1
jle 0x581ed6
push dword [eax - 0xc]
lea ecx, [ebp - 0x10]
call fcn.00402570
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x20]
lea edx, [edi*2 + 2]
push edx
lea ecx, [eax + ecx*2]
push ecx
push edx
push eax
call fcn.00535e23
push eax
call fcn.004026c0
add esp, 0x14
test edi, edi
js 0x5821a9
mov eax, dword [ebp - 0x10]
cmp edi, dword [eax - 8]
jg 0x5821a9
mov dword [eax - 0xc], edi
xor ecx, ecx
mov eax, dword [ebp - 0x10]
mov word [eax + edi*2], cx
mov eax, dword [ebp - 0x10]
mov edi, dword [eax - 0xc]
test edi, edi
js 0x5821a9
movzx ecx, word [eax]
mov dword [ebp - 0x28], ecx
mov ecx, 1
mov dword [ebp - 0x20], ecx
cmp edi, ecx
jge 0x581f3b
mov ecx, edi
mov dword [ebp - 0x20], ecx
test edi, edi
jle 0x581f90
sub edi, ecx
cmp dword [eax - 4], 1
jle 0x581f54
push dword [eax - 0xc]
lea ecx, [ebp - 0x10]
call fcn.00402570
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x20]
lea edx, [edi*2 + 2]
push edx
lea ecx, [eax + ecx*2]
push ecx
push edx
push eax
call fcn.00535e23
push eax
call fcn.004026c0
add esp, 0x14
test edi, edi
js 0x5821a9
mov eax, dword [ebp - 0x10]
cmp edi, dword [eax - 8]
jg 0x5821a9
mov dword [eax - 0xc], edi
xor ecx, ecx
mov eax, dword [ebp - 0x10]
mov word [eax + edi*2], cx
push ecx
lea ecx, [ebp - 0x10]
call fcn.004083e0
push dword [ebp - 0x28]
call fcn.00536f0c
movzx eax, ax
add esp, 4
sub eax, 0x64
je 0x582011
sub eax, 2
mov eax, dword [ebp - 0x10]
jne 0x58206a
lea edx, [eax - 0x10]
lea edi, [esi - 0x10]
cmp edx, edi
je 0x58206a
cmp dword [edi + 0xc], 0
lea esi, [edi + 0xc]
jl 0x582000
mov ecx, dword [edx]
cmp ecx, dword [edi]
jne 0x582000
push edx
call fcn.004039f0
add esp, 4
mov dword [ebp - 0x28], eax
or ecx, 0xffffffff
lock xadd dword [esi], ecx
dec ecx
test ecx, ecx
jg 0x581ff8
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x28]
lea esi, [eax + 0x10]
mov dword [ebp - 0x14], esi
jmp 0x582067
push dword [eax - 0xc]
lea ecx, [ebp - 0x14]
push eax
call fcn.00403930
mov esi, dword [ebp - 0x14]
jmp 0x582067
mov eax, dword [ebp - 0x10]
lea edi, [ebx - 0x10]
lea edx, [eax - 0x10]
cmp edx, edi
je 0x58206a
cmp dword [edi + 0xc], 0
lea ebx, [edi + 0xc]
jl 0x582058
mov ecx, dword [edx]
cmp ecx, dword [edi]
jne 0x582058
push edx
call fcn.004039f0
add esp, 4
mov dword [ebp - 0x28], eax
or ecx, 0xffffffff
lock xadd dword [ebx], ecx
dec ecx
test ecx, ecx
jg 0x582050
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x28]
lea ebx, [eax + 0x10]
mov dword [ebp - 0x1c], ebx
jmp 0x582067
push dword [eax - 0xc]
lea ecx, [ebp - 0x1c]
push eax
call fcn.00403930
mov ebx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x10]
lea edx, [eax - 0x10]
mov byte [ebp - 4], 1
or edi, 0xffffffff
lea eax, [edx + 0xc]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58208a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x24]
inc eax
mov dword [ebp - 0x24], eax
cmp eax, dword [ebp + 8]
jl 0x581e90
push str.SU_Document
push esi
call fcn.00535e6f
add esp, 8
test eax, eax
jne 0x5822c3
mov eax, dword [ebp - 0x18]
cmp byte [eax + 0x4bb5], 0
je 0x5822c3
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x5822c3
mov eax, dword [0x6157fc]
add eax, 0xfffffff0
push eax
call fcn.004039f0
add esp, 4
lea esi, [eax + 0x10]
mov dword [ebp + 8], esi
mov byte [ebp - 4], 3
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x58210e
push 0x104
lea ecx, [ebp + 8]
call fcn.00402400
mov esi, dword [ebp + 8]
push str.PETEMP_LISTTEXT
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
add esi, 0xfffffff0
push esi
call fcn.004039f0
add esp, 4
lea esi, [eax + 0x10]
push 0
push esi
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
add esi, 0xfffffff0
mov ecx, edi
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58214d
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
push str.SUDocumentList
lea ecx, [ebp + 0xc]
call fcn.00402cd0
lea edx, [ebp + 0xc]
mov byte [ebp - 4], 4
lea ecx, [ebp + 8]
call fcn.0058f010
mov byte [ebp - 4], 3
mov ecx, edi
mov edx, dword [ebp + 0xc]
add edx, 0xfffffff0
movzx esi, ax
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58218c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
inc esi
call fcn.0040a74d
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x5821b3
push 0x80004005
call fcn.00401e70
push 0x80070057
call fcn.00401e70
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x24], eax
push str..txt
movsx eax, si
push eax
push 4
push str.SUDocumentList
lea eax, [ebp - 0x24]
mov byte [ebp - 4], 5
push str._s__0d_s
push eax
call fcn.00404210
mov edi, dword [ebp - 0x24]
push dword [edi - 8]
push edi
call fcn.005360d5
add esp, 0x20
test eax, eax
js 0x5821a9
cmp eax, dword [edi - 8]
jg 0x5821a9
mov esi, dword [ebp + 8]
xor ecx, ecx
mov dword [edi - 0xc], eax
mov word [edi + eax*2], cx
cmp dword [esi - 4], 1
jle 0x58221a
push dword [esi - 0xc]
lea ecx, [ebp + 8]
call fcn.00402570
mov esi, dword [ebp + 8]
push edi
push esi
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push dword [esi - 8]
push esi
call fcn.005360d5
add esp, 8
test eax, eax
js 0x5821a9
cmp eax, dword [esi - 8]
jg 0x5821a9
push esi
xor ecx, ecx
mov dword [esi - 0xc], eax
push ebx
mov word [esi + eax*2], cx
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
je 0x582283
mov eax, dword [ebp - 0x18]
add eax, 0x4bc0
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0x18]
lea eax, [ebp + 8]
push eax
lea ecx, [ecx + 0x4bd8]
call fcn.004085f0
mov ecx, dword [ebp - 0x18]
add ecx, 0x4bb8
mov eax, dword [ecx]
call dword [eax + 0x14]
lea edx, [edi - 0x10]
mov byte [ebp - 4], 3
or edi, 0xffffffff
lea eax, [edx + 0xc]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x5822a3
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 0xfffffff0
mov byte [ebp - 4], 1
mov ecx, edi
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x5822c0
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x14]
add ebx, 0xfffffff0
mov byte [ebp - 4], 0
or ecx, 0xffffffff
lea eax, [ebx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x5822e1
mov ecx, dword [ebx]
push ebx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
or ecx, 0xffffffff
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x582302
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8