Function at 0x100d7200
Capabilities:
Query environment variable
Read file on windows
Set environment variable
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x101905ac
mov eax, dword fs:[0]
push eax
sub esp, 0xb80
mov eax, dword [0x101d8724]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
cmp dword [ebp + 0x10], 0
jne 0x100d757c
push 0
lea eax, [ebp - 0x318]
push eax
push pe_nt_image_headers32
lea ecx, [ebp - 0x314]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x100d7262
mov eax, 0xd
jmp 0x100d7a89
push 0
lea eax, [ebp - 0x318]
push eax
push pe_nt_image_headers32
lea ecx, [ebp - 0x114]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x100d728f
mov eax, 0xd
jmp 0x100d7a89
mov byte [ebp - 0x31a], 0
mov byte [ebp - 0x319], 0
cmp dword [ebp + 0x14], 2
jne 0x100d72ac
mov byte [ebp - 0x319], 1
jmp 0x100d72bb
xor eax, eax
cmp dword [ebp + 0x14], 0
sete al
mov byte [ebp - 0x31a], al
movzx ecx, byte [ebp - 0x31a]
test ecx, ecx
je 0x100d7474
call fcn.100d6290
mov edx, dword [0x101dd540]
mov dword [ebp - 0xb44], edx
mov eax, dword [ebp - 0xb44]
mov byte [eax + 0x584], 0
mov ecx, dword [0x101a3c1c]
mov dword [ebp - 0xb50], ecx
sub esp, 8
mov edx, esp
mov dword [ebp - 0xb48], esp
mov dword [ebp - 0xb4c], edx
mov eax, dword [ebp - 0xb4c]
mov byte [eax], 0
mov dword [ebp - 4], 0
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0xb4c]
mov dword [ebp - 0xb80], ecx
mov dword [ebp - 4], 1
push 1
lea edx, [ebp - 0x114]
push edx
lea eax, [ebp - 0x314]
push eax
mov dword [ebp - 4], 0xffffffff
mov ecx, 0x101dafb0
call fcn.1007edd0
mov byte [ebp - 0xb81], al
movzx ecx, byte [ebp - 0xb81]
test ecx, ecx
jne 0x100d7371
call fcn.100c2450
cmp eax, 0x701
jne 0x100d7435
mov edx, dword [ebp + 0xc]
push edx
mov ecx, dword [0x101dd540]
call fcn.10074b00
push 0x101a0fc1
lea eax, [ebp - 0x314]
push eax
call fcn.1014e930
add esp, 8
push 0
lea ecx, [ebp - 0x318]
push ecx
push 1
lea edx, [ebp - 0x314]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [0x101dd540]
mov dword [ebp - 0xb54], ecx
mov edx, dword [ebp - 0xb54]
mov al, byte [edx + 0x584]
mov byte [ebp - 0xb55], al
movzx ecx, byte [ebp - 0xb55]
test ecx, ecx
je 0x100d73f3
push 0
mov ecx, dword [0x101dd540]
call fcn.10074560
push 1
mov ecx, dword [0x101dd540]
call fcn.10074560
mov edx, dword [0x101dd540]
mov dword [ebp - 0xb5c], edx
push 0
push 0
mov ecx, dword [ebp - 0xb5c]
call fcn.10074470
movzx eax, al
neg eax
sbb eax, eax
add eax, 1
mov byte [ebp - 0x31b], al
movzx ecx, byte [ebp - 0x31b]
test ecx, ecx
je 0x100d7433
mov eax, 0x573
jmp 0x100d7a89
jmp 0x100d746f
push 0x101a0fc1
lea edx, [ebp - 0x314]
push edx
call fcn.1014e930
add esp, 8
push 0
lea eax, [ebp - 0x318]
push eax
push 1
lea ecx, [ebp - 0x314]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
call fcn.100c2450
jmp 0x100d7a89
jmp 0x100d7570
mov dword [ebp - 0x320], 0
mov eax, dword [0x101a3c1c]
mov dword [ebp - 0xb64], eax
sub esp, 8
mov ecx, esp
mov dword [ebp - 0xb40], esp
mov dword [ebp - 0xb60], ecx
mov edx, dword [ebp - 0xb60]
mov byte [edx], 0
mov dword [ebp - 4], 2
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0xb60]
mov dword [ebp - 0xb88], eax
mov dword [ebp - 4], 3
push 0
lea ecx, [ebp - 0x114]
push ecx
lea edx, [ebp - 0x314]
push edx
mov dword [ebp - 4], 0xffffffff
mov ecx, 0x101dafb0
call fcn.1007edd0
mov byte [ebp - 0xb89], al
movzx eax, byte [ebp - 0xb89]
test eax, eax
jne 0x100d7503
call fcn.100c2450
mov dword [ebp - 0x320], eax
jmp 0x100d7526
movzx ecx, byte [ebp - 0x319]
test ecx, ecx
je 0x100d7526
lea edx, [ebp - 0x114]
push edx
lea eax, [ebp - 0x314]
push eax
mov ecx, 0x101dafb0
call fcn.1007c230
mov ecx, dword [ebp + 0xc]
push ecx
mov ecx, dword [0x101dd540]
call fcn.10074b00
push 0x101a0fc1
lea edx, [ebp - 0x314]
push edx
call fcn.1014e930
add esp, 8
push 0
lea eax, [ebp - 0x318]
push eax
push 1
lea ecx, [ebp - 0x314]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x320]
jmp 0x100d7a89
xor eax, eax
jmp 0x100d7a89
cmp dword [ebp + 0x10], 1
jne 0x100d75d2
call fcn.100d6290
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [0x101dd540]
call fcn.10074b00
push 0x101a0fc1
lea ecx, [ebp - 0x214]
push ecx
call fcn.1014e930
add esp, 8
push 0
lea edx, [ebp - 0x318]
push edx
push 1
lea eax, [ebp - 0x214]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
xor eax, eax
jmp 0x100d7a89
cmp dword [ebp + 0x10], 2
jne 0x100d7604
call fcn.100d6290
mov ecx, 0x101dafb0
call fcn.10073db0
movzx edx, al
test edx, edx
jne 0x100d75f8
mov eax, 0x89a
jmp 0x100d7a89
xor eax, eax
jmp 0x100d7a89
cmp dword [ebp + 0x10], 3
jne 0x100d7646
call fcn.100d6290
mov eax, dword [0x101dd540]
mov dword [ebp - 0xb74], eax
push 0
push 0
mov ecx, dword [ebp - 0xb74]
call fcn.10078f40
movzx ecx, al
test ecx, ecx
jne 0x100d763a
mov eax, 0x70c
jmp 0x100d7a89
xor eax, eax
jmp 0x100d7a89
cmp dword [ebp + 0x10], 4
jne 0x100d766d
mov edx, dword [0x101dd540]
mov dword [ebp - 0xb78], edx
mov ecx, dword [ebp - 0xb78]
call fcn.10073ca0
jmp 0x100d7a89
cmp dword [ebp + 0x10], 5
jne 0x100d76ad
call fcn.100d6290
mov eax, dword [0x101dd540]
mov dword [ebp - 0xb7c], eax
mov ecx, dword [ebp - 0xb7c]
call fcn.10078b80
movzx ecx, al
test ecx, ecx
jne 0x100d76a1
call fcn.100c2450
jmp 0x100d7a89
xor eax, eax
jmp 0x100d7a89
cmp dword [ebp + 0x10], 6
jne 0x100d76d1
call fcn.100d6290
push 1
call fcn.100d45c0
add esp, 4
call fcn.100c2450
jmp 0x100d7a89
cmp dword [ebp + 0x10], 7
jne 0x100d7746
call fcn.100d6290
mov dl, byte [0x101a0fc1]
mov byte [ebp - 0x424], dl
push 0xff
push 0
lea eax, [ebp - 0x423]
push eax
call fcn.1014e270
add esp, 0xc
push 0
lea ecx, [ebp - 0x318]
push ecx
push pe_nt_image_headers32
lea edx, [ebp - 0x424]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x100d772b
mov eax, 0xd
jmp 0x100d7a89
lea ecx, [ebp - 0x424]
push ecx
call fcn.100d6ec0
call fcn.100c2450
jmp 0x100d7a89
cmp dword [ebp + 0x10], 8
jne 0x100d775f
mov edx, dword [ebp + 0x14]
push edx
call fcn.100d6f10
jmp 0x100d7a89
cmp dword [ebp + 0x10], 9
jne 0x100d77ba
mov al, byte [0x101a0fc1]
mov byte [ebp - 0x624], al
push 0x1ff
push 0
lea ecx, [ebp - 0x623]
push ecx
call fcn.1014e270
add esp, 0xc
push 0x200
lea edx, [ebp - 0x624]
push edx
push str._USERSTRING
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
lea eax, [ebp - 0x624]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
call fcn.100d6fd0
movzx eax, al
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0xa
jne 0x100d781f
mov dl, byte [0x101a0fc1]
mov byte [ebp - 0x824], dl
push 0x1ff
push 0
lea eax, [ebp - 0x823]
push eax
call fcn.1014e270
add esp, 0xc
push 0x200
lea ecx, [ebp - 0x824]
push ecx
mov edx, dword [ebp + 0x14]
push edx
call fcn.100d70c0
mov dword [ebp - 0x828], eax
lea eax, [ebp - 0x824]
push eax
push str._USERSTRING
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
mov eax, dword [ebp - 0x828]
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0xb
jne 0x100d7877
mov cl, byte [0x101a0fc1]
mov byte [ebp - 0x934], cl
push 0x103
push 0
lea edx, [ebp - 0x933]
push edx
call fcn.1014e270
add esp, 0xc
push 0x104
lea eax, [ebp - 0x934]
push eax
push str._USERSTRING
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
lea ecx, [ebp - 0x934]
push ecx
call fcn.100c0bf0
movzx eax, al
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0xc
jne 0x100d78a2
call fcn.10118430
movzx edx, al
test edx, edx
je 0x100d7892
xor eax, eax
jmp 0x100d7a89
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0xd
jne 0x100d78ce
mov eax, dword [ebp + 0x14]
push eax
call fcn.100c31a0
movzx ecx, al
test ecx, ecx
je 0x100d78bf
xor eax, eax
jmp 0x100d7a89
call fcn.100c2450
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0xe
jne 0x100d78e9
mov edx, dword [ebp + 0x14]
push edx
call fcn.100d62e0
xor eax, eax
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0xf
jne 0x100d7906
mov ecx, dword [0x101dd540]
call fcn.10079620
xor eax, eax
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0x10
jne 0x100d7921
mov eax, dword [ebp + 0x14]
push eax
call fcn.100d6380
xor eax, eax
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0x11
jne 0x100d7940
mov ecx, dword [ebp + 0x14]
push ecx
call fcn.100d6420
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0x12
jne 0x100d796c
mov edx, dword [ebp + 0x14]
push edx
call fcn.100c31c0
movzx eax, al
test eax, eax
je 0x100d795d
xor eax, eax
jmp 0x100d7a89
call fcn.100c2450
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0x13
jne 0x100d79d8
mov cl, byte [0x101a0fc1]
mov byte [ebp - 0xb34], cl
push 0x1ff
push 0
lea edx, [ebp - 0xb33]
push edx
call fcn.1014e270
add esp, 0xc
push 0x200
lea eax, [ebp - 0xb34]
push eax
push str._USERSTRING
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
lea ecx, [ebp - 0xb34]
push ecx
mov edx, dword [ebp + 0x14]
push edx
call fcn.100c3130
movzx eax, al
test eax, eax
je 0x100d79c9
xor eax, eax
jmp 0x100d7a89
call fcn.100c2450
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0x14
jne 0x100d7a2e
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 0xb38], ecx
mov edx, dword [ebp - 0xb38]
mov eax, dword [edx + 8]
push eax
mov ecx, dword [ebp - 0xb38]
mov edx, dword [ecx + 4]
push edx
mov eax, dword [ebp - 0xb38]
mov ecx, dword [eax]
push ecx
call fcn.100ac180
mov edx, dword [ebp - 0xb38]
mov dword [edx + 0xc], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0xb38]
mov dword [ecx + 0x10], eax
mov edx, dword [ebp - 0xb38]
mov eax, dword [edx + 0xc]
jmp 0x100d7a89
cmp dword [ebp + 0x10], 0x15
jne 0x100d7a84
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0xb3c], eax
mov ecx, dword [ebp - 0xb3c]
mov edx, dword [ecx + 8]
push edx
mov eax, dword [ebp - 0xb3c]
mov ecx, dword [eax + 4]
push ecx
mov edx, dword [ebp - 0xb3c]
mov eax, dword [edx]
push eax
call fcn.100ac230
mov ecx, dword [ebp - 0xb3c]
mov dword [ecx + 0xc], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp - 0xb3c]
mov dword [edx + 0x10], eax
mov eax, dword [ebp - 0xb3c]
mov eax, dword [eax + 0xc]
jmp 0x100d7a89
mov eax, 0xc
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.1014c68a
mov esp, ebp
pop ebp
ret