Function at 0x401740
Capabilities:
Read file on windows
Set environment variable
Set file attributes

Disassembly:
sub esp, 0x28
push edi
lea edi, [esp + 0x18]
mov dword [esp + 0x20], 0xffffffff
call fcn.00401580
mov edi, dword [esp + 0x18]
push 0
push 0x8000020
push 3
push 0
push 1
push 0x80000000
push edi
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0xc], eax
cmp eax, 0xffffffff
jne 0x40179c
push 0x10
push 0
push 0x401190
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov eax, 1
pop edi
add esp, 0x28
ret 0x10
mov eax, dword [esp + 0x10]
cmp word [edi + eax*2], 0x5c
push ebx
push esi
lea esi, [edi + eax*2]
je 0x4017be
mov ebx, dword [sym.imp.USER32.dll_CharPrevW]
push esi
push edi
call ebx
mov esi, eax
cmp word [esi], 0x5c
jne 0x4017b2
mov ebx, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push ebp
push edi
xor ecx, ecx
push 0x4012a4
mov word [esi], cx
call ebx
add esi, 2
push esi
push 0x40128c
call ebx
push edi
call dword [sym.imp.msvcrt.dll_free]
mov edx, dword [esp + 0x1c]
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
add esp, 4
push 0
push 0
push 0x79
push edx
call edi
mov edx, dword [esp + 0x18]
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [esp + 0x20]
push eax
push 4
lea ecx, [esp + 0x20]
push ecx
push edx
call ebx
mov eax, dword [esp + 0x14]
mov ecx, eax
and eax, 0xffffff
shr ecx, 0x18
mov dword [esp + 0x14], eax
shl eax, 0xc
mov byte [esp + 0x13], cl
push eax
lea ecx, [esp + 0x16]
call fcn.004020f0
mov edx, dword [esp + 0x14]
add edx, 6
push edx
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
mov esi, eax
add esp, 4
mov eax, 0xfffffffa
sub eax, dword [esp + 0x14]
push 2
cdq
lea ecx, [esp + 0x38]
push ecx
mov dword [esp + 0x3c], edx
mov edx, dword [esp + 0x20]
push eax
push edx
mov dword [esp + 0x40], eax
call edi
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
push 0
mov dword [esp + 0x34], eax
lea eax, [esp + 0x20]
push eax
add ecx, 6
push ecx
push esi
push edx
call ebx
mov eax, dword [esp + 0x1c]
push eax
push esi
call fcn.00401ba0
mov ecx, dword [esp + 0x1c]
movzx ebp, byte [esi + ecx + 2]
movzx edx, byte [esi + ecx + 1]
movzx eax, byte [esi + ecx]
shl ebp, 8
add ebp, edx
shl ebp, 8
movzx edx, byte [esi + ecx + 4]
add ebp, eax
movzx eax, byte [esi + ecx + 5]
movzx ecx, byte [esi + ecx + 3]
shl eax, 8
add eax, edx
shl eax, 8
add eax, ecx
push eax
mov dword [esp + 0x2c], eax
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
lea edx, [esp + 0x20]
push edx
mov ebx, eax
push esi
lea eax, [esp + 0x34]
push eax
push ebx
call fcn.00401b70
push esi
mov dword [esp + 0x44], eax
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
mov ecx, dword [esp + 0x44]
add esp, 0x20
test ecx, ecx
jne 0x4019bf
push ecx
push ecx
mov ecx, dword [esp + 0x20]
push ebp
push ecx
call edi
mov eax, dword [esp + 0x20]
movzx edx, byte [ebx + eax - 1]
movzx ecx, byte [ebx + eax - 2]
shl edx, 8
add edx, ecx
movzx ecx, byte [ebx + eax - 3]
movzx eax, byte [ebx + eax - 4]
shl edx, 8
add edx, ecx
shl edx, 8
add edx, eax
add edx, edx
add edx, edx
push edx
lea ecx, [esp + 0x16]
call fcn.004020f0
push 0x401284
mov edi, 0x406334
call fcn.004015e0
mov ecx, dword [0x406334]
add esp, 4
push 2
push ecx
mov dword [0x406330], eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x30]
add edx, 0xfffffffc
push edx
mov edx, dword [esp + 0x38]
xor eax, eax
sub ecx, ebp
sbb edx, eax
sub ecx, 0xd
push ebx
sbb edx, eax
push edx
push ecx
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x40]
push ecx
call fcn.00401f40
mov edx, dword [esp + 0x30]
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0x18
push edx
mov esi, eax
call ebp
test esi, esi
je 0x4019ce
mov eax, dword [0x406334]
call fcn.00401380
mov eax, dword [0x406334]
push eax
call dword [sym.imp.msvcrt.dll_free]
add esp, 4
mov ecx, esi
call fcn.004014b0
pop ebp
pop esi
pop ebx
pop edi
add esp, 0x28
ret 0x10
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [0x406330]
lea eax, [eax + ecx + 2]
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
mov edi, eax
mov eax, dword [0x406334]
push ebx
push eax
push 0x401278
push edi
call dword [sym.imp.msvcrt.dll_swprintf]
push ebx
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
movzx esi, byte [esp + 0x2b]
mov edx, dword [0x406334]
mov eax, dword [esp + 0x5c]
mov ecx, esi
and ecx, 0xf
push ecx
push edx
push eax
push edi
call fcn.00401680
shr esi, 4
fld qword [0x401270]
add esp, 0x28
mov ebx, eax
mov eax, esi
test esi, esi
jns 0x401a43
neg eax
fld1
fld st(0)
test al, 1
je 0x401a4d
fmul st(2)
shr eax, 1
je 0x401a57
fld st(2)
fmulp st(3)
jmp 0x401a47
fstp st(2)
test esi, esi
jns 0x401a61
fdivrp st(1)
jmp 0x401a63
fstp st(0)
fnstcw word [esp + 0x44]
movzx eax, word [esp + 0x44]
or eax, 0xc00
mov dword [esp + 0x24], eax
fldcw word [esp + 0x24]
fistp qword [esp + 0x24]
mov ecx, dword [esp + 0x24]
shl ecx, 5
push ecx
push ebx
fldcw word [esp + 0x4c]
call dword [sym.imp.KERNEL32.dll_SetPriorityClass]
push edi
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
add esp, 4
push 0xffffffffffffffff
push ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push ebx
call ebp
mov eax, dword [0x406334]
call fcn.00401380
mov edx, dword [0x406334]
push edx
call dword [sym.imp.msvcrt.dll_free]
add esp, 4
pop ebp
pop esi
pop ebx
xor eax, eax
pop edi
add esp, 0x28
ret 0x10