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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x168
or dword [ebp - 0x20], 0xffffffff
and dword [ebp - 8], 0
or dword [ebp - 0x18], 0xffffffff
push ebx
push esi
mov esi, dword [sym.imp.MSVCRT.dll_malloc]
push edi
mov edi, 0x100
push edi
call esi
mov ebx, eax
pop ecx
test ebx, ebx
mov dword [ebp - 0x1c], ebx
jne 0x100022da
or eax, 0xffffffff
jmp 0x10002566
push edi
push 0
push ebx
call sub.MSVCRT.dll_memset
mov eax, dword [ebp + 8]
push 0xff
add eax, 0x42e
push eax
push ebx
call dword [sym.imp.MSVCRT.dll_strncpy]
push ebx
call sub.MSVCRT.dll_strlen
mov edi, 0x800
mov dword [ebp - 0x28], eax
push edi
call esi
add esp, 0x20
mov dword [ebp - 0x14], eax
test eax, eax
je 0x1000254b
push edi
push 0
push eax
call sub.MSVCRT.dll_memset
push 0x140
lea eax, [ebp - 0x168]
push 0
push eax
call sub.MSVCRT.dll_memset
mov edi, 0x104
push edi
call esi
push edi
mov dword [ebp - 0xc], eax
call esi
add esp, 0x20
cmp dword [ebp - 0xc], 0
mov ebx, eax
mov dword [ebp - 0x24], ebx
je 0x1000253f
test ebx, ebx
je 0x10002535
push edi
push 0
push dword [ebp - 0xc]
call sub.MSVCRT.dll_memset
push edi
push 0
push ebx
call sub.MSVCRT.dll_memset
add esp, 0x18
push edi
push ebx
push str.temp
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x100023f8
and dword [ebp - 0x10], 0
and byte [ebp - 1], 0
cmp byte [ebp - 1], 0
jne 0x100023f8
mov eax, dword [ebp + 8]
push edi
push dword [ebp - 0xc]
add eax, 0x194
push eax
lea eax, [ebp - 0x18]
push ebx
push eax
call fcn.10002669
add esp, 0x14
test eax, eax
je 0x100023ee
push edi
push ebx
push 0x10010020
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x100023f2
mov eax, dword [ebp + 8]
push edi
push dword [ebp - 0xc]
add eax, 0x194
push eax
lea eax, [ebp - 0x18]
push ebx
push eax
call fcn.10002669
add esp, 0x14
test eax, eax
je 0x100023ee
inc dword [ebp - 0x10]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x100023f2
mov byte [ebp - 1], 1
cmp dword [ebp - 0x10], 0xa
jb 0x1000238b
cmp dword [ebp - 0x18], 0xffffffff
je 0x10002535
mov eax, dword [ebp + 8]
mov ebx, str.DMWI__
add eax, 0x194
mov dword [ebp - 0x10], eax
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp + 8], eax
je 0x10002512
lea ecx, [ebp - 8]
push 0
push ecx
push 0x800
push dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10002509
mov eax, dword [ebp - 8]
cmp eax, 0x5dc
jae 0x100024f7
lea eax, [eax + eax + 9]
push eax
call esi
mov esi, eax
pop ecx
test esi, esi
je 0x100024f1
mov eax, dword [ebp - 8]
lea eax, [eax + eax + 9]
push eax
push 0
push esi
call sub.MSVCRT.dll_memset
push ebx
call sub.MSVCRT.dll_strlen
push eax
push ebx
push esi
call dword [sym.imp.MSVCRT.dll_strncpy]
push ebx
call sub.MSVCRT.dll_strlen
add dword [ebp - 8], 6
add eax, esi
push eax
push dword [ebp - 0x14]
push dword [ebp - 8]
call fcn.1000256d
push esi
call sub.MSVCRT.dll_strlen
mov dword [ebp - 8], eax
mov byte [esi + eax], 0x25
mov eax, dword [ebp - 8]
push str.DMWI
mov byte [esi + eax + 1], 0x25
mov eax, dword [ebp - 8]
and byte [esi + eax + 2], 0
add dword [ebp - 8], 2
push dword [ebp - 8]
push esi
push dword [ebp - 0x28]
push dword [ebp - 0x1c]
call fcn.10002d02
add esp, 0x44
test eax, eax
ja 0x100024e9
and dword [ebp - 0x20], 0
push esi
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
mov esi, dword [sym.imp.MSVCRT.dll_malloc]
push 0x800
push 0
push dword [ebp - 0x14]
call sub.MSVCRT.dll_memset
add esp, 0xc
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
lea eax, [ebp - 0x18]
push dword [ebp - 0xc]
push dword [ebp - 0x10]
push dword [ebp - 0x24]
push eax
call fcn.10002669
add esp, 0x14
cmp dword [ebp - 0x18], 0xffffffff
jne 0x10002412
mov ebx, dword [ebp - 0x24]
push dword [ebp - 0xc]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
test ebx, ebx
je 0x1000254b
push ebx
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
push dword [ebp - 0x1c]
mov esi, dword [sym.imp.MSVCRT.dll_free]
call esi
cmp dword [ebp - 0x14], 0
pop ecx
je 0x10002563
push dword [ebp - 0x14]
call esi
pop ecx
mov eax, dword [ebp - 0x20]
pop edi
pop esi
pop ebx
leave
ret 4