Function at 0x401610
Capabilities:
Acquire debug privileges
Check if file exists
Get file attributes

Disassembly:
sub esp, 0x29c
mov eax, dword [0x42b0a0]
xor eax, esp
mov dword [esp + 0x294], eax
push ebx
push ebp
push esi
push edi
mov ecx, 0x42c450
xor ebx, ebx
xor ebp, ebp
call fcn.00402f50
test eax, eax
je 0x40182c
mov eax, dword [0x42ce5c]
cmp eax, 6
je 0x4016a0
cmp eax, 7
je 0x4016a0
mov edx, eax
mov dword [0x42c440], edx
xor eax, eax
jmp 0x401660
movzx ecx, word [eax + 0x42ce64]
mov word [eax + 0x44e0f8], cx
add eax, 2
cmp cx, bx
jne 0x401660
xor eax, eax
jmp 0x401680
movzx ecx, word [eax + 0x42cee8]
mov word [eax + 0x44e178], cx
add eax, 2
cmp cx, bx
jne 0x401680
mov ebp, 1
jmp 0x40183b
mov eax, dword [0x426acc]
mov ecx, dword [0x426ad0]
mov edx, dword [0x426ad4]
mov dword [esp + 0x20], eax
movzx eax, word [0x426ad8]
push 0x72
mov dword [esp + 0x28], ecx
lea ecx, [esp + 0x32]
push ebx
push ecx
mov dword [esp + 0x34], edx
mov word [esp + 0x38], ax
call fcn.00411850
mov edx, dword [0x426adc]
mov eax, dword [0x426ae0]
mov ecx, dword [0x426ae4]
add esp, 0xc
push 0x72
mov dword [esp + 0xa8], eax
mov dword [esp + 0xa4], edx
mov dx, word [0x426ae8]
lea eax, [esp + 0xb2]
push ebx
push eax
mov dword [esp + 0xb4], ecx
mov word [esp + 0xb8], dx
call fcn.00411850
mov ecx, dword [0x426aec]
mov edx, dword [0x426af0]
mov eax, dword [0x426af4]
add esp, 0xc
push 0x72
mov dword [esp + 0x128], edx
mov dword [esp + 0x124], ecx
mov cx, word [0x426af8]
lea edx, [esp + 0x132]
push ebx
push edx
mov dword [esp + 0x134], eax
mov word [esp + 0x138], cx
call fcn.00411850
mov ecx, dword [0x426b00]
mov eax, dword [0x426afc]
mov edx, dword [0x426b04]
add esp, 0xc
push 0x70
mov dword [esp + 0x1a8], ecx
mov dword [esp + 0x1a4], eax
mov eax, dword [0x426b08]
lea ecx, [esp + 0x1b4]
push ebx
push ecx
mov dword [esp + 0x1b4], edx
mov dword [esp + 0x1b8], eax
call fcn.00411850
mov eax, dword [0x426b10]
mov ecx, dword [0x426b14]
mov edx, dword [0x426b0c]
add esp, 0xc
mov dword [esp + 0x224], eax
movzx eax, word [0x426b1c]
push 0x6e
mov dword [esp + 0x22c], ecx
mov dword [esp + 0x224], edx
mov edx, dword [0x426b18]
lea ecx, [esp + 0x236]
push ebx
push ecx
mov dword [esp + 0x238], edx
mov word [esp + 0x23c], ax
call fcn.00411850
add esp, 0xc
xor esi, esi
lea edi, [esp + 0x20]
lea esp, [esp]
push edi
mov ecx, 0x42c450
call fcn.00403080
test eax, eax
jne 0x4019b0
inc esi
sub edi, 0xffffff80
cmp esi, 5
jl 0x401810
or edx, 0xffffffff
mov dword [0x42c440], edx
mov dword [0x44e288], ebx
cmp dword [0x44e0f0], 3
jne 0x401a0c
cmp edx, 5
ja 0x401a06
cmp dword [0x44e288], ebx
jne 0x401a0c
push 0x206
lea ecx, [esp + 0x26]
xor eax, eax
push ebx
push ecx
mov dword [esp + 0x24], ebx
xor edi, edi
mov word [esp + 0x2c], ax
call fcn.00411850
add esp, 0xc
lea esi, [esp + 0x20]
call fcn.00402ae0
mov eax, esi
add eax, 0xfffffffe
jmp 0x401890
mov cx, word [eax + 2]
add eax, 2
cmp cx, bx
jne 0x401890
mov edx, dword [str.HGDraw.dll]
mov ecx, dword [0x426b24]
mov dword [eax], edx
mov edx, dword [0x426b28]
mov dword [eax + 4], ecx
mov ecx, dword [0x426b2c]
mov dword [eax + 8], edx
mov edx, dword [0x426b30]
mov dword [eax + 0xc], ecx
mov ecx, dword [0x426b34]
mov dword [eax + 0x10], edx
lea edx, [esp + 0x20]
push edx
mov dword [eax + 0x14], ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x40191c
lea eax, [esp + 0x18]
push eax
call fcn.00402b40
mov edi, eax
add esp, 4
cmp edi, ebx
je 0x401a0c
mov eax, dword [esp + 0x18]
cmp eax, 0xa
jl 0x401a0c
lea ecx, [esp + 0x20]
push ecx
mov ecx, edi
call fcn.00404730
add esp, 4
test eax, eax
jne 0x401a0c
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea edx, [esp + 0x24]
push edx
call fcn.00401000
test eax, eax
je 0x401a0c
cmp edi, ebx
je 0x401942
push edi
call fcn.0040fb79
add esp, 4
lea eax, [esp + 0x14]
push eax
push 0x28
mov dword [esp + 0x1c], ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x401980
mov edi, dword [esp + 0x14]
lea ecx, [esp + 0x18]
push ecx
push str.SeDebugPrivilege
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x401980
lea esi, [esp + 0x18]
call fcn.00403450
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x40198f
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x42ce60]
lea eax, [esp + 0x20]
call fcn.004032f0
test eax, eax
jne 0x401a0c
mov edx, dword [0x42ce60]
mov dword [0x44e288], edx
jmp 0x401a0c
mov edx, esi
shl edx, 7
lea eax, [esp + edx + 0x20]
mov edx, 0x44e178
sub edx, eax
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
cmp cx, bx
jne 0x4019c0
mov edx, 6
mov dword [0x42c440], edx
xor eax, eax
lea esp, [esp]
movzx ecx, word [eax + 0x42ce64]
mov word [eax + 0x44e0f8], cx
add eax, 2
cmp cx, bx
jne 0x4019e0
mov dword [0x42c444], esi
mov ebp, 1
jmp 0x40183b
mov dword [0x44e288], ebx
mov ecx, dword [esp + 0x2a4]
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
xor ecx, esp
call fcn.0040fb84
add esp, 0x29c
ret