Function at 0x4057b8
Capabilities:
Set current directory
Set environment variable

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff0
push ebx
push esi
xor eax, eax
mov dword [ebp - 0x10], eax
mov eax, 0x405780
call fcn.00401c00
xor eax, eax
push ebp
push 0x4060c0
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [0x4073b0]
cmp byte [eax], 0
je 0x4057f5
xor eax, eax
mov dword [0x407370], eax
xor eax, eax
mov dword [0x407358], eax
push 0
call sub.user32.dll_GetDC
mov ebx, eax
push 0x5a
push ebx
call sub.gdi32.dll_GetDeviceCaps
mov dword [0x43852c], eax
cmp dword [0x43852c], 0
jne 0x40581e
mov dword [0x43852c], 0x60
push ebx
push 0
call sub.user32.dll_ReleaseDC
push 0x4060d0
mov eax, dword [0x4073a8]
mov eax, dword [eax]
push eax
call sub.user32.dll_LoadIconA
mov dword [0x438530], eax
cmp dword [0x438530], 0
setne byte [0x438544]
mov eax, 0x4060dc
mov cl, byte [0x4060e4]
mov edx, 0xe
call fcn.00404864
mov dword [0x438534], eax
mov eax, 0x4060e8
mov cl, byte [0x4060e4]
mov edx, 8
call fcn.00404864
mov dword [0x43853c], eax
mov eax, 0x4060e8
mov cl, byte [0x4060f8]
mov edx, 0xa
call fcn.00404864
mov dword [0x438538], eax
cmp dword [0x438530], 0
jne 0x4058b3
push 0x7f00
push 0
call sub.user32.dll_LoadIconA
mov dword [0x438530], eax
mov bl, 7
mov esi, 0x4070f4
mov eax, esi
call fcn.004022b4
add esi, 4
dec bl
jne 0x4058ba
call fcn.00402768
lea edx, [ebp - 0x10]
mov eax, dword [0x408078]
call fcn.00402d84
mov edx, dword [ebp - 0x10]
mov eax, 0x40807c
call fcn.004014e0
mov eax, dword [0x40807c]
push eax
call sub.KERNEL32.DLL_SetCurrentDirectoryA
call fcn.00404208
mov ecx, 0x438590
mov edx, 0x4060fc
mov eax, dword [0x408080]
call fcn.0040289c
cmp dword [0x438590], 0
je 0x405945
mov eax, dword [0x438590]
call fcn.00402eec
mov ecx, 0x438598
mov eax, 0x4180c0
mov edx, 0x10000
call fcn.00402b88
mov eax, dword [0x438598]
mov byte [eax + 0x4180c0], 0
mov byte [0x438529], 1
mov ecx, 0x43858c
mov edx, 0x406100
mov eax, dword [0x408080]
call fcn.0040289c
cmp dword [0x43858c], 0
jne 0x405972
mov eax, 0x43858c
mov edx, dword [0x408078]
call fcn.004014e0
mov eax, dword [0x43858c]
call fcn.00402eec
call fcn.00402c3c
call fcn.00403490
call fcn.00403948
mov edx, 0x438580
mov eax, 0x438568
call fcn.004040c4
mov edx, 0x438568
mov eax, 0x438504
call fcn.00403d74
cmp dword [0x438590], 0
jne 0x4059c2
mov edx, dword [0x438518]
mov eax, 0x438504
call fcn.00403eb8
mov eax, 0x438590
mov edx, 0x4180c0
call fcn.004015a0
cmp dword [0x438590], 0
jne 0x4059ea
mov eax, 0x438590
mov edx, dword [0x438580]
call fcn.004014e0
mov eax, dword [0x438590]
call fcn.004017ac
call fcn.00402944
call fcn.00404700
mov edx, 0x43854c
mov eax, 0x406104
call fcn.004029dc
cmp dword [0x43854c], 0
jne 0x405a25
mov eax, 0x43854c
mov edx, 0x406118
call fcn.004014e0
mov edx, 0x438554
mov eax, 0x406120
call fcn.004029dc
cmp dword [0x438554], 0
jne 0x405a52
mov eax, 0x438554
mov ecx, dword [0x43854c]
mov edx, 0x406134
call fcn.00401634
mov eax, 0x438554
call fcn.0040226c
mov edx, 0x438558
mov eax, 0x406148
call fcn.004029dc
cmp dword [0x438558], 0
jne 0x405a95
push 0x406160
push dword [0x43854c]
push 0x406184
mov eax, 0x438558
mov edx, 3
call fcn.004016a8
jmp 0x405aad
mov eax, dword [0x438558]
call fcn.00402248
test al, al
je 0x405aad
mov eax, 0x438558
call fcn.0040148c
mov eax, 0x438558
call fcn.004024c0
mov edx, 0x438550
mov eax, 0x4061a0
call fcn.004029dc
mov edx, 0x43855c
mov eax, 0x4061b0
call fcn.004029dc
cmp dword [0x43855c], 0
jne 0x405aed
mov eax, 0x43855c
mov edx, 0x4061c0
call fcn.004014e0
mov edx, 0x438560
mov eax, 0x4061d4
call fcn.004029dc
cmp dword [0x438560], 0
jne 0x405b25
push dword [0x43854c]
push 0x4061e8
push dword [0x438550]
mov eax, 0x438560
mov edx, 3
call fcn.004016a8
mov edx, 0x438590
mov eax, 0x4061ec
call fcn.004029dc
cmp dword [0x438590], 0
je 0x405b4c
mov eax, dword [0x438590]
call fcn.00402724
mov dword [0x407370], eax
mov eax, dword [0x407370]
call fcn.00405664
mov dword [0x407374], eax
mov edx, 0x438590
mov eax, 0x4061f8
call fcn.004029dc
cmp dword [0x438590], 0
je 0x405b82
mov eax, dword [0x438590]
call fcn.00402724
mov dword [0x407374], eax
mov eax, 0x406208
mov dl, byte [0x438544]
call fcn.00402a04
mov byte [0x438544], al
mov eax, 0x438560
call fcn.004024c0
mov ecx, 0x438594
mov edx, 0x406218
mov eax, dword [0x408080]
call fcn.0040289c
test al, al
jne 0x405bc8
mov edx, 0x438584
mov eax, 0x406220
call fcn.004029dc
mov eax, dword [0x438584]
call fcn.004015e8
mov dword [0x438598], eax
cmp dword [0x438598], 0
je 0x405c25
mov eax, dword [0x438584]
mov edx, dword [0x438598]
cmp byte [eax + edx - 1], 0x27
jne 0x405c25
mov eax, dword [0x438584]
cmp byte [eax], 0x27
jne 0x405c25
mov eax, 0x438584
mov ecx, 1
mov edx, dword [0x438598]
call fcn.004017ec
mov eax, 0x438584
mov ecx, 1
mov edx, 1
call fcn.004017ec
mov eax, 0x438584
call fcn.0040226c
cmp dword [0x438584], 0
je 0x405c50
cmp dword [0x438554], 0
sete dl
mov eax, 0x406228
call fcn.00402a04
test al, al
jne 0x405c54
xor eax, eax
jmp 0x405c56
mov al, 1
mov byte [0x43851c], al
cmp byte [0x43851c], 0
je 0x405ccc
cmp byte [0x438528], 1
jbe 0x405c7d
mov eax, 0x406234
xor edx, edx
call fcn.00402a04
test al, al
jne 0x405c81
xor eax, eax
jmp 0x405c83
mov al, 1
mov byte [0x43851d], al
mov edx, 0x438590
mov eax, 0x406240
call fcn.004029dc
mov eax, dword [0x438590]
call fcn.004017ac
mov edx, 0x40624c
or ecx, 0xffffffff
call fcn.004021f0
test al, al
je 0x405cbb
mov byte [0x40738c], 2
jmp 0x405cdd
mov eax, dword [0x438590]
call fcn.004029ec
mov byte [0x40738c], al
jmp 0x405cdd
mov eax, 0x406254
mov dl, 1
call fcn.00402a04
mov byte [0x43851e], al
cmp dword [0x438584], 0
je 0x405d0d
mov ecx, 0x438594
mov edx, 0x406260
mov eax, dword [0x408080]
call fcn.0040289c
test al, al
jne 0x405d0d
mov edx, 0x438588
mov eax, 0x40626c
call fcn.004029dc
mov eax, dword [0x4073b0]
cmp byte [eax], 0
je 0x405dfd
mov eax, dword [0x4073a4]
cmp byte [eax], 0
jne 0x405dfd
mov ecx, 0x438594
mov edx, 0x406274
mov eax, dword [0x408080]
call fcn.0040289c
test al, al
jne 0x405dfd
mov edx, 0x438590
mov eax, 0x40627c
call fcn.004029dc
cmp dword [0x438590], 0
jne 0x405d8f
cmp byte [0x43851c], 0
je 0x405d83
mov edx, dword [0x438584]
mov al, 0x5c
call fcn.0040258c
test eax, eax
jne 0x405d83
mov al, byte [0x406280]
mov byte [0x4072e0], al
jmp 0x405de0
mov al, byte [0x406284]
mov byte [0x4072e0], al
jmp 0x405de0
mov edx, dword [0x438590]
mov eax, 0x406290
call fcn.004025b0
test eax, eax
je 0x405daa
or byte [0x4072e0], 4
mov edx, dword [0x438590]
mov eax, 0x4062a0
call fcn.004025b0
test eax, eax
je 0x405dc5
or byte [0x4072e0], 2
mov edx, dword [0x438590]
mov eax, 0x4062b0
call fcn.004025b0
test eax, eax
je 0x405de0
or byte [0x4072e0], 1
test byte [0x4072e0], 1
je 0x405dfd
xor eax, eax
call fcn.0040322c
mov edx, dword [0x4073a0]
mov dword [edx], eax
jmp 0x4060aa
mov ecx, 0x438590
mov edx, 0x4062b8
mov eax, dword [0x408080]
call fcn.0040289c
test al, al
je 0x405e3a
mov eax, 0x438554
mov edx, dword [0x438590]
call fcn.004014e0
mov byte [0x43851c], 0
mov byte [0x40738c], 0
mov byte [0x43851e], 0
mov eax, dword [0x438554]
push eax
push 0x4062c0
call sub.KERNEL32.DLL_SetEnvironmentVariableA
cmp byte [0x43851d], 0
jne 0x405e63
mov eax, 0x4062cc
xor edx, edx
call fcn.00402a04
test al, al
jne 0x405e67
xor eax, eax
jmp 0x405e69
mov al, 1
mov byte [0x438502], al
mov eax, 0x4062d8
mov dl, 1
call fcn.00402a04
mov byte [0x407378], al
mov ecx, 0x438594
mov edx, 0x4062e8
mov eax, dword [0x408080]
call fcn.0040289c
test al, al
je 0x405e9e
mov byte [0x43851d], 1
mov edx, 0x438590
mov eax, 0x4062f4
call fcn.004029dc
mov eax, dword [0x438590]
call fcn.00402248
test al, al
je 0x405ec4
mov byte [0x4071b4], 2
jmp 0x405ee6
mov eax, dword [0x438590]
call fcn.004017ac
mov edx, 0x406300
or ecx, 0xffffffff
call fcn.004021f0
test al, al
je 0x405ee6
mov byte [0x4071b4], 1
mov edx, 0x438590
mov eax, 0x406304
call fcn.004029dc
mov eax, dword [0x438590]
call fcn.00402248
test al, al
jne 0x405faa
cmp dword [0x438590], 0
je 0x405f1f
mov eax, dword [0x438590]
call fcn.00402724
mov dword [0x407358], eax
mov eax, dword [0x407358]
call fcn.00405664
mov dword [0x40735c], eax
mov edx, 0x438548
mov eax, 0x406314
call fcn.004029dc
mov eax, 0x438548
call fcn.004024c0
mov edx, 0x438590
mov eax, 0x406324
call fcn.004029dc
cmp dword [0x438590], 0
je 0x405f6e
mov eax, dword [0x438590]
call fcn.00402724
mov dword [0x40735c], eax
mov eax, 0x406338
mov cl, byte [0x406348]
mov edx, 0x24
call fcn.00404864
mov dword [0x438540], eax
call fcn.00404a54
mov dword [0x407360], eax
mov eax, dword [0x438530]
push eax
push 1
push 0x80
mov eax, dword [0x407360]
push eax
call sub.user32.dll_SendMessageA
push 0x404c80
mov edx, 0x40634c
mov eax, dword [0x4073a8]
mov eax, dword [eax]
mov ecx, dword [0x407360]
call fcn.00401f10
mov ebx, eax
cmp dword [0x407360], 0
je 0x405fe3
mov eax, dword [0x407360]
push eax
call sub.user32.dll_DestroyWindow
xor eax, eax
mov dword [0x407360], eax
dec ebx
je 0x406003
dec ebx
je 0x405ff3
sub ebx, 2
je 0x40600d
jmp 0x40609f
mov eax, dword [0x4073a0]
mov dword [eax], 2
jmp 0x4060aa
call fcn.00405540
jmp 0x4060aa
mov al, byte [0x406284]
cmp al, byte [0x4072e0]
jne 0x40603d
mov eax, 0x40635c
call fcn.0040322c
mov edx, dword [0x4073a0]
mov dword [edx], eax
mov eax, dword [0x4073a0]
cmp dword [eax], 0
jne 0x4060aa
call fcn.00405500
jmp 0x4060aa
mov al, byte [0x406370]
cmp al, byte [0x4072e0]
jne 0x4060aa
cmp byte [0x43851c], 0
je 0x40605d
mov eax, 0x438554
call fcn.004042c4
push 0x40637c
push dword [0x438554]
push 0x4063a0
mov eax, 0x438590
mov edx, 3
call fcn.004016a8
mov eax, dword [0x438590]
call fcn.0040322c
mov edx, dword [0x4073a0]
mov dword [edx], eax
mov eax, dword [0x4073a0]
cmp dword [eax], 0
jne 0x4060aa
call fcn.00405540
jmp 0x4060aa
mov eax, dword [0x4073a0]
mov dword [eax], 0xffffffff
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4060c7
lea eax, [ebp - 0x10]
call fcn.0040148c
ret