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

Disassembly:
sub esp, 0x520
push ebx
push ebp
push esi
push edi
xor ebx, ebx
xor ebp, ebp
push str.SDLFILE
mov dword [esp + 0x20], ebp
mov dword [esp + 0x1c], ebx
call dword [sym.imp.MSVCRT.dll_getenv]
add esp, 4
cmp eax, ebx
jne 0x10001a98
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x520
ret
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x30]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x1001c1cc
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [sym.imp.MSVCRT.dll_strtok]
lea ecx, [esp + 0x34]
push ecx
call edi
add esp, 8
mov dword [esp + 0x130], eax
test eax, eax
je 0x10001afc
lea esi, [esp + 0x130]
push 0x1001c1cc
push 0
inc ebp
add esi, 4
call edi
add esp, 8
mov dword [esi], eax
test eax, eax
jne 0x10001ae2
mov dword [esp + 0x1c], ebp
xor esi, esi
test ebp, ebp
mov dword [esp + 0x14], esi
jle 0x10001db8
jmp 0x10001b14
mov ebx, dword [esp + 0x2c]
mov esi, dword [esp + 0x14]
mov edx, dword [esp + esi*4 + 0x130]
push 0x1001c1c8
push edx
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
add esp, 8
test edi, edi
mov dword [esp + 0x10], edi
je 0x10001dcd
push edi
push 1
lea eax, [esp + 0x28]
push 0xc
push eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, 1
jne 0x10001df7
cmp dword [esp + 0x20], 0x1e61
jne 0x10001e20
mov eax, dword [esp + 0x24]
lea ecx, [eax + eax*4]
lea edi, [eax + ecx*2]
shl edi, 2
add ebx, edi
test esi, esi
mov dword [esp + 0x2c], ebx
jne 0x10001b94
push edi
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov dword [0x10023248], eax
test eax, eax
jne 0x10001bc3
push edi
push str.0005_malloc_error:_size___d
jmp 0x10001bb4
mov edx, dword [0x10023248]
push ebx
push edx
call dword [sym.imp.MSVCRT.dll_realloc]
add esp, 8
mov dword [0x10023248], eax
test eax, eax
jne 0x10001bc3
push ebx
push str.0005_remalloc_error:_size___d
push str.CLI0125
push 3
call fcn.1000da50
add esp, 0x10
push edi
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x10001be8
push edi
push str.0005_malloc_error:_size___d
push str.CLI0125
push 3
call fcn.1000da50
add esp, 0x10
mov eax, dword [esp + 0x10]
push eax
push 1
push edi
push ebp
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, 1
jne 0x10001e49
sub ebx, edi
mov eax, 0xba2e8ba3
mul ebx
shr edx, 5
mov ecx, edi
mov esi, ebp
lea eax, [edx + edx*4]
mov ebx, dword [esp + 0x14]
lea edx, [edx + eax*2]
mov eax, dword [0x10023248]
lea edi, [eax + edx*4]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
test ebx, ebx
rep movsb byte es:[edi], byte [esi]
je 0x10001c8c
mov edi, dword [0x10023244]
mov eax, dword [esp + 0x24]
lea ecx, [edi + eax]
cmp edi, ecx
jge 0x10001c8c
lea edx, [edi + edi*4]
lea eax, [edi + edx*2]
shl eax, 2
mov edx, dword [0x10023248]
mov ecx, dword [eax + edx + 0x1c]
lea esi, [eax + edx + 0x18]
mov edx, dword [eax + edx - 0x10]
add eax, 0x2c
sub ecx, dword [esi]
inc edx
mov dword [esi], edx
mov edx, dword [0x10023248]
mov esi, dword [eax + edx - 0x14]
add esi, ecx
inc edi
mov dword [eax + edx - 0x10], esi
mov ecx, dword [esp + 0x24]
mov edx, dword [0x10023244]
add edx, ecx
cmp edi, edx
jl 0x10001c51
mov eax, dword [esp + 0x28]
mov esi, dword [esp + 0x18]
lea edi, [eax + eax*2]
shl edi, 3
sub edi, eax
shl edi, 2
add esi, edi
test ebx, ebx
mov dword [esp + 0x18], esi
jne 0x10001cc4
push edi
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov dword [0x10023250], eax
test eax, eax
jne 0x10001cf2
push edi
push str.0005_malloc_error:_size___d
jmp 0x10001ce3
mov eax, dword [0x10023250]
push esi
push eax
call dword [sym.imp.MSVCRT.dll_realloc]
add esp, 8
mov dword [0x10023250], eax
test eax, eax
jne 0x10001cf2
push esi
push str.0005_remalloc_error:_size___d
push str.CLI0125
push 3
call fcn.1000da50
add esp, 0x10
push edi
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x10001d17
push edi
push str.0005_malloc_error:_size___d
push str.CLI0125
push 3
call fcn.1000da50
add esp, 0x10
mov esi, dword [esp + 0x10]
push esi
push 1
push edi
push ebx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, 1
jne 0x10001eac
mov edx, dword [esp + 0x18]
mov eax, 0xb21642c9
sub edx, edi
mov ecx, edi
mul edx
shr edx, 6
mov esi, ebx
push ebp
lea eax, [edx + edx*2]
shl eax, 3
sub eax, edx
mov edx, dword [0x10023250]
lea edi, [edx + eax*4]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [esp + 0x2c]
mov esi, dword [0x1002324c]
mov ecx, dword [esp + 0x28]
mov edi, dword [0x10023244]
add esi, edx
add edi, ecx
mov dword [0x1002324c], esi
mov esi, dword [sym.imp.MSVCRT.dll_free]
mov dword [0x10023244], edi
call esi
push ebx
call esi
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x28]
add esp, 0xc
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jl 0x10001b0c
pop edi
mov eax, 1
pop esi
pop ebp
mov dword [0x1002526c], eax
pop ebx
add esp, 0x520
ret
mov ecx, dword [esp + esi*4 + 0x130]
push ecx
push str.0010_file_open_error:__s
push str.SDL0502
push 2
call fcn.1000d9f0
add esp, 0x10
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x520
ret
push str.0013_sdl_file_read_error
push str.CLI0123
push 2
call fcn.1000d9f0
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x10
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x520
ret
push str.3005_sdl_file_magic_error
push str.CLI0124
push 2
call fcn.1000da50
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x10
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x520
ret
test ebp, ebp
je 0x10001e5b
mov esi, dword [sym.imp.MSVCRT.dll_free]
push ebp
call esi
add esp, 4
jmp 0x10001e61
mov esi, dword [sym.imp.MSVCRT.dll_free]
mov eax, dword [0x10023248]
test eax, eax
je 0x10001e70
push eax
call esi
add esp, 4
mov eax, dword [0x10023250]
test eax, eax
je 0x10001e7f
push eax
call esi
add esp, 4
push str.0013_sdl_file_read_error
push str.CLI0126
push 2
call fcn.1000d9f0
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x10
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x520
ret
test ebp, ebp
je 0x10001ebe
mov edi, dword [sym.imp.MSVCRT.dll_free]
push ebp
call edi
add esp, 4
jmp 0x10001ec4
mov edi, dword [sym.imp.MSVCRT.dll_free]
mov eax, dword [0x10023248]
test eax, eax
je 0x10001ed3
push eax
call edi
add esp, 4
test ebx, ebx
je 0x10001edd
push ebx
call edi
add esp, 4
mov eax, dword [0x10023250]
test eax, eax
je 0x10001eec
push eax
call edi
add esp, 4
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x520
ret