Function at 0x401830
Capabilities:
Access peb ldr_data
Query environment variable
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x453e58
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x38
mov eax, dword [esp + 0x54]
push ebx
push ebp
push esi
mov esi, ecx
push edi
xor ebp, ebp
lea edi, [esi + 0xc]
mov dword [esi + 0x50], eax
mov dword [esi + 0x54], 0xffffffff
mov dword [esi + 0x58], ebp
mov byte [esi + 0x5c], 0
mov eax, dword [edi + 8]
mov ecx, dword [edi + 4]
push eax
push ecx
mov ecx, edi
call fcn.00403530
lea ecx, [esi + 0x2c]
call fcn.00404550
mov eax, dword [esi + 0x24]
mov ecx, dword [esi + 0x20]
lea ebx, [esi + 0x1c]
push eax
push ecx
mov ecx, ebx
call fcn.00403530
mov ecx, dword [esp + 0x58]
push edi
push 0x466198
push ecx
call fcn.00406e20
mov edx, dword [esp + 0x68]
push ebx
push 0x466198
push edx
call fcn.00406e20
mov al, byte [esp + 0x7c]
mov dword [esp + 0x54], ebp
mov byte [esp + 0x50], al
mov dword [esp + 0x58], ebp
mov dword [esp + 0x5c], ebp
mov edx, dword [esp + 0x78]
lea ecx, [esp + 0x50]
push ecx
push 0x466198
push edx
mov dword [esp + 0x74], ebp
call fcn.00406e20
add esp, 0x24
add esi, 0x30
mov dword [esp + 0x58], ebp
xor edi, edi
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x60], edi
cmp eax, ebp
je 0x401bc1
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x58]
sub ecx, eax
sar ecx, 4
cmp edx, ecx
jae 0x401bc1
mov dl, byte [edi + eax]
add edi, eax
push ebp
lea ecx, [esp + 0x1c]
mov byte [esp + 0x1c], dl
call fcn.00401470
mov eax, dword [0x4571cc]
lea ecx, [esp + 0x18]
push eax
push ebp
push edi
call fcn.00403000
mov eax, dword [esp + 0x1c]
mov byte [esp + 0x50], 1
cmp eax, ebp
je 0x40194e
lea ecx, [esp + 0x18]
call fcn.00403320
mov eax, dword [esp + 0x1c]
jmp 0x401953
mov eax, 0x457138
cmp byte [eax], 0x25
jne 0x401baf
lea ecx, [esp + 0x18]
call fcn.00403320
mov edi, dword [esp + 0x1c]
lea ecx, [esp + 0x18]
call fcn.00403320
cmp edi, ebp
jne 0x40197a
xor edi, edi
jmp 0x40197e
sub edi, dword [esp + 0x1c]
push 1
push edi
lea ecx, [esp + 0x20]
call fcn.00403200
mov eax, dword [esp + 0x1c]
cmp eax, ebp
jne 0x401997
mov eax, 0x457138
push ebp
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov ebp, eax
test ebp, ebp
je 0x401b88
lea edi, [ebp + 1]
push edi
call fcn.0043cf3c
mov ecx, edi
mov ebx, eax
mov edx, ecx
xor eax, eax
mov edi, ebx
add esp, 4
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
mov dword [esp + 0x14], ebx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x1c]
xor edi, edi
cmp eax, edi
jne 0x4019df
mov eax, 0x457138
push ebp
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov al, byte [esp + 0x64]
mov dword [esp + 0x2c], edi
mov byte [esp + 0x28], al
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edi
lea ecx, [esp + 0x28]
mov byte [esp + 0x50], 2
push ecx
push 0x466198
push ebx
call fcn.00406e20
mov edi, dword [esp + 0x3c]
mov ebx, dword [esp + 0x38]
mov eax, dword [esi + 8]
mov edx, dword [esi + 0xc]
mov dword [esp + 0x70], edi
sub edi, ebx
sub edx, eax
add esp, 0xc
sar edi, 4
sar edx, 4
cmp edx, edi
mov dword [esp + 0x10], ebx
mov ebp, eax
jae 0x401aeb
mov ecx, esi
call fcn.00402fe0
cmp edi, eax
jae 0x401a56
mov ecx, esi
call fcn.00402fe0
mov dword [esp + 0x5c], eax
jmp 0x401a5a
mov dword [esp + 0x5c], edi
mov ecx, esi
call fcn.00402fe0
mov ebx, eax
mov eax, dword [esp + 0x5c]
add ebx, eax
mov eax, ebx
jns 0x401a6f
xor eax, eax
shl eax, 4
push eax
call fcn.0043cf3c
add esp, 4
mov dword [esp + 0x5c], eax
mov ecx, esi
push eax
mov eax, dword [esi + 4]
push ebp
push eax
call fcn.004036f0
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x10]
push eax
push ecx
push edx
mov ecx, esi
call fcn.004036f0
push eax
mov eax, dword [esi + 8]
push eax
push ebp
mov ecx, esi
call fcn.004036f0
mov ecx, dword [esi + 8]
mov edx, dword [esi + 4]
push ecx
push edx
mov ecx, esi
call fcn.004036a0
mov eax, dword [esi + 4]
push eax
call fcn.0043cf65
mov ebp, dword [esp + 0x60]
add esp, 4
shl ebx, 4
add ebx, ebp
mov ecx, esi
mov dword [esi + 0xc], ebx
call fcn.00402fe0
add eax, edi
mov dword [esi + 4], ebp
shl eax, 4
add eax, ebp
mov dword [esi + 8], eax
jmp 0x401b6d
mov ecx, eax
sub ecx, ebp
sar ecx, 4
cmp ecx, edi
jae 0x401b3b
shl edi, 4
mov ecx, esi
lea edx, [edi + ebp]
push edx
push eax
push ebp
call fcn.004036f0
mov eax, dword [esi + 8]
mov ecx, dword [esp + 0x64]
push eax
sub eax, ebp
sar eax, 4
shl eax, 4
add eax, ebx
push ecx
push eax
mov ecx, esi
call fcn.004036f0
mov edx, dword [esi + 8]
push ebp
sub edx, ebp
sar edx, 4
shl edx, 4
add edx, ebx
push edx
push ebx
call fcn.00403cd0
add esp, 0xc
jmp 0x401b6a
test edi, edi
jbe 0x401b6d
shl edi, 4
push eax
push eax
sub eax, edi
mov ecx, esi
push eax
call fcn.004036f0
mov eax, dword [esi + 8]
push eax
sub eax, edi
push eax
push ebp
call fcn.00403e30
mov eax, dword [esp + 0x70]
push ebp
push eax
push ebx
call fcn.00403cd0
add esp, 0x18
add dword [esi + 8], edi
mov ecx, dword [esp + 0x14]
push ecx
call fcn.0043cf65
add esp, 4
lea ecx, [esp + 0x28]
mov byte [esp + 0x50], 1
call fcn.00402f80
xor ebp, ebp
push 1
lea ecx, [esp + 0x1c]
mov byte [esp + 0x54], 0
call fcn.00401470
mov ecx, dword [esp + 0x58]
mov edi, dword [esp + 0x60]
inc ecx
add edi, 0x10
mov dword [esp + 0x58], ecx
jmp 0x4018e9
mov eax, dword [esi + 8]
lea edx, [esp + 0x18]
push edx
push eax
mov ecx, esi
call fcn.004033a0
jmp 0x401b8a
lea ecx, [esp + 0x38]
mov dword [esp + 0x50], 0xffffffff
call fcn.00402f80
mov ecx, dword [esp + 0x48]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x44
ret 0x10