Function at 0x10051c70
Capabilities:
Clear file content
Delete file
Move file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7c
push esi
mov dword [ebp - 0x10], ecx
mov byte [ebp - 1], 1
mov byte [ebp - 2], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x20]
mov eax, dword [ecx + 4]
sub eax, dword [edx]
cdq
mov ecx, 0x34
idiv ecx
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp - 0x10]
call fcn.100512b0
movzx edx, ax
cmp edx, dword [ebp - 0x24]
je 0x10051cc3
xor al, al
jmp 0x1005226c
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x10]
call fcn.10051920
movzx ecx, al
test ecx, ecx
je 0x10052269
mov dword [ebp - 0x14], 0x40
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x18]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x18]
push edx
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x3c]
push ecx
call fcn.10055090
add esp, 0x10
movzx edx, al
test edx, edx
jne 0x10051d0a
mov byte [ebp - 1], 0
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x10]
cmp dword [ecx + 0x20], 0
je 0x10051d60
mov edx, dword [ebp - 0x10]
cmp dword [edx + 0x1c], 0
je 0x10051d60
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x20]
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x1c]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x18]
push edx
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x3c]
push ecx
call fcn.10055090
add esp, 0x10
movzx edx, al
test edx, edx
jne 0x10051d57
mov byte [ebp - 1], 0
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x10]
call fcn.100504c0
movzx ecx, al
test ecx, ecx
je 0x10051d78
mov dword [ebp - 0x14], 0xf8
jmp 0x10051d7f
mov dword [ebp - 0x14], 0x108
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x24]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x18]
push edx
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x3c]
push ecx
call fcn.10055090
add esp, 0x10
movzx edx, al
test edx, edx
jne 0x10051da8
mov byte [ebp - 1], 0
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], 0x28
xor ecx, ecx
mov word [ebp - 0xc], cx
jmp 0x10051dcc
mov dx, word [ebp - 0xc]
add dx, 1
mov word [ebp - 0xc], dx
movzx esi, word [ebp - 0xc]
mov ecx, dword [ebp - 0x10]
call fcn.100512b0
movzx eax, ax
cmp esi, eax
jge 0x10051e27
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x28], ecx
movzx edx, word [ebp - 0xc]
imul eax, edx, 0x34
mov ecx, dword [ebp - 0x28]
add eax, dword [ecx]
mov dword [ebp - 0x2c], eax
mov edx, dword [ebp - 0x2c]
push edx
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x3c]
push eax
call fcn.10055090
add esp, 0x10
movzx ecx, al
test ecx, ecx
jne 0x10051e1c
mov byte [ebp - 1], 0
jmp 0x10051e27
mov edx, dword [ebp - 0x18]
add edx, dword [ebp - 0x14]
mov dword [ebp - 0x18], edx
jmp 0x10051dc0
mov eax, dword [ebp - 0x10]
cmp dword [eax + 0x48], 0
je 0x10051e6b
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx + 0x48]
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x4c]
push ecx
mov edx, dword [ebp - 0x14]
push edx
mov eax, dword [ebp - 0x18]
push eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx + 0x3c]
push edx
call fcn.10055090
add esp, 0x10
movzx eax, al
test eax, eax
jne 0x10051e62
mov byte [ebp - 1], 0
mov ecx, dword [ebp - 0x18]
add ecx, dword [ebp - 0x14]
mov dword [ebp - 0x18], ecx
xor edx, edx
mov word [ebp - 8], dx
jmp 0x10051e7f
mov ax, word [ebp - 8]
add ax, 1
mov word [ebp - 8], ax
movzx esi, word [ebp - 8]
mov ecx, dword [ebp - 0x10]
call fcn.100512b0
movzx ecx, ax
cmp esi, ecx
jge 0x1005205a
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0x30], edx
movzx eax, word [ebp - 8]
imul ecx, eax, 0x34
mov edx, dword [ebp - 0x30]
add ecx, dword [edx]
mov dword [ebp - 0x34], ecx
mov eax, dword [ebp - 0x34]
cmp dword [eax + 0x14], 0
jne 0x10051eb6
jmp 0x10051e73
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x38], ecx
movzx edx, word [ebp - 8]
imul eax, edx, 0x34
mov ecx, dword [ebp - 0x38]
add eax, dword [ecx]
mov dword [ebp - 0x3c], eax
mov edx, dword [ebp - 0x3c]
mov eax, dword [edx + 0x14]
cmp eax, dword [ebp - 0x18]
jbe 0x10051f27
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x40], ecx
movzx edx, word [ebp - 8]
imul eax, edx, 0x34
mov ecx, dword [ebp - 0x40]
add eax, dword [ecx]
mov dword [ebp - 0x44], eax
mov edx, dword [ebp - 0x44]
mov eax, dword [edx + 0x14]
sub eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x18]
push edx
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x3c]
push ecx
mov ecx, dword [ebp - 0x10]
call fcn.100524e0
movzx edx, al
test edx, edx
jne 0x10051f1e
mov byte [ebp - 1], 0
jmp 0x1005205a
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x48], ecx
movzx edx, word [ebp - 8]
imul eax, edx, 0x34
mov ecx, dword [ebp - 0x48]
add eax, dword [ecx]
mov dword [ebp - 0x4c], eax
mov edx, dword [ebp - 0x4c]
mov eax, dword [edx + 0x2c]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x10052055
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x50], ecx
movzx edx, word [ebp - 8]
imul eax, edx, 0x34
mov ecx, dword [ebp - 0x50]
add eax, dword [ecx]
mov dword [ebp - 0x58], eax
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0x54], edx
movzx eax, word [ebp - 8]
imul ecx, eax, 0x34
mov edx, dword [ebp - 0x54]
add ecx, dword [edx]
mov dword [ebp - 0x5c], ecx
mov eax, dword [ebp - 0x58]
mov ecx, dword [eax + 0x28]
push ecx
mov edx, dword [ebp - 0x14]
push edx
mov eax, dword [ebp - 0x5c]
mov ecx, dword [eax + 0x14]
push ecx
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x3c]
push eax
call fcn.10055090
add esp, 0x10
movzx ecx, al
test ecx, ecx
jne 0x10051faa
mov byte [ebp - 1], 0
jmp 0x1005205a
mov edx, dword [ebp - 0x18]
add edx, dword [ebp - 0x14]
mov dword [ebp - 0x18], edx
mov byte [ebp - 2], 1
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x60], eax
movzx ecx, word [ebp - 8]
imul edx, ecx, 0x34
mov eax, dword [ebp - 0x60]
add edx, dword [eax]
mov dword [ebp - 0x68], edx
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x64], ecx
movzx edx, word [ebp - 8]
imul eax, edx, 0x34
mov ecx, dword [ebp - 0x64]
add eax, dword [ecx]
mov dword [ebp - 0x6c], eax
mov edx, dword [ebp - 0x68]
mov eax, dword [ebp - 0x6c]
mov ecx, dword [edx + 0x2c]
cmp ecx, dword [eax + 0x10]
jae 0x10052055
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0x70], edx
movzx eax, word [ebp - 8]
imul ecx, eax, 0x34
mov edx, dword [ebp - 0x70]
add ecx, dword [edx]
mov dword [ebp - 0x78], ecx
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x74], eax
movzx ecx, word [ebp - 8]
imul edx, ecx, 0x34
mov eax, dword [ebp - 0x74]
add edx, dword [eax]
mov dword [ebp - 0x7c], edx
mov ecx, dword [ebp - 0x78]
mov edx, dword [ebp - 0x7c]
mov eax, dword [ecx + 0x10]
sub eax, dword [edx + 0x2c]
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x18]
push edx
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x3c]
push ecx
mov ecx, dword [ebp - 0x10]
call fcn.100524e0
movzx edx, al
test edx, edx
jne 0x1005204c
mov byte [ebp - 1], 0
jmp 0x1005205a
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
jmp 0x10051e73
mov ecx, dword [ebp - 0x10]
cmp dword [ecx + 0x30], 0
je 0x100520a7
mov edx, dword [ebp - 0x10]
cmp dword [edx + 0x2c], 0
je 0x100520a7
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x30]
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x2c]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x18]
push edx
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x3c]
push ecx
call fcn.10055090
add esp, 0x10
movzx edx, al
test edx, edx
jne 0x1005209e
mov byte [ebp - 1], 0
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx + 0x3c]
push edx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x18]
mov dword [eax + 0xc], ecx
mov ecx, dword [ebp - 0x10]
call fcn.100519a0
movzx edx, byte [ebp - 2]
test edx, edx
jne 0x100520d4
xor al, al
jmp 0x1005226c
cmp dword [ebp + 8], 0
jne 0x10052269
push 0
push 0x104f33a8
push 0x104
push 0x10308798
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
jne 0x1005210d
push 0x103087a8
call fcn.1003e700
add esp, 4
xor al, al
jmp 0x1005226c
call fcn.10038530
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
push eax
push 0x104f33a8
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
je 0x1005217c
push 0x104
push 0
push 0x104f33a8
call fcn.1024a480
add esp, 0xc
push 0
push 0x104f33a8
push 0x104
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
jne 0x1005216a
push 0x10308828
call fcn.1003e700
add esp, 4
xor al, al
jmp 0x1005226c
push 0x104f33a8
call fcn.1003e840
add esp, 4
jmp 0x10052269
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x10052237
push str.savePeFileToDisk:_Name_clash__trying_to_obtain_new_name...
call fcn.1003cfa0
add esp, 4
call fcn.10038530
mov dword [ebp - 0x1c], eax
mov edx, dword [ebp - 0x1c]
push edx
push 0x104f33a8
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
je 0x10052203
push 0x104
push 0
push 0x104f33a8
call fcn.1024a480
add esp, 0xc
push 0
push 0x104f33a8
push 0x104
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
jne 0x100521f4
push str.savePeFileToDisk:_There_was_a_problem_obtaining_the_full_file_path
call fcn.1003e700
add esp, 4
xor al, al
jmp 0x1005226c
push 0x104f33a8
call fcn.1003e840
add esp, 4
jmp 0x10052235
push str.savePeFileToDisk:_Failed_twice_to_rename_file
call fcn.1003e700
add esp, 4
push 0x104f33a8
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x10052231
push 0x104f33a8
push 0x103087ec
call fcn.1003e700
add esp, 8
xor al, al
jmp 0x1005226c
jmp 0x10052269
push str.savePeFileToDisk:_There_was_a_problem_renaming_the_file
call fcn.1003e700
add esp, 4
push 0x104f33a8
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x10052265
push 0x104f33a8
push str.savePeFileToDisk:_There_was_a_problem_deleting_the_file:__s
call fcn.1003e700
add esp, 8
xor al, al
jmp 0x1005226c
mov al, byte [ebp - 1]
pop esi
mov esp, ebp
pop ebp
ret 4