Function at 0x10020220
Capabilities:
Check if file exists
Clear file content
Delete file
Get file attributes
Resolve function by parsing pe exports
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xb4
mov eax, dword [0x10086084]
xor eax, esp
mov dword [esp + 0xb0], eax
mov eax, dword [ebp + 0x10]
xor ecx, ecx
or dword [esp + 0x14], 0xffffffff
inc ecx
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x60], eax
mov eax, dword [ebp + 0x14]
push ebx
mov dword [esp + 0x60], eax
mov eax, dword [ebp + 0x1c]
push esi
mov dword [esp + 0x60], eax
xor eax, eax
push edi
mov edi, dword [ebp + 8]
mov esi, eax
mov dword [esp + 0x58], edi
mov ebx, eax
mov dword [esp + 0x48], edx
mov dword [esp + 0x30], ecx
mov dword [esp + 0x24], esi
mov dword [esp + 0x18], esi
mov dword [esp + 0x28], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x44], eax
test edi, edi
je 0x10020bd2
cmp word [edi], ax
je 0x10020bd2
test edx, edx
je 0x10020bd2
cmp word [edx], ax
je 0x10020bd2
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x10020bd2
test dword [esp + 0x64], 0xfefffffe
jne 0x10020bd2
xor eax, eax
push eax
push eax
push 0x20000040
push 3
push eax
push edi
call sym.WIMGAPI.DLL_WIMCreateFile
mov ecx, eax
mov dword [esp + 0x1c], ecx
test ecx, ecx
je 0x10020b5c
call fcn.10031cf2
mov dword [esp + 0x50], eax
call fcn.10031d1d
mov dword [esp + 0x4c], eax
call fcn.10030a0e
test eax, eax
je 0x10020b54
cmp dword [ecx], 0xfeedf001
jne 0x10020b54
mov ecx, dword [eax + 0x1f0]
mov ebx, dword [esp + 0x4c]
mov eax, dword [eax + 0x1f4]
mov dword [esp + 0x38], ecx
mov dword [esp + 0x34], eax
test ebx, ebx
je 0x1002035e
push dword [ebx]
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov dword [esp + 0x3c], edi
test edi, edi
je 0x10020403
mov eax, dword [ebx]
mov dword [edi], eax
mov eax, dword [ebx + 4]
mov dword [edi + 4], eax
mov eax, dword [ebx + 8]
mov dword [edi + 8], eax
xor ecx, ecx
test byte [esp + 0x64], 1
push ecx
push 0x8000000
push ecx
pop eax
sete al
mov ebx, ecx
inc eax
push eax
push ecx
push ecx
push 0x40000000
push dword [esp + 0x60]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [esp + 0x20], edi
mov dword [esp + 0x2c], edi
cmp edi, 0xffffffff
je 0x10020b5c
push ebx
push ebx
push dword [esp + 0x3c]
push dword [esp + 0x44]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x10020b5c
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
je 0x10020b5c
push ebx
push ebx
push dword [0x100866bc]
push dword [0x100866b8]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x10020b5c
xor eax, eax
lea edi, [esp + 0x8c]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor eax, eax
lea edi, [esp + 0x78]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x1002040a
mov eax, dword [eax + 8]
jmp 0x1002040f
xor ebx, ebx
jmp 0x10020b5c
mov eax, 0xa00000
xor ebx, ebx
test eax, eax
setne bl
test eax, eax
je 0x1002043a
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov eax, ebx
mov ebx, edi
mov dword [esp + 0x44], edi
neg ebx
sbb ebx, ebx
and ebx, eax
test ebx, ebx
je 0x10020b5c
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x1002045c
cmp dword [eax], esi
je 0x1002045c
mov esi, 0x4d3
xor ebx, ebx
mov dword [esp + 0x24], esi
mov dword [esp + 0x18], esi
test ebx, ebx
je 0x10020b4e
mov eax, dword [esp + 0x50]
lea edi, [esp + 0x8c]
and dword [esp + 0x54], 0
mov ecx, dword [eax + 8]
xor eax, eax
stosd dword es:[edi], eax
push ecx
mov dword [esp + 0x44], ecx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [esp + 0x90]
mov edi, dword [esp + 0x48]
mov edx, edi
push eax
push ecx
mov ecx, dword [esp + 0x28]
call fcn.1001b946
test eax, eax
je 0x100204b9
push 0
lea eax, [esp + 0x58]
push eax
push dword [esp + 0x48]
push edi
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x100204cb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
xor ebx, ebx
mov dword [esp + 0x24], esi
mov dword [esp + 0x18], esi
test ebx, ebx
je 0x10020b4e
mov ecx, dword [esp + 0x50]
xor edi, edi
mov esi, dword [esp + 0x50]
mov dword [esp + 0x10], edi
mov eax, dword [ecx + 0x48]
add eax, dword [ecx + 0x40]
mov edx, dword [ecx + 8]
mov ecx, dword [ecx + 0x4c]
adc ecx, dword [esi + 0x44]
sub eax, edx
mov esi, dword [esp + 0x24]
sbb ecx, edi
mov dword [esp + 0x54], eax
mov dword [esp + 0x60], ecx
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x14], edx
lea eax, [ecx + 0xc]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x4c]
sub eax, ecx
mov dword [esp + 0x70], eax
mov ecx, dword [esp + 0x54]
mov eax, ecx
or eax, dword [esp + 0x60]
je 0x10020866
cmp dword [esp + 0x60], 0
jg 0x10020540
jl 0x1002053a
cmp ecx, 0xa00000
jae 0x10020540
mov dword [esp + 0x40], ecx
jmp 0x10020548
mov dword [esp + 0x40], 0xa00000
test ebx, ebx
je 0x10020b4e
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x1002056b
cmp dword [eax], 0
je 0x1002056b
mov esi, 0x4d3
xor ebx, ebx
mov dword [esp + 0x24], esi
mov dword [esp + 0x18], esi
test ebx, ebx
je 0x10020b4e
xor eax, eax
lea edi, [esp + 0xa0]
push 7
pop ecx
rep stosd dword es:[edi], eax
lea edi, [esp + 0x8c]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor eax, eax
mov edi, dword [esp + 0x10]
mov dword [esp + 0x98], edi
lea edi, [esp + 0x78]
stosd dword es:[edi], eax
mov dword [esp + 0x94], edx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov edi, dword [esp + 0x10]
mov dword [esp + 0x80], edx
mov edx, dword [esp + 0x4c]
mov dword [esp + 0x84], edi
test edx, edx
je 0x100205e7
mov esi, dword [esp + 0x70]
lea edi, [esp + 0xa8]
mov eax, dword [esp + 0x1c]
add esi, dword [esp + 0x5c]
push 5
pop ecx
mov dword [esp + 0xa0], eax
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x10]
mov esi, dword [esp + 0x40]
lea ecx, [esp + 0xa0]
push 0
xor eax, eax
push esi
push eax
push eax
push eax
mov eax, edx
neg eax
sbb eax, eax
and eax, ecx
mov ecx, dword [esp + 0x30]
push eax
mov eax, edx
neg eax
sbb eax, eax
and eax, 0x1001ff80
push eax
push 0xa00000
push dword [esp + 0x64]
lea eax, [esp + 0x9c]
push eax
push dword [esp + 0x48]
lea eax, [esp + 0xb8]
push eax
call fcn.100310a3
mov edx, eax
xor ecx, ecx
call fcn.10022a1e
mov ecx, dword [esp + 0xa4]
mov ebx, eax
test ebx, ebx
jne 0x1002064f
test ecx, ecx
je 0x100206c3
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x10020687
test ecx, ecx
je 0x1002066b
mov esi, dword [esp + 0x24]
xor ebx, ebx
inc ebx
mov edx, dword [esp + 0x14]
jmp 0x10020519
test ebx, ebx
je 0x100206c3
mov eax, dword [esp + 0x5c]
lea esi, [esp + 0xa8]
push 5
pop ecx
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x40]
jmp 0x1002068b
mov eax, dword [esp + 0x5c]
test ebx, ebx
je 0x100206c3
mov edi, dword [esp + 0x10]
add eax, 0x14
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x14]
add eax, esi
push 0
pop ecx
adc edi, ecx
mov dword [esp + 0x14], eax
sub dword [esp + 0x54], esi
mov esi, dword [esp + 0x24]
sbb dword [esp + 0x60], ecx
inc ecx
mov dword [esp + 0x10], edi
mov dword [esp + 0x30], ecx
jmp 0x10020807
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [esp + 0x30]
mov esi, 0x570
cmp eax, esi
jne 0x10020754
test dword [esp + 0x64], 0x1000000
je 0x10020754
lea eax, [esp + 0x28]
mov edx, 0x241
push eax
mov ecx, edi
call fcn.10080950
test eax, eax
je 0x10020754
mov ebx, dword [esp + 0x1c]
mov esi, 0x241
push ecx
push esi
push dword [esp + 0x60]
inc edi
mov dword [esp + 0x30], esi
mov edx, 0x9481
mov dword [esp + 0x3c], edi
mov ecx, ebx
mov dword [esp + 0x24], esi
call fcn.1002894a
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, ebx
call fcn.100310a3
mov ecx, eax
call fcn.1001a693
or edx, 0xffffffff
mov ecx, ebx
call fcn.100310cb
mov edi, dword [esp + 0x10]
push edi
push dword [esp + 0x18]
call fcn.10021e9a
mov ebx, eax
jmp 0x1002084d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, esi
je 0x1002085a
test dword [esp + 0x64], 0x1000000
mov esi, dword [esp + 0x24]
je 0x100207ff
lea eax, [esp + 0x28]
mov edx, esi
push eax
mov ecx, edi
call fcn.10080950
test eax, eax
je 0x100207ff
push 5
pop ecx
test ebx, ebx
jne 0x100207f4
mov edi, dword [esp + 0x10]
mov eax, ecx
dec ecx
mov dword [esp + 0x40], ecx
test eax, eax
je 0x100207e8
mov ebx, dword [esp + 0x1c]
mov ecx, ebx
call fcn.100310a3
mov ecx, eax
call fcn.1001a693
or edx, 0xffffffff
mov ecx, ebx
call fcn.100310cb
push ecx
push esi
push dword [esp + 0x60]
mov edx, 0x9481
call fcn.1002894a
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_Sleep]
push edi
push dword [esp + 0x18]
mov ecx, ebx
call fcn.10021e9a
mov ecx, dword [esp + 0x40]
mov ebx, eax
test ebx, ebx
je 0x10020791
test ebx, ebx
je 0x10020b4e
mov edi, dword [esp + 0x30]
inc edi
mov dword [esp + 0x30], edi
mov edi, dword [esp + 0x10]
jmp 0x1002084d
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
test ebx, ebx
je 0x10020b4e
push dword [esp + 0x34]
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x70]
push dword [esp + 0x3c]
push edi
push eax
lea eax, [esp + 0x28]
push eax
push dword [esp + 0x5c]
lea eax, [esp + 0x44]
push dword [esp + 0x80]
push eax
call fcn.10020164
mov esi, dword [esp + 0x18]
mov ebx, eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], esi
test ebx, ebx
je 0x10020b4e
jmp 0x10020662
xor ebx, ebx
mov esi, 0x241
jmp 0x10020b6b
test ebx, ebx
je 0x10020b4e
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x1002099f
mov ecx, dword [esp + 0x50]
mov ecx, dword [ecx + 0x108]
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x50]
mov ecx, dword [ecx + 0x10c]
cmp edx, dword [esp + 0x28]
jne 0x100208a0
cmp edi, ecx
je 0x1002099f
mov ebx, dword [esp + 0x28]
sub ebx, edx
mov dword [esp + 0x28], ebx
sbb ecx, edi
xor eax, eax
lea edi, [esp + 0x8c]
mov dword [esp + 0x70], ecx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor eax, eax
mov edi, dword [esp + 0x10]
mov dword [esp + 0x98], edi
lea edi, [esp + 0x78]
stosd dword es:[edi], eax
mov dword [esp + 0x94], edx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov eax, dword [ebp + 0x18]
mov edi, dword [esp + 0x10]
mov dword [esp + 0x80], edx
mov dword [esp + 0x84], edi
test eax, eax
je 0x10020905
cmp dword [eax], 0
je 0x10020905
xor ebx, ebx
mov esi, 0x4d3
jmp 0x10020b6b
push ecx
push ebx
mov ecx, dword [esp + 0x24]
xor eax, eax
push eax
push eax
push eax
push eax
push eax
push 0xa00000
push dword [esp + 0x64]
lea eax, [esp + 0x9c]
push eax
push dword [esp + 0x48]
lea eax, [esp + 0xb8]
push eax
call fcn.100310a3
mov edx, eax
xor ecx, ecx
call fcn.10022a1e
mov ebx, eax
test ebx, ebx
je 0x10020b4e
push dword [esp + 0x34]
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x70]
add eax, dword [esp + 0x2c]
push dword [esp + 0x3c]
adc edi, dword [esp + 0x78]
mov edx, dword [esp + 0x24]
push edi
push eax
mov dword [esp + 0x24], eax
lea eax, [esp + 0x28]
push eax
push dword [esp + 0x5c]
lea eax, [esp + 0x44]
mov dword [esp + 0x28], edi
push dword [esp + 0x80]
push eax
call fcn.10020164
mov ecx, dword [esp + 0x2c]
mov ebx, eax
mov esi, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x20], ecx
jmp 0x100209a3
mov ecx, dword [esp + 0x20]
test ebx, ebx
je 0x10020b4e
test eax, eax
je 0x10020a3f
xor eax, eax
lea edi, [esp + 0x78]
stosd dword es:[edi], eax
push 1
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [esp + 0x7c]
mov edi, dword [esp + 0x14]
push eax
mov eax, dword [esp + 0x44]
mov dword [esp + 0x88], edx
mov edx, eax
mov dword [esp + 0x8c], edi
push dword [eax]
call fcn.10028fbd
mov ebx, eax
test ebx, ebx
je 0x10020b4e
push dword [esp + 0x34]
mov ecx, dword [esp + 0x40]
push dword [esp + 0x3c]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x24]
add eax, dword [ecx]
lea ecx, [esp + 0x74]
mov dword [esp + 0x1c], eax
adc edi, 0
push edi
push eax
lea eax, [esp + 0x28]
mov dword [esp + 0x20], edi
push eax
push dword [esp + 0x5c]
lea eax, [esp + 0x44]
push dword [esp + 0x80]
push eax
call fcn.10020164
mov edx, dword [esp + 0x2c]
mov ebx, eax
mov esi, dword [esp + 0x18]
mov dword [esp + 0x20], edx
jmp 0x10020a43
mov edx, dword [esp + 0x20]
test ebx, ebx
je 0x10020b4e
cmp dword [esp + 0x34], edi
jl 0x10020b4a
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x38]
jg 0x10020a67
cmp eax, ecx
jbe 0x10020b4a
mov ebx, eax
mov eax, dword [esp + 0x34]
sub ebx, ecx
mov dword [esp + 0x70], ebx
sbb eax, edi
lea edi, [esp + 0x8c]
mov dword [esp + 0x58], eax
xor eax, eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor eax, eax
mov edi, dword [esp + 0x10]
mov dword [esp + 0x98], edi
lea edi, [esp + 0x78]
stosd dword es:[edi], eax
mov dword [esp + 0x94], ecx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov eax, dword [ebp + 0x18]
mov edi, dword [esp + 0x10]
mov dword [esp + 0x80], ecx
mov dword [esp + 0x84], edi
test eax, eax
je 0x10020ac6
cmp dword [eax], 0
jne 0x100208f9
push dword [esp + 0x58]
mov ecx, dword [esp + 0x20]
lea eax, [esp + 0x7c]
push ebx
push 0
push 0
push 0
push 0
push 0
push 0xa00000
push dword [esp + 0x64]
push eax
push edx
lea eax, [esp + 0xb8]
push eax
call fcn.100310a3
mov edx, eax
xor ecx, ecx
call fcn.10022a1e
mov ebx, eax
test ebx, ebx
je 0x10020b4e
push dword [esp + 0x34]
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x70]
add eax, dword [esp + 0x74]
push dword [esp + 0x3c]
adc edi, dword [esp + 0x60]
mov edx, dword [esp + 0x24]
push edi
push eax
lea eax, [esp + 0x28]
push eax
push dword [esp + 0x5c]
lea eax, [esp + 0x44]
push dword [esp + 0x80]
push eax
call fcn.10020164
mov esi, dword [esp + 0x18]
mov ebx, eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x20], eax
test ebx, ebx
jne 0x10020b6b
test esi, esi
jne 0x10020b6b
jmp 0x10020b5c
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jne 0x10020b6b
push 0x1f
pop esi
mov eax, dword [esp + 0x44]
test eax, eax
je 0x10020b83
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x10020b9b
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x10020ba9
push eax
call sym.WIMGAPI.DLL_WIMCloseHandle
mov eax, dword [esp + 0x20]
cmp eax, 0xffffffff
je 0x10020bc7
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
jne 0x10020bc7
push dword [esp + 0x48]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, ebx
jmp 0x10020bdc
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
mov ecx, dword [esp + 0xbc]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.10083b20
mov esp, ebp
pop ebp
ret 0x18