Function at 0x409780
Capabilities:
Check if file exists
Copy file
Create directory
Delete directory
Delete file
Get common file path
Move file
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5dc
mov eax, dword [0x4eb018]
xor eax, ebp
mov dword [ebp - 4], eax
push edi
mov dword [ebp - 0x4d0], 0
mov dword [ebp - 0x5d0], 0
mov dword [ebp - 0x55c], 0
mov dword [ebp - 0x560], 0
mov dword [ebp - 0x4c4], 0x64
mov dword [0x4ebae0], 1
mov eax, dword [ebp + 8]
mov ecx, dword [eax*4 + 0x4ee7e0]
mov dword [ebp - 0x4c0], ecx
cmp dword [ebp - 0x4c0], 0
jne 0x4097f3
mov eax, 0x86180002
jmp 0x40a9a0
mov dword [ebp - 0x4d4], 0
jmp 0x40980e
mov edx, dword [ebp - 0x4d4]
add edx, 1
mov dword [ebp - 0x4d4], edx
mov eax, dword [ebp - 0x4c0]
mov ecx, dword [ebp - 0x4d4]
cmp ecx, dword [eax + 0x405c]
jae 0x40a99a
cmp dword [ebp + 0xc], 0
je 0x409838
call dword [ebp + 0xc]
test eax, eax
jne 0x409838
jmp 0x40a99a
mov edx, dword [ebp - 0x4d4]
shl edx, 5
mov eax, dword [ebp - 0x4c0]
add edx, dword [eax + 0x4050]
mov dword [ebp - 0x534], edx
mov ecx, dword [ebp - 0x4c0]
mov edx, dword [ecx + 0x70a4]
mov eax, dword [ebp - 0x4c0]
lea ecx, [eax + edx*2 + 0x60a4]
push ecx
mov edx, dword [ebp - 0x4d4]
push edx
mov eax, dword [ebp - 0x4c0]
add eax, 0x4040
push eax
call fcn.0040cd80
add esp, 0xc
mov dword [ebp - 0x5dc], eax
mov dword [ebp - 0x564], 0
mov dword [ebp - 0x4cc], 0
jmp 0x4098b3
mov ecx, dword [ebp - 0x4cc]
add ecx, 1
mov dword [ebp - 0x4cc], ecx
mov edx, dword [ebp - 0x4c0]
mov eax, dword [ebp - 0x4cc]
cmp eax, dword [edx + 0x7ad0]
jae 0x409911
mov ecx, dword [ebp - 0x4c0]
mov edx, dword [ecx + 0x70a4]
mov eax, dword [ebp - 0x4c0]
lea ecx, [eax + edx*2 + 0x60a4]
push ecx
imul edx, dword [ebp - 0x4cc], 0x208
mov eax, dword [ebp - 0x4c0]
lea ecx, [eax + edx + 0x70a8]
push ecx
call dword [sym.imp.SHLWAPI.dll_StrCmpIW]
test eax, eax
jne 0x40990f
mov dword [ebp - 0x564], 1
jmp 0x409911
jmp 0x4098a4
cmp dword [ebp - 0x564], 0
je 0x40991f
jmp 0x4097ff
mov edx, dword [ebp - 0x4c0]
mov eax, dword [edx + 0x70a4]
mov ecx, dword [ebp - 0x4c0]
lea edx, [ecx + eax*2 + 0x60a4]
push edx
lea ecx, [ebp - 0x42c]
call fcn.00402468
mov eax, dword [ebp - 0x4c0]
add eax, 0x7ad4
mov dword [ebp - 0x4f8], eax
mov ecx, dword [ebp - 0x4f8]
add ecx, 2
mov dword [ebp - 0x584], ecx
mov edx, dword [ebp - 0x4f8]
mov ax, word [edx]
mov word [ebp - 0x540], ax
add dword [ebp - 0x4f8], 2
cmp word [ebp - 0x540], 0
jne 0x409964
mov ecx, dword [ebp - 0x4f8]
sub ecx, dword [ebp - 0x584]
sar ecx, 1
mov dword [ebp - 0x5b0], ecx
je 0x4099c9
push 0
mov edx, dword [ebp - 0x4c0]
add edx, 0x7ad4
push edx
lea ecx, [ebp - 0x42c]
call fcn.00407919
test eax, eax
jne 0x4099c9
lea ecx, [ebp - 0x42c]
call fcn.0040240e
jmp 0x4097ff
mov eax, dword [ebp - 0x4c0]
mov ecx, dword [eax + 0x70a4]
mov dword [ebp - 0x4cc], ecx
jmp 0x4099ec
mov edx, dword [ebp - 0x4cc]
add edx, 1
mov dword [ebp - 0x4cc], edx
mov eax, dword [ebp - 0x4cc]
mov ecx, dword [ebp - 0x4c0]
movzx edx, word [ecx + eax*2 + 0x60a4]
test edx, edx
je 0x409d5d
mov eax, dword [ebp - 0x4cc]
mov ecx, dword [ebp - 0x4c0]
movzx edx, word [ecx + eax*2 + 0x60a4]
cmp edx, 0x2f
jne 0x409d58
xor eax, eax
mov ecx, dword [ebp - 0x4cc]
mov edx, dword [ebp - 0x4c0]
mov word [edx + ecx*2 + 0x60a4], ax
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
push eax
call fcn.0040e490
add esp, 4
test eax, eax
je 0x409d3f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x4fc], eax
cmp dword [ebp - 0x4fc], 0xb7
je 0x409d3f
cmp dword [ebp - 0x4fc], 0x50
je 0x409d3f
cmp dword [ebp - 0x4c4], 0x4e20
jge 0x409ae7
mov ecx, dword [ebp - 0x4c4]
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
push edx
call fcn.0040e490
add esp, 4
test eax, eax
jne 0x409ab4
jmp 0x409ae7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x4fc], eax
cmp dword [ebp - 0x4fc], 0xb7
je 0x409ad5
cmp dword [ebp - 0x4fc], 0x50
jne 0x409ad7
jmp 0x409ae7
mov eax, dword [ebp - 0x4c4]
shl eax, 1
mov dword [ebp - 0x4c4], eax
jmp 0x409a80
cmp dword [ebp - 0x4c4], 0x4e20
jl 0x409d35
push 0
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
test eax, eax
je 0x409d35
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x5d4], eax
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
push edx
lea ecx, [ebp - 0x444]
call fcn.00402468
push 0x4dcba8
lea ecx, [ebp - 0x444]
call fcn.004023d3
mov dword [ebp - 0x548], 1
push 0
lea ecx, [ebp - 0x444]
call fcn.004023a1
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
test eax, eax
jne 0x409bb0
push 9
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
push eax
lea ecx, [ebp - 0x444]
call fcn.004023a1
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x409b9e
mov dword [ebp - 0x548], 0
jmp 0x409bb0
lea ecx, [ebp - 0x444]
call fcn.004023a1
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
cmp dword [ebp - 0x548], 0
je 0x409d2a
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
mov dword [ebp - 0x500], ecx
mov edx, dword [ebp - 0x500]
add edx, 2
mov dword [ebp - 0x5b4], edx
mov eax, dword [ebp - 0x500]
mov cx, word [eax]
mov word [ebp - 0x522], cx
add dword [ebp - 0x500], 2
cmp word [ebp - 0x522], 0
jne 0x409bde
mov edx, dword [ebp - 0x500]
sub edx, dword [ebp - 0x5b4]
sar edx, 1
mov dword [ebp - 0x5b8], edx
mov eax, dword [ebp - 0x5b8]
shl eax, 1
push eax
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
push ecx
mov edx, dword [ebp + 0x10]
push edx
call fcn.0049cf70
add esp, 0xc
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
mov dword [ebp - 0x504], eax
mov ecx, dword [ebp - 0x504]
add ecx, 2
mov dword [ebp - 0x5bc], ecx
mov edx, dword [ebp - 0x504]
mov ax, word [edx]
mov word [ebp - 0x524], ax
add dword [ebp - 0x504], 2
cmp word [ebp - 0x524], 0
jne 0x409c55
mov ecx, dword [ebp - 0x504]
sub ecx, dword [ebp - 0x5bc]
sar ecx, 1
mov dword [ebp - 0x5c0], ecx
xor edx, edx
mov eax, dword [ebp - 0x5c0]
mov ecx, dword [ebp + 0x10]
mov word [ecx + eax*2], dx
mov edx, dword [ebp + 0x10]
add edx, 0xfffffffe
mov dword [ebp - 0x510], edx
mov eax, dword [ebp - 0x510]
mov cx, word [eax + 2]
mov word [ebp - 0x526], cx
add dword [ebp - 0x510], 2
cmp word [ebp - 0x526], 0
jne 0x409ca5
mov edi, dword [ebp - 0x510]
mov edx, dword [0x4dcbb4]
mov dword [edi], edx
mov eax, dword [0x4dcbb8]
mov dword [edi + 4], eax
mov cx, word [0x4dcbbc]
mov word [edi + 8], cx
mov dword [ebp - 0x4d0], 0x86180003
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp + 0x14]
mov dword [edx], eax
mov eax, dword [ebp - 0x4d0]
mov dword [ebp - 0x5c4], eax
lea ecx, [ebp - 0x444]
call fcn.0040240e
lea ecx, [ebp - 0x42c]
call fcn.0040240e
mov eax, dword [ebp - 0x5c4]
jmp 0x40a9a0
lea ecx, [ebp - 0x444]
call fcn.0040240e
mov dword [ebp - 0x4c4], 0x64
mov ecx, 0x5c
mov edx, dword [ebp - 0x4cc]
mov eax, dword [ebp - 0x4c0]
mov word [eax + edx*2 + 0x60a4], cx
jmp 0x4099dd
mov ecx, dword [ebp - 0x534]
movzx edx, byte [ecx + 0x19]
test edx, edx
je 0x40a070
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
push eax
call fcn.0040e490
add esp, 4
test eax, eax
je 0x40a06b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x508], eax
cmp dword [ebp - 0x508], 0xb7
je 0x40a06b
cmp dword [ebp - 0x508], 0x50
je 0x40a06b
cmp dword [ebp - 0x4c4], 0x4e20
jge 0x409e1b
mov ecx, dword [ebp - 0x4c4]
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
push edx
call fcn.0040e490
add esp, 4
test eax, eax
jne 0x409de8
jmp 0x409e1b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x508], eax
cmp dword [ebp - 0x508], 0xb7
je 0x409e09
cmp dword [ebp - 0x508], 0x50
jne 0x409e0b
jmp 0x409e1b
mov eax, dword [ebp - 0x4c4]
shl eax, 1
mov dword [ebp - 0x4c4], eax
jmp 0x409db4
cmp dword [ebp - 0x4c4], 0x4e20
jl 0x40a06b
push 0
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
test eax, eax
je 0x40a06b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x5d8], eax
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
push edx
lea ecx, [ebp - 0x474]
call fcn.00402468
push 0x4dcbc0
lea ecx, [ebp - 0x474]
call fcn.004023d3
mov dword [ebp - 0x54c], 1
push 0
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
test eax, eax
jne 0x409ee5
push 9
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
push ecx
lea ecx, [ebp - 0x474]
call fcn.004023a1
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x409ed3
mov dword [ebp - 0x54c], 0
jmp 0x409ee5
lea ecx, [ebp - 0x474]
call fcn.004023a1
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
cmp dword [ebp - 0x54c], 0
je 0x40a060
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
mov dword [ebp - 0x50c], edx
mov eax, dword [ebp - 0x50c]
add eax, 2
mov dword [ebp - 0x5c8], eax
mov ecx, dword [ebp - 0x50c]
mov dx, word [ecx]
mov word [ebp - 0x528], dx
add dword [ebp - 0x50c], 2
cmp word [ebp - 0x528], 0
jne 0x409f13
mov eax, dword [ebp - 0x50c]
sub eax, dword [ebp - 0x5c8]
sar eax, 1
mov dword [ebp - 0x5cc], eax
mov ecx, dword [ebp - 0x5cc]
shl ecx, 1
push ecx
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
push edx
mov eax, dword [ebp + 0x10]
push eax
call fcn.0049cf70
add esp, 0xc
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
mov dword [ebp - 0x4dc], ecx
mov edx, dword [ebp - 0x4dc]
add edx, 2
mov dword [ebp - 0x568], edx
mov eax, dword [ebp - 0x4dc]
mov cx, word [eax]
mov word [ebp - 0x52a], cx
add dword [ebp - 0x4dc], 2
cmp word [ebp - 0x52a], 0
jne 0x409f8b
mov edx, dword [ebp - 0x4dc]
sub edx, dword [ebp - 0x568]
sar edx, 1
mov dword [ebp - 0x56c], edx
xor eax, eax
mov ecx, dword [ebp - 0x56c]
mov edx, dword [ebp + 0x10]
mov word [edx + ecx*2], ax
mov eax, dword [ebp + 0x10]
add eax, 0xfffffffe
mov dword [ebp - 0x514], eax
mov ecx, dword [ebp - 0x514]
mov dx, word [ecx + 2]
mov word [ebp - 0x53a], dx
add dword [ebp - 0x514], 2
cmp word [ebp - 0x53a], 0
jne 0x409fdb
mov edi, dword [ebp - 0x514]
mov eax, dword [str._Dir]
mov dword [edi], eax
mov ecx, dword [0x4dcbd0]
mov dword [edi + 4], ecx
mov dx, word [0x4dcbd4]
mov word [edi + 8], dx
mov dword [ebp - 0x4d0], 0x86180003
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 0x14]
mov dword [ecx], eax
mov edx, dword [ebp - 0x4d0]
mov dword [ebp - 0x570], edx
lea ecx, [ebp - 0x474]
call fcn.0040240e
lea ecx, [ebp - 0x42c]
call fcn.0040240e
mov eax, dword [ebp - 0x570]
jmp 0x40a9a0
lea ecx, [ebp - 0x474]
call fcn.0040240e
jmp 0x40a98a
mov dword [ebp - 0x4c4], 0x64
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
push eax
lea ecx, [ebp - 0x4c8]
push ecx
call fcn.0040e4c0
add esp, 8
test eax, eax
je 0x40a581
cmp dword [ebp - 0x4c4], 0x4e20
jge 0x40a0e7
mov edx, dword [ebp - 0x4c4]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
push eax
lea ecx, [ebp - 0x4c8]
push ecx
call fcn.0040e4c0
add esp, 8
test eax, eax
jne 0x40a0d7
jmp 0x40a0e7
mov edx, dword [ebp - 0x4c4]
shl edx, 1
mov dword [ebp - 0x4c4], edx
jmp 0x40a09d
cmp dword [ebp - 0x4c4], 0x4e20
jl 0x40a577
mov dword [ebp - 0x554], 0
mov dword [ebp - 0x4d8], 0
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40a1d0
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
push ecx
lea ecx, [ebp - 0x48c]
call fcn.00402468
push str._rename
lea edx, [ebp - 0x48c]
lea ecx, [ebp - 0x4bc]
call fcn.00404486
add esp, 4
push eax
lea ecx, [ebp - 0x48c]
call fcn.00402413
lea ecx, [ebp - 0x4bc]
call fcn.0040240e
push 9
lea ecx, [ebp - 0x48c]
call fcn.004023a1
push eax
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
jne 0x40a19c
mov dword [ebp - 0x554], 1
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
push eax
lea ecx, [ebp - 0x4c8]
push ecx
call fcn.0040e4c0
add esp, 8
test eax, eax
jne 0x40a1c5
mov dword [ebp - 0x4d8], 1
lea ecx, [ebp - 0x48c]
call fcn.0040240e
cmp dword [ebp - 0x4d8], 0
jne 0x40a2be
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
push edx
lea ecx, [ebp - 0x45c]
call fcn.00402468
push str._temp
lea edx, [ebp - 0x45c]
lea ecx, [ebp - 0x4a4]
call fcn.00404486
add esp, 4
push eax
lea ecx, [ebp - 0x45c]
call fcn.00402413
lea ecx, [ebp - 0x4a4]
call fcn.0040240e
lea ecx, [ebp - 0x45c]
call fcn.004023a1
push eax
lea eax, [ebp - 0x4c8]
push eax
call fcn.0040e4c0
add esp, 8
test eax, eax
jne 0x40a2b3
mov ecx, dword [ebp - 0x4c8]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xb
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
push edx
lea ecx, [ebp - 0x45c]
call fcn.004023a1
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x40a2b3
push 0
push 0x80
push 3
push 0
push 1
push 0x40000000
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x4c8], eax
cmp dword [ebp - 0x4c8], 0xffffffff
je 0x40a2b3
mov dword [ebp - 0x4d8], 1
lea ecx, [ebp - 0x45c]
call fcn.0040240e
mov dword [ebp - 0x558], 0
cmp dword [ebp - 0x4d8], 0
jne 0x40a3f5
push 0x208
push 0
lea ecx, [ebp - 0x414]
push ecx
call fcn.0049d5c0
add esp, 0xc
push 0x208
push 0
lea edx, [ebp - 0x20c]
push edx
call fcn.0049d5c0
add esp, 0xc
lea eax, [ebp - 0x414]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push str.thunderErrorFile
lea ecx, [ebp - 0x414]
push ecx
lea edx, [ebp - 0x20c]
push edx
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x550], eax
cmp dword [ebp - 0x550], 0xffffffff
je 0x40a3f5
mov ecx, dword [ebp - 0x550]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
push edx
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x40a3d7
push 0
push 0x80
push 3
push 0
push 1
push 0x40000000
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x4c8], eax
cmp dword [ebp - 0x4c8], 0xffffffff
je 0x40a3cb
mov dword [ebp - 0x4d8], 1
jmp 0x40a3d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x558], eax
lea edx, [ebp - 0x20c]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40a3f5
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [ebp - 0x4d8], 0
jne 0x40a577
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
mov dword [ebp - 0x4e0], ecx
mov edx, dword [ebp - 0x4e0]
add edx, 2
mov dword [ebp - 0x574], edx
mov eax, dword [ebp - 0x4e0]
mov cx, word [eax]
mov word [ebp - 0x52c], cx
add dword [ebp - 0x4e0], 2
cmp word [ebp - 0x52c], 0
jne 0x40a423
mov edx, dword [ebp - 0x4e0]
sub edx, dword [ebp - 0x574]
sar edx, 1
mov dword [ebp - 0x578], edx
mov eax, dword [ebp - 0x578]
shl eax, 1
push eax
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
push ecx
mov edx, dword [ebp + 0x10]
push edx
call fcn.0049cf70
add esp, 0xc
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
mov dword [ebp - 0x4e4], eax
mov ecx, dword [ebp - 0x4e4]
add ecx, 2
mov dword [ebp - 0x57c], ecx
mov edx, dword [ebp - 0x4e4]
mov ax, word [edx]
mov word [ebp - 0x52e], ax
add dword [ebp - 0x4e4], 2
cmp word [ebp - 0x52e], 0
jne 0x40a49a
mov ecx, dword [ebp - 0x4e4]
sub ecx, dword [ebp - 0x57c]
sar ecx, 1
mov dword [ebp - 0x580], ecx
xor edx, edx
mov eax, dword [ebp - 0x580]
mov ecx, dword [ebp + 0x10]
mov word [ecx + eax*2], dx
mov edx, dword [ebp + 0x10]
add edx, 0xfffffffe
mov dword [ebp - 0x520], edx
mov eax, dword [ebp - 0x520]
mov cx, word [eax + 2]
mov word [ebp - 0x544], cx
add dword [ebp - 0x520], 2
cmp word [ebp - 0x544], 0
jne 0x40a4ea
mov edi, dword [ebp - 0x520]
mov edx, dword [str._Open]
mov dword [edi], edx
mov eax, dword [0x4dcc1c]
mov dword [edi + 4], eax
mov ecx, dword [0x4dcc20]
mov dword [edi + 8], ecx
cmp dword [ebp - 0x554], 0
je 0x40a540
mov dword [ebp - 0x4d0], 0x86180006
jmp 0x40a54a
mov dword [ebp - 0x4d0], 0x86180003
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp - 0x558]
mov dword [edx], eax
mov ecx, dword [ebp - 0x4d0]
mov dword [ebp - 0x5ac], ecx
lea ecx, [ebp - 0x42c]
call fcn.0040240e
mov eax, dword [ebp - 0x5ac]
jmp 0x40a9a0
mov dword [ebp - 0x4c4], 0x64
mov edx, dword [ebp - 0x560]
mov dword [ebp - 0x55c], edx
mov eax, dword [ebp - 0x4d4]
mov ecx, dword [ebp - 0x4c0]
lea edx, [ecx + eax*4 + 0x50a4]
push edx
mov eax, dword [ebp - 0x4d4]
mov ecx, dword [ebp - 0x4c0]
mov edx, dword [ecx + eax*4 + 0x40a4]
push edx
lea eax, [ebp - 0x4c8]
push eax
call fcn.0040e290
add esp, 0xc
test eax, eax
jne 0x40a5da
mov ecx, dword [ebp - 0x55c]
cmp ecx, dword [ebp - 0x560]
je 0x40a7bb
cmp dword [ebp - 0x4c4], 0x4e20
jge 0x40a640
mov edx, dword [ebp - 0x4c4]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x4d4]
mov ecx, dword [ebp - 0x4c0]
lea edx, [ecx + eax*4 + 0x50a4]
push edx
mov eax, dword [ebp - 0x4d4]
mov ecx, dword [ebp - 0x4c0]
mov edx, dword [ecx + eax*4 + 0x40a4]
push edx
lea eax, [ebp - 0x4c8]
push eax
call fcn.0040e290
add esp, 0xc
test eax, eax
jne 0x40a630
jmp 0x40a640
mov ecx, dword [ebp - 0x4c4]
shl ecx, 1
mov dword [ebp - 0x4c4], ecx
jmp 0x40a5da
cmp dword [ebp - 0x4c4], 0x4e20
jl 0x40a7bb
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
mov dword [ebp - 0x4e8], edx
mov eax, dword [ebp - 0x4e8]
add eax, 2
mov dword [ebp - 0x588], eax
mov ecx, dword [ebp - 0x4e8]
mov dx, word [ecx]
mov word [ebp - 0x542], dx
add dword [ebp - 0x4e8], 2
cmp word [ebp - 0x542], 0
jne 0x40a671
mov eax, dword [ebp - 0x4e8]
sub eax, dword [ebp - 0x588]
sar eax, 1
mov dword [ebp - 0x58c], eax
mov ecx, dword [ebp - 0x58c]
shl ecx, 1
push ecx
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
push edx
mov eax, dword [ebp + 0x10]
push eax
call fcn.0049cf70
add esp, 0xc
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
mov dword [ebp - 0x4ec], ecx
mov edx, dword [ebp - 0x4ec]
add edx, 2
mov dword [ebp - 0x590], edx
mov eax, dword [ebp - 0x4ec]
mov cx, word [eax]
mov word [ebp - 0x530], cx
add dword [ebp - 0x4ec], 2
cmp word [ebp - 0x530], 0
jne 0x40a6e9
mov edx, dword [ebp - 0x4ec]
sub edx, dword [ebp - 0x590]
sar edx, 1
mov dword [ebp - 0x594], edx
xor eax, eax
mov ecx, dword [ebp - 0x594]
mov edx, dword [ebp + 0x10]
mov word [edx + ecx*2], ax
mov eax, dword [ebp + 0x10]
add eax, 0xfffffffe
mov dword [ebp - 0x518], eax
mov ecx, dword [ebp - 0x518]
mov dx, word [ecx + 2]
mov word [ebp - 0x53e], dx
add dword [ebp - 0x518], 2
cmp word [ebp - 0x53e], 0
jne 0x40a739
mov edi, dword [ebp - 0x518]
mov eax, dword [str._Write]
mov dword [edi], eax
mov ecx, dword [0x4dcc28]
mov dword [edi + 4], ecx
mov edx, dword [0x4dcc2c]
mov dword [edi + 8], edx
mov ax, word [0x4dcc30]
mov word [edi + 0xc], ax
mov dword [ebp - 0x4d0], 0x86180003
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 0x14]
mov dword [ecx], eax
mov edx, dword [ebp - 0x4d0]
mov dword [ebp - 0x598], edx
lea ecx, [ebp - 0x42c]
call fcn.0040240e
mov eax, dword [ebp - 0x598]
jmp 0x40a9a0
lea eax, [ebp - 0x4c8]
push eax
call fcn.0040e1b0
add esp, 4
test eax, eax
je 0x40a960
cmp dword [0x4ebae0], 0
je 0x40a7f0
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [0x4ebae0], 0
lea ecx, [ebp - 0x4c8]
push ecx
call fcn.0040e1b0
add esp, 4
test eax, eax
je 0x40a960
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
mov dword [ebp - 0x4f0], edx
mov eax, dword [ebp - 0x4f0]
add eax, 2
mov dword [ebp - 0x59c], eax
mov ecx, dword [ebp - 0x4f0]
mov dx, word [ecx]
mov word [ebp - 0x53c], dx
add dword [ebp - 0x4f0], 2
cmp word [ebp - 0x53c], 0
jne 0x40a828
mov eax, dword [ebp - 0x4f0]
sub eax, dword [ebp - 0x59c]
sar eax, 1
mov dword [ebp - 0x5a0], eax
mov ecx, dword [ebp - 0x5a0]
shl ecx, 1
push ecx
mov edx, dword [ebp - 0x4c0]
add edx, 0x60a4
push edx
mov eax, dword [ebp + 0x10]
push eax
call fcn.0049cf70
add esp, 0xc
mov ecx, dword [ebp - 0x4c0]
add ecx, 0x60a4
mov dword [ebp - 0x4f4], ecx
mov edx, dword [ebp - 0x4f4]
add edx, 2
mov dword [ebp - 0x5a4], edx
mov eax, dword [ebp - 0x4f4]
mov cx, word [eax]
mov word [ebp - 0x538], cx
add dword [ebp - 0x4f4], 2
cmp word [ebp - 0x538], 0
jne 0x40a8a0
mov edx, dword [ebp - 0x4f4]
sub edx, dword [ebp - 0x5a4]
sar edx, 1
mov dword [ebp - 0x5a8], edx
xor eax, eax
mov ecx, dword [ebp - 0x5a8]
mov edx, dword [ebp + 0x10]
mov word [edx + ecx*2], ax
mov eax, dword [ebp + 0x10]
add eax, 0xfffffffe
mov dword [ebp - 0x51c], eax
mov ecx, dword [ebp - 0x51c]
mov dx, word [ecx + 2]
mov word [ebp - 0x536], dx
add dword [ebp - 0x51c], 2
cmp word [ebp - 0x536], 0
jne 0x40a8f0
mov edi, dword [ebp - 0x51c]
mov eax, dword [str._Close]
mov dword [edi], eax
mov ecx, dword [0x4dcc38]
mov dword [edi + 4], ecx
mov edx, dword [0x4dcc3c]
mov dword [edi + 8], edx
mov ax, word [0x4dcc40]
mov word [edi + 0xc], ax
mov dword [ebp - 0x4d0], 0x86180003
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 0x14]
mov dword [ecx], eax
lea ecx, [ebp - 0x42c]
call fcn.0040240e
jmp 0x4097ff
mov edx, dword [ebp - 0x534]
movzx eax, byte [edx + 0x1d]
test eax, eax
je 0x40a98a
mov ecx, dword [ebp - 0x534]
mov edx, dword [ecx + 0x14]
push edx
mov eax, dword [ebp - 0x4c0]
add eax, 0x60a4
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea ecx, [ebp - 0x42c]
call fcn.0040240e
jmp 0x4097ff
mov eax, dword [ebp - 0x4d0]
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004250ca
mov esp, ebp
pop ebp
ret