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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xca4
push ebx
push esi
push edi
jmp 0x5b8266
push 0
push 2
push 3
push 0
push 3
push 0xc0000000
mov eax, 0x5cd008
add eax, 0x80
push eax
call dword [sym.imp.kernel32.dll_CreateFileA]
mov dword [ebp - 0xc28], eax
jmp 0x5b828f
push 0x400
lea eax, [ebp - 0x414]
push eax
push 0x5cd9d8
call dword [sym.imp.kernel32.dll_GetEnvironmentVariableA]
mov dword [ebp - 0xc24], 0
mov dword [ebp - 0xc2c], 0
cmp dword [ebp - 0xc28], 0xffffffff
jne 0x5b83f9
jmp 0x5b82cf
inc dword [ebp - 0xc2c]
cmp dword [ebp - 0xc2c], 0x400
jge 0x5b8304
mov eax, dword [ebp - 0xc2c]
movsx eax, byte [eax + ebp - 0x414]
test eax, eax
je 0x5b8304
mov eax, dword [ebp - 0xc2c]
movsx eax, byte [eax + ebp - 0x414]
cmp eax, 0x3b
jne 0x5b8302
jmp 0x5b8304
jmp 0x5b82c9
mov eax, dword [ebp - 0xc2c]
movsx eax, byte [eax + ebp - 0x414]
cmp eax, 0x3b
je 0x5b831e
xor eax, eax
jmp 0x5b8962
mov eax, dword [ebp - 0xc2c]
mov dword [ebp - 0x14], eax
jmp 0x5b832a
mov dword [ebp - 0xc94], 0
jmp 0x5b833c
inc dword [ebp - 0xc94]
mov eax, dword [ebp - 0x14]
sub eax, dword [ebp - 0xc24]
cmp eax, dword [ebp - 0xc94]
jle 0x5b836f
mov eax, dword [ebp - 0xc24]
add eax, dword [ebp - 0xc94]
mov al, byte [eax + ebp - 0x414]
mov ecx, dword [ebp - 0xc94]
mov byte [ecx + ebp - 0xc90], al
jmp 0x5b8336
mov eax, dword [ebp - 0xc94]
movsx eax, byte [eax + ebp - 0xc91]
cmp eax, 0x5c
je 0x5b8396
mov eax, dword [ebp - 0xc94]
mov byte [eax + ebp - 0xc90], 0x5c
inc dword [ebp - 0xc94]
mov eax, dword [ebp - 0xc94]
mov byte [eax + ebp - 0xc90], 0
jmp 0x5b83a7
mov eax, 0x5cd008
add eax, 0x80
push eax
lea eax, [ebp - 0xc90]
push eax
call dword [sym.imp.kernel32.dll_lstrcatA]
jmp 0x5b83c2
push 0
push 2
push 3
push 0
push 3
push 0xc0000000
lea eax, [ebp - 0xc90]
push eax
call dword [sym.imp.kernel32.dll_CreateFileA]
mov dword [ebp - 0xc28], eax
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0xc24], eax
inc dword [ebp - 0xc2c]
jmp 0x5b82ba
jmp 0x5b83fc
push 0
lea eax, [ebp - 0xc9c]
push eax
push 4
lea eax, [ebp - 0xc20]
push eax
mov eax, dword [ebp - 0xc28]
push eax
call dword [sym.imp.kernel32.dll_ReadFile]
jmp 0x5b841e
mov eax, dword [0x5cd2ba]
mov dword [ebp - 0xc98], eax
jmp 0x5b842c
mov eax, dword [0x5cd084]
mov dword [0x5cd2ba], eax
jmp 0x5b8439
mov dword [ebp - 0xc2c], 0
cmp dword [ebp - 0xc2c], 4
jge 0x5b84c2
call fcn.005b8fbd
movzx eax, ax
cdq
xor eax, edx
sub eax, edx
and eax, 3
xor eax, edx
sub eax, edx
mov byte [ebp - 8], al
jmp 0x5b8466
mov dword [ebp - 0xc94], 0
jmp 0x5b8478
inc dword [ebp - 0xc94]
mov eax, dword [ebp - 0xc94]
cmp dword [ebp - 0xc2c], eax
jle 0x5b849f
mov eax, dword [ebp - 0xc94]
xor ecx, ecx
mov cl, byte [eax + ebp - 0xc]
xor eax, eax
mov al, byte [ebp - 8]
cmp ecx, eax
jne 0x5b849d
jmp 0x5b849f
jmp 0x5b8472
mov eax, dword [ebp - 0xc94]
cmp dword [ebp - 0xc2c], eax
jne 0x5b84c0
mov al, byte [ebp - 8]
mov ecx, dword [ebp - 0xc2c]
mov byte [ecx + ebp - 0xc], al
inc dword [ebp - 0xc2c]
jmp 0x5b8443
jmp 0x5b84c5
mov al, byte [ebp - 0xb]
xor ecx, ecx
mov cl, byte [ebp - 0xc]
mov byte [ecx + ebp - 4], al
mov al, byte [ebp - 0xa]
xor ecx, ecx
mov cl, byte [ebp - 0xb]
mov byte [ecx + ebp - 4], al
mov al, byte [ebp - 9]
xor ecx, ecx
mov cl, byte [ebp - 0xa]
mov byte [ecx + ebp - 4], al
mov al, byte [ebp - 0xc]
xor ecx, ecx
mov cl, byte [ebp - 9]
mov byte [ecx + ebp - 4], al
jmp 0x5b84f8
mov dword [ebp - 0xc2c], 0
jmp 0x5b850a
inc dword [ebp - 0xc2c]
cmp dword [ebp - 0xc2c], 4
jge 0x5b852b
mov al, byte [ebp - 0xc2c]
mov ecx, dword [ebp - 0xc2c]
xor edx, edx
mov dl, byte [ecx + ebp - 4]
mov byte [edx + ebp - 0x10], al
jmp 0x5b8504
mov dword [ebp - 0xca4], 0
jmp 0x5b853d
inc dword [ebp - 0xca4]
cmp dword [ebp - 0xca4], 4
jge 0x5b864f
jmp 0x5b854d
mov dword [ebp - 0xc2c], 0
cmp dword [ebp - 0xc2c], 0x100
jge 0x5b85f7
call fcn.005b8fbd
movzx eax, ax
cdq
xor eax, edx
sub eax, edx
and eax, 0xff
xor eax, edx
sub eax, edx
mov byte [ebp - 8], al
mov dword [ebp - 0xc94], 0
jmp 0x5b8592
inc dword [ebp - 0xc94]
mov eax, dword [ebp - 0xc94]
cmp dword [ebp - 0xc2c], eax
jle 0x5b85c5
mov eax, dword [ebp - 0xca4]
shl eax, 8
add eax, dword [ebp - 0xc94]
xor ecx, ecx
mov cl, byte [eax + ebp - 0xc14]
xor eax, eax
mov al, byte [ebp - 8]
cmp ecx, eax
jne 0x5b85c3
jmp 0x5b85c5
jmp 0x5b858c
mov eax, dword [ebp - 0xc94]
cmp dword [ebp - 0xc2c], eax
jne 0x5b85f2
mov al, byte [ebp - 8]
mov ecx, dword [ebp - 0xca4]
shl ecx, 8
add ecx, dword [ebp - 0xc2c]
mov byte [ecx + ebp - 0xc14], al
inc dword [ebp - 0xc2c]
jmp 0x5b8557
jmp 0x5b85fa
mov dword [ebp - 0xc2c], 0
jmp 0x5b860c
inc dword [ebp - 0xc2c]
cmp dword [ebp - 0xc2c], 0x100
jge 0x5b864a
mov al, byte [ebp - 0xc2c]
mov ecx, dword [ebp - 0xca4]
shl ecx, 8
add ecx, dword [ebp - 0xc2c]
xor edx, edx
mov dl, byte [ecx + ebp - 0xc14]
mov ecx, dword [ebp - 0xca4]
shl ecx, 8
add edx, ecx
mov byte [edx + ebp - 0x814], al
jmp 0x5b8606
jmp 0x5b8537
push 0
push 0
push 0x10
mov eax, dword [ebp - 0xc28]
push eax
call dword [sym.imp.kernel32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0xc9c]
push eax
push 4
lea eax, [ebp - 0xca0]
push eax
mov eax, dword [ebp - 0xc28]
push eax
call dword [sym.imp.kernel32.dll_ReadFile]
mov eax, dword [ebp - 0xc20]
xor dword [ebp - 0xca0], eax
lea eax, [ebp - 0xca0]
mov dword [ebp - 0xc18], eax
mov dword [ebp - 0xca4], 0
jmp 0x5b86ab
inc dword [ebp - 0xca4]
cmp dword [ebp - 0xca4], 2
jge 0x5b8787
jmp 0x5b86bb
mov dword [ebp - 0xc2c], 0
jmp 0x5b86cd
inc dword [ebp - 0xc2c]
cmp dword [ebp - 0xc2c], 4
jge 0x5b870a
mov eax, dword [ebp - 0xc2c]
mov ecx, dword [ebp - 0xc18]
xor edx, edx
mov dl, byte [ecx + eax]
mov eax, dword [ebp - 0xc2c]
shl eax, 8
add edx, eax
mov al, byte [edx + ebp - 0x814]
mov ecx, dword [ebp - 0xc2c]
mov edx, dword [ebp - 0xc18]
mov byte [edx + ecx], al
jmp 0x5b86c7
jmp 0x5b870d
mov dword [ebp - 0xc2c], 0
jmp 0x5b871f
inc dword [ebp - 0xc2c]
cmp dword [ebp - 0xc2c], 4
jge 0x5b8749
mov eax, dword [ebp - 0xc2c]
mov ecx, dword [ebp - 0xc18]
mov al, byte [ecx + eax]
mov ecx, dword [ebp - 0xc2c]
xor edx, edx
mov dl, byte [ecx + ebp - 0x10]
mov byte [edx + ebp - 0xc], al
jmp 0x5b8719
jmp 0x5b874c
mov dword [ebp - 0xc2c], 0
jmp 0x5b875e
inc dword [ebp - 0xc2c]
cmp dword [ebp - 0xc2c], 4
jge 0x5b8782
mov eax, dword [ebp - 0xc2c]
mov al, byte [eax + ebp - 0xc]
mov ecx, dword [ebp - 0xc2c]
mov edx, dword [ebp - 0xc18]
mov byte [edx + ecx], al
jmp 0x5b8758
jmp 0x5b86a5
jmp 0x5b878a
mov eax, dword [ebp + 0x14]
push eax
mov eax, dword [ebp + 0x10]
push eax
mov eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.005b81bf
add esp, 0x10
mov dword [ebp - 0xc1c], eax
jmp 0x5b87ab
mov eax, dword [ebp - 0xca0]
cmp dword [ebp - 0xc1c], eax
jae 0x5b87c0
xor eax, eax
jmp 0x5b8962
lea eax, [ebp - 0xc1c]
mov dword [ebp - 0xc18], eax
mov dword [ebp - 0xca4], 0
jmp 0x5b87de
inc dword [ebp - 0xca4]
cmp dword [ebp - 0xca4], 2
jge 0x5b8894
mov dword [ebp - 0xc2c], 0
jmp 0x5b87fd
inc dword [ebp - 0xc2c]
cmp dword [ebp - 0xc2c], 4
jge 0x5b8827
mov eax, dword [ebp - 0xc2c]
mov ecx, dword [ebp - 0xc18]
mov al, byte [ecx + eax]
mov ecx, dword [ebp - 0xc2c]
xor edx, edx
mov dl, byte [ecx + ebp - 4]
mov byte [edx + ebp - 0xc], al
jmp 0x5b87f7
mov dword [ebp - 0xc2c], 0
jmp 0x5b8839
inc dword [ebp - 0xc2c]
cmp dword [ebp - 0xc2c], 4
jge 0x5b888f
mov eax, dword [ebp - 0xc2c]
mov al, byte [eax + ebp - 0xc]
mov ecx, dword [ebp - 0xc2c]
mov edx, dword [ebp - 0xc18]
mov byte [edx + ecx], al
mov eax, dword [ebp - 0xc2c]
mov ecx, dword [ebp - 0xc18]
xor edx, edx
mov dl, byte [ecx + eax]
mov eax, dword [ebp - 0xc2c]
shl eax, 8
add edx, eax
mov al, byte [edx + ebp - 0xc14]
mov ecx, dword [ebp - 0xc2c]
mov edx, dword [ebp - 0xc18]
mov byte [edx + ecx], al
jmp 0x5b8833
jmp 0x5b87d8
jmp 0x5b8897
mov eax, dword [ebp - 0xc1c]
mov dword [0x5cd2ba], eax
push 0
push 0
push 0
mov eax, dword [ebp - 0xc28]
push eax
call dword [sym.imp.kernel32.dll_SetFilePointer]
mov dword [ebp - 0xca4], 0
jmp 0x5b88c7
inc dword [ebp - 0xca4]
cmp dword [ebp - 0xca4], 0x14
jge 0x5b8940
cmp dword [ebp - 0xca4], 0x10
jge 0x5b890f
call fcn.005b8fbd
mov byte [ebp - 8], al
cmp dword [ebp - 0xca4], 4
jge 0x5b890d
mov eax, dword [ebp - 0xca4]
mov ecx, dword [ebp - 0xc18]
xor edx, edx
mov dl, byte [ecx + eax]
xor dl, byte [ebp - 8]
mov eax, dword [ebp - 0xca4]
mov ecx, dword [ebp - 0xc18]
mov byte [ecx + eax], dl
jmp 0x5b8922
mov eax, dword [ebp - 0xca4]
mov ecx, dword [ebp - 0xc18]
mov al, byte [ecx + eax - 0x10]
mov byte [ebp - 8], al
push 0
lea eax, [ebp - 0xc9c]
push eax
push 1
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 0xc28]
push eax
call dword [sym.imp.kernel32.dll_WriteFile]
jmp 0x5b88c1
jmp 0x5b8943
mov eax, dword [ebp - 0xc98]
mov dword [0x5cd2ba], eax
mov eax, dword [ebp - 0xc28]
push eax
call dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, 1
jmp 0x5b8962
pop edi
pop esi
pop ebx
leave
ret