Function at 0x499030
Capabilities:
Query environment variable

Disassembly:
push ebp
mov eax, 0x3aac
push edi
push esi
push ebx
call fcn.004f11c8
sub esp, eax
call sub.SDL2.dll_SDL_CreateMutex
mov dword [0x11650ec], eax
call sub.SDL2.dll_SDL_CreateMutex
mov dword [0x11650e8], eax
call sub.SDL2.dll_SDL_CreateMutex
mov dword [0x11650e4], eax
call sub.SDL2.dll_SDL_CreateMutex
mov ebx, dword [0x503514]
mov dword [0x11650e0], eax
cmp ebx, 0xf9f
jg 0x49a2b0
mov dword [0x503514], 0xfa0
mov ebx, 0xfa0
mov dword [esp], 0x10
call sub.SDL2.dll_SDL_Init
test eax, eax
js 0x49a2df
mov eax, dword [0x50350c]
cmp eax, 0x7f
jle 0x4992ed
cmp eax, 0x2000
jle 0x4990c1
mov dword [0x50350c], 0x2000
mov eax, 0x2000
mov dword [esp + 0xc], eax
mov dword [esp + 8], 2
mov dword [esp + 4], 0x8010
mov dword [esp], ebx
call sub.SDL2_mixer.dll_Mix_OpenAudio
test eax, eax
js 0x49a315
mov eax, dword [0x503510]
cmp eax, 0x20
jle 0x49a2f8
mov dword [0x503510], 0x20
mov eax, 0x20
mov dword [esp], eax
call sub.SDL2_mixer.dll_Mix_AllocateChannels
mov dword [esp], 0x498bc0
call sub.SDL2_mixer.dll_Mix_ChannelFinished
mov dword [esp], fcn.0049afc0
call sub.SDL2_mixer.dll_Mix_HookMusicFinished
mov eax, dword [0x503510]
test eax, eax
jle 0x499146
shl eax, 2
mov dword [esp + 4], 0xff
mov dword [esp + 8], eax
mov dword [esp], 0x1192000
call sub.msvcrt.dll_memset
mov eax, dword [0xde84a8]
mov dword [esp + 0xc], 0xd67660
mov dword [esp + 4], 0x800
mov dword [esp + 8], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp], 0x1165500
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcpy
lea eax, [esp + 0x300]
mov dword [esp + 0xc], str.sound.cfg
mov dword [esp + 8], 0x1165500
mov dword [esp + 4], 0x800
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x521935
mov dword [esp], eax
call fcn.00445e10
mov ecx, eax
test eax, eax
je 0x49a331
lea eax, [esp + 0x1aa0]
mov dword [esp + 0x14], eax
mov esi, ecx
lea esi, [esi]
mov eax, dword [esp + 0x14]
mov dword [esp + 8], 0x1000
mov dword [esp], esi
mov dword [esp + 4], eax
call fcn.00445ec0
test eax, eax
jne 0x499662
movzx eax, byte [esp + 0x1aa0]
cmp al, 0x20
je 0x499214
cmp al, 9
jne 0x49a29e
mov eax, dword [esp + 0x14]
lea esi, [esi]
nop
movzx edx, byte [eax + 1]
add eax, 1
cmp dl, 0x20
je 0x499220
cmp dl, 9
je 0x499220
mov dword [esp + 4], eax
lea eax, [esp + 0x2aa0]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
lea esi, [esi]
mov eax, dword [esp + 0x14]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov ebx, eax
lea ebp, [eax - 2]
cmp eax, 1
jbe 0x499308
cmp byte [esp + eax + 0x1a9f], 0x5c
jne 0x499308
cmp byte [esp + ebp + 0x1aa0], 0x20
jne 0x499308
lea eax, [esp + 0x2aa0]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edi, eax
lea eax, [eax + ebx]
cmp eax, 0xfff
ja 0x499270
mov eax, dword [esp + 0x14]
mov byte [esp + ebp + 0x1aa0], 0
mov dword [esp + 8], 0x1000
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.00445ec0
test eax, eax
jne 0x499248
movzx eax, byte [esp + 0x1aa0]
test al, 0xdf
je 0x4992d1
cmp al, 9
jne 0x499650
mov eax, dword [esp + 0x14]
mov dword [esp + 4], eax
lea eax, [esp + 0x2aa0]
mov dword [esp], eax
call sub.msvcrt.dll_strcat
jmp 0x499248
mov dword [0x50350c], 0x80
mov eax, pe_nt_image_headers32
jmp 0x4990c1
mov edi, dword [esp + 0x14]
lea eax, [esp + 0x2aa0]
mov dword [esp + 4], eax
mov dword [esp], edi
call sub.msvcrt.dll_strcpy
movzx eax, byte [esp + 0x1aa0]
mov byte [esp + 0x18], 0
cmp al, 0x3b
jne 0x499344
mov byte [esp + 0x18], 1
movzx eax, byte [esp + 0x1aa1]
lea edi, [esp + 0x1aa1]
test al, al
je 0x4991e0
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_isalpha]
test eax, eax
je 0x4991e0
mov dword [esp + 8], 8
mov dword [esp + 4], str.packname
mov dword [esp], edi
call sub.msvcrt.dll_strncmp
test eax, eax
je 0x4991e0
mov dword [esp + 8], 6
mov dword [esp + 4], str.author
mov dword [esp], edi
call sub.msvcrt.dll_strncmp
test eax, eax
je 0x4991e0
mov dword [esp + 8], 0xb
mov dword [esp + 4], str.description
mov dword [esp], edi
call sub.msvcrt.dll_strncmp
test eax, eax
je 0x4991e0
mov dword [esp + 4], 0x3d
mov dword [esp], edi
call sub.msvcrt.dll_strchr
mov ebp, eax
test eax, eax
je 0x4991e0
mov byte [eax], 0
cmp byte [edi], 0
jne 0x4993f4
jmp 0x4991e0
mov byte [eax], 0
cmp byte [edi], 0
je 0x4991e0
mov dword [esp], edi
call sub.msvcrt.dll_strlen
lea eax, [edi + eax - 1]
movzx edx, byte [eax]
cmp dl, 0x20
je 0x4993e8
cmp dl, 9
je 0x4993e8
lea eax, [ebp + 1]
cmp byte [ebp + 1], 0
mov dword [esp + 0x1c], eax
mov ebx, eax
jne 0x499435
jmp 0x4991e0
mov byte [eax], 0
cmp byte [ebp + 1], 0
je 0x4991e0
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
add eax, ebp
movzx edx, byte [eax]
cmp dl, 9
sete cl
cmp dl, 0x20
sete dl
or cl, dl
jne 0x499428
mov eax, 0x18f
mov dword [esp + 0x24], esi
mov esi, ecx
lea ebx, [esp + 0xd0]
mov dword [esp + 0x28], ebp
mov ebp, eax
jmp 0x499479
sub ebp, 1
jb 0x49a7c0
mov dword [esp + 8], ebp
mov dword [esp + 4], str.return_get_sound_name__d_
mov dword [esp], ebx
call fcn.00498d50
mov dword [esp + 4], ebx
mov dword [esp], 0
call fcn.004a3160
cmp byte [eax], 0
je 0x499470
mov dword [esp + 4], eax
mov dword [esp], edi
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x499470
mov dword [esp + 0x20], ebp
mov ebp, dword [esp + 0x28]
mov ecx, esi
mov esi, dword [esp + 0x24]
movzx eax, byte [ebp + 1]
cmp al, 0x20
je 0x4994cc
cmp al, 9
jne 0x4994e3
mov edx, dword [esp + 0x1c]
movzx eax, byte [edx + 1]
add edx, 1
cmp al, 0x20
je 0x4994d0
cmp al, 9
je 0x4994d0
mov dword [esp + 0x1c], edx
test al, al
je 0x4991e0
mov byte [esp + 0x24], cl
cmp al, 0x22
je 0x49a8cc
mov eax, dword [esp + 0x1c]
mov dword [esp + 4], 0x5219f5
mov dword [esp], eax
call sub.msvcrt.dll_strpbrk
movzx ecx, byte [esp + 0x24]
mov ebp, eax
test ebp, ebp
je 0x499536
movzx eax, byte [ebp + 1]
mov byte [ebp], 0
lea edx, [ebp + 1]
cmp al, 0x20
jne 0x499530
movzx eax, byte [edx + 1]
add edx, 1
cmp al, 0x20
je 0x499525
cmp al, 9
je 0x499525
mov ebp, edx
mov edx, dword [esp + 0x20]
mov dword [esp + 0x28], esi
mov esi, ecx
imul eax, edx, 0x330
lea edi, [eax + 0x1192080]
imul eax, edx, 0xcc
mov dword [esp + 0x24], eax
mov ebx, dword [edi]
cmp ebx, 0x63
jg 0x49a5fa
mov eax, dword [esp + 0x1c]
mov dword [esp + 8], 0x1165500
mov dword [esp + 4], 0x800
mov dword [esp + 0xc], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x5218f4
mov dword [esp], eax
call sub.msvcrt.dll_fopen
test eax, eax
je 0x49a5d0
mov dword [esp], eax
call sub.msvcrt.dll_fclose
lea eax, [esp + 0x300]
mov dword [esp], eax
call fcn.00401bb0
add dword [edi], 1
mov dword [edi + 0x324], 0xffffffff
mov ecx, eax
mov eax, dword [esp + 0x24]
lea eax, [ebx + eax + 0x64]
mov dword [eax*4 + 0x1192084], ecx
mov eax, esi
test al, al
jne 0x4995f0
add dword [0xdc8468], 1
mov byte [edi + 0x32d], 1
mov esi, 1
test ebp, ebp
je 0x49a5fa
cmp byte [ebp], 0x22
je 0x49a6c1
mov dword [esp + 4], 0x5219f5
mov dword [esp], ebp
call sub.msvcrt.dll_strpbrk
mov dword [esp + 0x1c], ebp
xor ebp, ebp
test eax, eax
je 0x499556
mov byte [eax], 0
lea ebp, [eax + 1]
movzx eax, byte [eax + 1]
cmp al, 0x20
je 0x49963b
cmp al, 9
jne 0x499556
movzx eax, byte [ebp + 1]
add ebp, 1
cmp al, 0x20
jne 0x499633
jmp 0x49963b
mov ebp, 0x20
mov word [esp + edi + 0x2aa0], bp
jmp 0x4992d1
cmp byte [0xd67a86], 0
jne 0x499711
mov dword [esp], str.HOMEDRIVE
call sub.msvcrt.dll_getenv
test eax, eax
je 0x499711
mov dword [esp], str.HOMEPATH
call sub.msvcrt.dll_getenv
test eax, eax
je 0x499711
mov dword [esp], str.HOMEDRIVE
call sub.msvcrt.dll_getenv
mov dword [esp + 4], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
mov dword [esp], str.HOMEPATH
call sub.msvcrt.dll_getenv
mov dword [esp + 4], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strcat
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea ecx, [esp + 0x300]
add eax, ecx
mov dword [eax], 0x6d6f545c
mov dword [eax + 4], 0x54454e65
mov dword [eax + 8], 0x736f6e2d
mov dword [eax + 0xc], 0x646e756f
mov dword [eax + 0x10], 0x6766632e
mov byte [eax + 0x14], 0
jmp 0x499738
lea eax, [esp + 0x300]
mov dword [esp + 0xc], str.TomeNET_nosound.cfg
mov dword [esp + 8], 0x1165500
mov dword [esp + 4], 0x800
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x521935
mov dword [esp], eax
call fcn.00445e10
mov esi, dword [esp + 0x14]
mov ebx, eax
test eax, eax
je 0x4997b5
lea esi, [esi]
mov dword [esp + 8], 0x1000
mov dword [esp + 4], esi
mov dword [esp], ebx
call fcn.00445ec0
test eax, eax
jne 0x4997b5
mov dword [esp + 4], esi
mov dword [esp], str.return_get_sound_index___s__
call fcn.00402550
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.004a30d0
cmp eax, 0xffffffff
je 0x499760
imul eax, eax, 0x330
cmp byte [eax + 0x11923ad], 0
je 0x499760
mov byte [eax + 0x11923ac], 1
jmp 0x499760
mov dword [esp], ebx
call fcn.00445e70
cmp byte [0xd67a86], 0
jne 0x499875
mov dword [esp], str.HOMEDRIVE
call sub.msvcrt.dll_getenv
test eax, eax
je 0x499875
mov dword [esp], str.HOMEPATH
call sub.msvcrt.dll_getenv
test eax, eax
je 0x499875
mov dword [esp], str.HOMEDRIVE
mov esi, 0x67
call sub.msvcrt.dll_getenv
mov dword [esp + 4], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
mov dword [esp], str.HOMEPATH
call sub.msvcrt.dll_getenv
mov dword [esp + 4], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strcat
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea ecx, [esp + 0x300]
add eax, ecx
mov dword [eax], 0x6d6f545c
mov dword [eax + 4], 0x54454e65
mov dword [eax + 8], 0x756f732d
mov dword [eax + 0xc], 0x6f76646e
mov dword [eax + 0x10], 0x66632e6c
mov word [eax + 0x14], si
jmp 0x49989c
lea eax, [esp + 0x300]
mov dword [esp + 0xc], str.TomeNET_soundvol.cfg
mov dword [esp + 8], 0x1165500
mov dword [esp + 4], 0x800
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x521935
mov dword [esp], eax
call fcn.00445e10
mov edi, dword [esp + 0x14]
mov esi, eax
test eax, eax
je 0x499936
lea esi, [esi]
mov dword [esp + 8], 0x1000
mov dword [esp + 4], edi
mov dword [esp], esi
call fcn.00445ec0
test eax, eax
jne 0x499936
mov dword [esp + 4], edi
mov dword [esp], str.return_get_sound_index___s__
call fcn.00402550
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.004a30d0
mov dword [esp + 8], 0x1000
mov dword [esp + 4], edi
mov ebx, eax
mov dword [esp], esi
call fcn.00445ec0
test eax, eax
jne 0x499936
cmp ebx, 0xffffffff
je 0x4998c0
imul ebx, ebx, 0x330
cmp byte [ebx + 0x11923ad], 0
je 0x4998c0
mov dword [esp], edi
call sub.msvcrt.dll_atoi
mov byte [ebx + 0x11923ae], al
jmp 0x4998c0
mov dword [esp], esi
call fcn.00445e70
mov eax, dword [0xde84a8]
mov dword [esp + 0xc], 0xd67260
mov dword [esp + 4], 0x800
mov dword [esp + 8], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp], 0x1165100
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcpy
lea eax, [esp + 0x300]
mov dword [esp + 0xc], str.music.cfg
mov dword [esp + 8], 0x1165100
mov dword [esp + 4], 0x800
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x521935
mov dword [esp], eax
call fcn.00445e10
mov dword [esp + 0x1c], eax
test eax, eax
je 0x49a480
mov dword [esp + 0x34], 0
lea esi, [esp + 0x2aa0]
lea esi, [esi]
lea esi, [esi]
mov eax, dword [esp + 0x14]
mov dword [esp + 8], 0x1000
mov dword [esp + 4], eax
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
call fcn.00445ec0
test eax, eax
jne 0x499e16
movzx eax, byte [esp + 0x1aa0]
cmp al, 0x20
je 0x499a18
cmp al, 9
jne 0x49a2a7
mov eax, dword [esp + 0x14]
lea esi, [esi]
movzx edx, byte [eax + 1]
add eax, 1
cmp dl, 0x20
je 0x499a20
cmp dl, 9
je 0x499a20
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_strcpy
lea esi, [esi]
mov eax, dword [esp + 0x14]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov ebx, eax
lea ebp, [eax - 2]
cmp eax, 1
jbe 0x499af0
cmp byte [esp + eax + 0x1a9f], 0x5c
jne 0x499af0
movzx eax, byte [esp + ebp + 0x1aa0]
mov edi, ebx
mov ebx, eax
cmp bl, 0x20
je 0x499a7e
cmp bl, 9
jne 0x499af0
mov dword [esp], esi
call sub.msvcrt.dll_strlen
mov edx, eax
lea eax, [eax + edi]
cmp eax, 0xfff
ja 0x499a74
mov eax, dword [esp + 0x14]
mov byte [esp + ebp + 0x1aa0], 0
mov dword [esp + 8], 0x1000
mov dword [esp + 4], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x18], edx
mov dword [esp], eax
call fcn.00445ec0
test eax, eax
jne 0x499a40
movzx eax, byte [esp + 0x1aa0]
test al, 0xdf
je 0x499ad6
cmp al, 9
mov edx, dword [esp + 0x18]
jne 0x499e08
mov eax, dword [esp + 0x14]
mov dword [esp], esi
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcat
jmp 0x499a40
mov ebx, dword [esp + 0x14]
mov dword [esp + 4], esi
xor edi, edi
mov dword [esp], ebx
call sub.msvcrt.dll_strcpy
movzx eax, byte [esp + 0x1aa0]
cmp al, 0x3b
jne 0x499b22
movzx eax, byte [esp + 0x1aa1]
mov edi, 1
lea ebx, [esp + 0x1aa1]
test al, al
je 0x4999e0
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_isalpha]
test eax, eax
je 0x4999e0
mov dword [esp + 8], 8
mov dword [esp + 4], str.packname
mov dword [esp], ebx
call sub.msvcrt.dll_strncmp
test eax, eax
je 0x4999e0
mov dword [esp + 8], 6
mov dword [esp + 4], str.author
mov dword [esp], ebx
call sub.msvcrt.dll_strncmp
test eax, eax
je 0x4999e0
mov dword [esp + 8], 0xb
mov dword [esp + 4], str.description
mov dword [esp], ebx
call sub.msvcrt.dll_strncmp
test eax, eax
je 0x4999e0
mov dword [esp + 4], 0x3d
mov dword [esp], ebx
call sub.msvcrt.dll_strchr
test eax, eax
je 0x4999e0
mov byte [eax], 0
cmp byte [ebx], 0
mov ebp, eax
jne 0x499bd4
jmp 0x4999e0
mov byte [eax], 0
cmp byte [ebx], 0
je 0x4999e0
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
lea eax, [ebx + eax - 1]
movzx edx, byte [eax]
cmp dl, 9
je 0x499bc8
cmp dl, 0x20
je 0x499bc8
lea eax, [ebp + 1]
cmp byte [ebp + 1], 0
mov edx, ebp
mov dword [esp + 0x18], eax
je 0x4999e0
mov dword [esp + 0x20], ebx
mov ebp, edx
mov ebx, dword [esp + 0x18]
jmp 0x499c1d
mov byte [eax], 0
cmp byte [ebp + 1], 0
je 0x4999e0
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
add eax, ebp
movzx ecx, byte [eax]
cmp cl, 9
sete dl
cmp cl, 0x20
sete cl
or cl, dl
jne 0x499c10
mov edx, ebp
mov eax, edi
mov ecx, 0xc7
mov ebx, dword [esp + 0x20]
mov byte [esp + 0x24], al
lea ebp, [esp + 0xd0]
mov edi, ecx
mov dword [esp + 0x20], edx
jmp 0x499c69
sub edi, 1
jb 0x49a79a
mov dword [esp + 8], edi
mov dword [esp + 4], str.return_get_music_name__d_
mov dword [esp], ebp
call fcn.00498d20
mov dword [esp + 4], ebp
mov dword [esp], 0
call fcn.004a3160
cmp byte [eax], 0
je 0x499c60
mov dword [esp + 4], eax
mov dword [esp], ebx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x499c60
mov edx, dword [esp + 0x20]
mov dword [esp + 0x2c], edi
movzx edi, byte [esp + 0x24]
movzx eax, byte [edx + 1]
cmp al, 0x20
je 0x499cbb
cmp al, 9
jne 0x499cd2
mov edx, dword [esp + 0x18]
movzx eax, byte [edx + 1]
add edx, 1
cmp al, 0x20
je 0x499cbf
cmp al, 9
je 0x499cbf
mov dword [esp + 0x18], edx
test al, al
je 0x4999e0
mov byte [esp + 0x20], 0
cmp al, 0x21
jne 0x499cf7
mov ecx, dword [esp + 0x18]
mov byte [esp + 0x20], 1
movzx eax, byte [ecx + 1]
add ecx, 1
mov dword [esp + 0x18], ecx
mov byte [esp + 0x24], 0
cmp al, 0x2b
jne 0x499d14
mov ecx, dword [esp + 0x18]
mov byte [esp + 0x24], 1
movzx eax, byte [ecx + 1]
add ecx, 1
mov dword [esp + 0x18], ecx
cmp al, 0x22
je 0x49a916
mov eax, dword [esp + 0x18]
mov dword [esp + 4], 0x5219f5
mov dword [esp], eax
call sub.msvcrt.dll_strpbrk
mov ebx, eax
test ebx, ebx
jne 0x49a8a0
mov ecx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x34]
mov byte [esp + 0x30], 0
imul eax, ecx, 0x38c
add eax, 0x1165920
mov dword [esp + 0x28], eax
imul eax, ecx, 0xe3
mov dword [esp + 0x38], eax
mov eax, edi
mov edi, ebx
mov byte [esp + 0x3f], al
mov eax, dword [esp + 0x28]
mov ebx, dword [eax]
cmp ebx, 0x63
jg 0x49a7ea
cmp byte [esp + 0x24], 0
je 0x49a61d
cmp ebp, 0x63
jle 0x49a739
test edi, edi
je 0x49a7ea
movzx eax, byte [edi]
mov byte [esp + 0x20], 0
cmp al, 0x21
jne 0x499dab
mov byte [esp + 0x20], 1
movzx eax, byte [edi + 1]
add edi, 1
mov byte [esp + 0x24], 0
cmp al, 0x2b
jne 0x499dc0
mov byte [esp + 0x24], 1
movzx eax, byte [edi + 1]
add edi, 1
cmp al, 0x22
je 0x49a6fd
mov dword [esp + 4], 0x5219f5
mov dword [esp], edi
call sub.msvcrt.dll_strpbrk
mov dword [esp + 0x18], edi
xor edi, edi
test eax, eax
je 0x499d68
mov byte [eax], 0
lea edi, [eax + 1]
movzx eax, byte [eax + 1]
cmp al, 0x20
je 0x499df8
cmp al, 9
jne 0x499d68
movzx eax, byte [edi + 1]
add edi, 1
cmp al, 0x20
jne 0x499df0
jmp 0x499df8
mov ebx, 0x20
mov word [esi + edx], bx
jmp 0x499ad6
mov ecx, dword [esp + 0x34]
test ecx, ecx
jle 0x499f8e
lea eax, [esp + 0xb00]
mov dword [esp + 0x24], 0
lea esi, [esp + 0xd0]
mov dword [esp + 0x28], eax
lea edi, [esp + 0x44]
mov eax, dword [esp + 0x28]
mov dword [esp], edi
mov ebp, 0xc7
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcpy
jmp 0x499e69
sub ebp, 1
jb 0x49a0ed
mov dword [esp + 8], ebp
mov dword [esp + 4], str.return_get_music_name__d_
mov dword [esp], esi
call fcn.00498d20
mov dword [esp + 4], esi
mov dword [esp], 0
call fcn.004a3160
cmp byte [eax], 0
je 0x499e60
mov dword [esp + 4], eax
mov dword [esp], edi
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x499e60
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + eax*4 + 0x170]
movzx eax, byte [esp + eax + 0x6c]
mov byte [esp + 0x20], al
imul eax, ecx, 0x38c
mov edx, ecx
lea ebx, [eax + 0x1165920]
mov ecx, dword [eax + 0x1165920]
imul eax, ebp, 0x38c
mov ebp, dword [eax + 0x1165920]
cmp ecx, 0x63
jg 0x499f74
test ebp, ebp
jle 0x499f74
imul edx, edx, 0xe3
mov dword [esp + 0x30], esi
mov esi, ebp
mov dword [esp + 0x2c], edx
mov edx, dword [esp + 0x18]
mov ebp, dword [esp + 0x2c]
mov dword [esp + 0x18], eax
jmp 0x499f15
cmp ecx, 0x63
jg 0x499f70
mov eax, dword [esp + 0x18]
cmp byte [eax + edx + 0x1165c44], 0
jne 0x499f69
mov eax, dword [eax + edx*4 + 0x1165ab4]
lea esi, [ebp + ecx]
mov dword [esi*4 + 0x1165ab4], eax
mov eax, dword [esp + 0x18]
mov eax, dword [eax + edx*4 + 0x1165924]
mov byte [ebx + 0x389], 1
mov dword [esi*4 + 0x1165924], eax
movzx eax, byte [esp + 0x20]
mov byte [ebx + ecx + 0x324], al
mov eax, dword [esp + 0x18]
add ecx, 1
mov dword [ebx], ecx
mov esi, dword [eax + 0x1165920]
add edx, 1
cmp edx, esi
jl 0x499f10
mov esi, dword [esp + 0x30]
add dword [esp + 0x24], 1
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x24]
add dword [esp + 0x28], 0x28
cmp eax, ecx
jne 0x499e40
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
call fcn.00445e70
cmp byte [0xd67a86], 0
jne 0x49a049
mov dword [esp], str.HOMEDRIVE
call sub.msvcrt.dll_getenv
test eax, eax
je 0x49a049
mov dword [esp], str.HOMEPATH
call sub.msvcrt.dll_getenv
test eax, eax
je 0x49a049
mov dword [esp], str.HOMEDRIVE
call sub.msvcrt.dll_getenv
mov dword [esp + 4], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
mov dword [esp], str.HOMEPATH
call sub.msvcrt.dll_getenv
mov dword [esp + 4], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strcat
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea ecx, [esp + 0x300]
add eax, ecx
mov dword [eax], 0x6d6f545c
mov dword [eax + 4], 0x54454e65
mov dword [eax + 8], 0x6d6f6e2d
mov dword [eax + 0xc], 0x63697375
mov dword [eax + 0x10], 0x6766632e
mov byte [eax + 0x14], 0
jmp 0x49a070
lea eax, [esp + 0x300]
mov dword [esp + 0xc], str.TomeNET_nomusic.cfg
mov dword [esp + 8], 0x1165100
mov dword [esp + 4], 0x800
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x521935
mov dword [esp], eax
call fcn.00445e10
mov esi, dword [esp + 0x14]
mov ebx, eax
test eax, eax
je 0x49a113
lea esi, [esi]
mov dword [esp + 8], 0x1000
mov dword [esp + 4], esi
mov dword [esp], ebx
call fcn.00445ec0
test eax, eax
jne 0x49a113
mov dword [esp + 4], esi
mov dword [esp], str.return_get_music_index___s__
call fcn.00402550
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.004a30d0
cmp eax, 0xffffffff
je 0x49a098
imul eax, eax, 0x38c
cmp byte [eax + 0x1165ca9], 0
je 0x49a098
mov byte [eax + 0x1165ca8], 1
jmp 0x49a098
mov dword [esp], 2
call dword [0x503f4c]
mov dword [esp + 8], edi
mov dword [esp + 4], str.Referenced_music_event__s_not_in_audio.lua_n
mov dword [esp], eax
call fcn.00498b90
jmp 0x499f74
cmp byte [0xd67a86], 0
jne 0x49a1cb
mov dword [esp], str.HOMEDRIVE
call sub.msvcrt.dll_getenv
test eax, eax
je 0x49a1cb
mov dword [esp], str.HOMEPATH
call sub.msvcrt.dll_getenv
test eax, eax
je 0x49a1cb
mov dword [esp], str.HOMEDRIVE
call sub.msvcrt.dll_getenv
mov dword [esp + 4], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
mov dword [esp], str.HOMEPATH
call sub.msvcrt.dll_getenv
mov dword [esp + 4], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strcat
lea eax, [esp + 0x300]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea ecx, [esp + 0x300]
mov edx, 0x67
add eax, ecx
mov dword [eax], 0x6d6f545c
mov dword [eax + 4], 0x54454e65
mov dword [eax + 8], 0x73756d2d
mov dword [eax + 0xc], 0x6f766369
mov dword [eax + 0x10], 0x66632e6c
mov word [eax + 0x14], dx
jmp 0x49a1f2
lea eax, [esp + 0x300]
mov dword [esp + 0xc], str.TomeNET_musicvol.cfg
mov dword [esp + 8], 0x1165100
mov dword [esp + 4], 0x800
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x521935
mov dword [esp], eax
call fcn.00445e10
mov edi, dword [esp + 0x14]
mov esi, eax
test eax, eax
je 0x49a28e
lea esi, [esi]
nop
mov dword [esp + 8], 0x1000
mov dword [esp + 4], edi
mov dword [esp], esi
call fcn.00445ec0
test eax, eax
jne 0x49a28e
mov dword [esp + 4], edi
mov dword [esp], str.return_get_music_index___s__
call fcn.00402550
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.004a30d0
mov dword [esp + 8], 0x1000
mov dword [esp + 4], edi
mov ebx, eax
mov dword [esp], esi
call fcn.00445ec0
test eax, eax
jne 0x49a28e
cmp ebx, 0xffffffff
je 0x49a218
imul ebx, ebx, 0x38c
cmp byte [ebx + 0x1165ca9], 0
je 0x49a218
mov dword [esp], edi
call sub.msvcrt.dll_atoi
mov byte [ebx + 0x1165caa], al
jmp 0x49a218
mov eax, 1
add esp, 0x3aac
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x14]
jmp 0x499231
mov eax, dword [esp + 0x14]
jmp 0x499a31
cmp ebx, 0xbb80
jle 0x499089
mov dword [esp], 0x10
mov ebx, 0xbb80
mov dword [0x503514], 0xbb80
call sub.SDL2.dll_SDL_Init
test eax, eax
jns 0x49909d
call sub.SDL2.dll_SDL_GetError
mov dword [esp], str.Couldnt_initialize_SDL:__s
mov dword [esp + 4], eax
call fcn.00402570
xor eax, eax
jmp 0x49a293
cmp eax, 3
jg 0x499102
mov dword [0x503510], 4
mov eax, 4
jmp 0x499102
call sub.SDL2.dll_SDL_GetError
mov dword [esp], str.Couldnt_open_mixer:__s
mov dword [esp + 4], eax
call fcn.00402570
xor eax, eax
jmp 0x49a293
lea eax, [esp + 0x300]
mov dword [esp + 0xc], str.sound.cfg.default
mov dword [esp + 8], 0x1165500
mov dword [esp + 4], 0x800
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x521935
mov dword [esp], eax
call fcn.00445e10
mov ebx, eax
test eax, eax
je 0x49a843
lea esi, [esp + 0x2aa0]
mov dword [esp + 0xc], str.sound.cfg
mov dword [esp + 8], 0x1165500
mov dword [esp + 4], 0x800
mov dword [esp], esi
call fcn.00404e10
mov dword [esp + 4], 0x52197d
mov dword [esp], esi
call fcn.00445e10
mov edi, eax
lea eax, [esp + 0x1aa0]
mov dword [esp + 0x14], eax
test edi, edi
je 0x49a875
mov esi, eax
jmp 0x49a3dd
mov dword [esp + 8], esi
mov dword [esp + 4], 0x5219aa
mov dword [esp], edi
call fcn.00498b90
mov dword [esp + 8], 4
mov dword [esp + 4], esi
mov dword [esp], ebx
call fcn.00445ec0
test eax, eax
je 0x49a3c9
mov dword [esp], edi
call fcn.00445e70
mov dword [esp], ebx
call fcn.00445e70
lea eax, [esp + 0x300]
mov dword [esp + 0xc], str.sound.cfg
mov dword [esp + 8], 0x1165500
mov dword [esp + 4], 0x800
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x521935
mov dword [esp], eax
call fcn.00445e10
mov ecx, eax
test eax, eax
jne 0x4991d8
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp], str.Failed_to_open_sound_config___s_:_n_____s
mov dword [esp + 8], eax
lea eax, [esp + 0x300]
mov dword [esp + 4], eax
call fcn.00402570
xor eax, eax
jmp 0x49a293
lea eax, [esp + 0x300]
mov dword [esp + 0xc], str.music.cfg.default
mov dword [esp + 8], 0x1165100
mov dword [esp + 4], 0x800
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x521935
mov dword [esp], eax
call fcn.00445e10
mov ebx, eax
test eax, eax
je 0x49a811
lea esi, [esp + 0xb00]
mov dword [esp + 0xc], str.music.cfg
mov dword [esp + 8], 0x1165100
mov dword [esp + 4], 0x800
mov dword [esp], esi
call fcn.00404e10
mov dword [esp + 4], 0x52197d
mov dword [esp], esi
call fcn.00445e10
mov edi, eax
test eax, eax
je 0x49a956
mov esi, dword [esp + 0x14]
jmp 0x49a523
mov dword [esp + 8], esi
mov dword [esp + 4], 0x5219aa
mov dword [esp], edi
call fcn.00498b90
mov dword [esp + 8], 4
mov dword [esp + 4], esi
mov dword [esp], ebx
call fcn.00445ec0
test eax, eax
je 0x49a50f
mov dword [esp], edi
call fcn.00445e70
mov dword [esp], ebx
call fcn.00445e70
lea eax, [esp + 0x300]
mov dword [esp + 0xc], str.music.cfg
mov dword [esp + 8], 0x1165100
mov dword [esp + 4], 0x800
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x521935
mov dword [esp], eax
call fcn.00445e10
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x4999c7
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp], str.Failed_to_open_music_config___s_:_n_____s
mov dword [esp + 8], eax
lea eax, [esp + 0x300]
mov dword [esp + 4], eax
call fcn.00402570
xor eax, eax
jmp 0x49a293
mov dword [esp], 2
call dword [0x503f4c]
mov ecx, dword [esp + 0x1c]
mov dword [esp + 4], str.Cant_find_sample__s_n
mov dword [esp], eax
mov dword [esp + 8], ecx
call fcn.00498b90
jmp 0x4995f5
cmp byte [esp + 0x18], 0
mov esi, dword [esp + 0x28]
je 0x4991e0
imul eax, dword [esp + 0x20], 0x330
mov byte [eax + 0x11923ac], 1
jmp 0x4991e0
mov eax, dword [esp + 0x18]
mov dword [esp + 8], 0x1165100
mov dword [esp + 4], 0x800
mov dword [esp + 0xc], eax
lea eax, [esp + 0x300]
mov dword [esp], eax
call fcn.00404e10
lea eax, [esp + 0x300]
mov dword [esp + 4], 0x5218f4
mov dword [esp], eax
call sub.msvcrt.dll_fopen
test eax, eax
je 0x49a770
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov ecx, dword [esp + 0x28]
movzx eax, byte [esp + 0x20]
mov byte [ecx + ebx + 0x324], al
lea eax, [esp + 0x300]
mov dword [esp], eax
call fcn.00401bb0
mov ecx, eax
mov eax, dword [esp + 0x38]
lea eax, [ebx + eax + 0x64]
mov dword [eax*4 + 0x1165924], ecx
mov ecx, dword [esp + 0x28]
add dword [ecx], 1
cmp byte [esp + 0x30], 0
jne 0x49a6b7
add dword [0xdc8464], 1
mov byte [ecx + 0x389], 1
mov byte [esp + 0x30], 1
jmp 0x499d8b
lea eax, [ebp + 1]
mov dword [esp + 4], 0x22
mov dword [esp], eax
mov dword [esp + 0x1c], eax
call sub.msvcrt.dll_strchr
mov ebp, eax
test eax, eax
je 0x499556
lea edx, [eax + 1]
mov byte [eax], 0
mov dword [esp + 4], 0x5219f5
mov dword [esp], edx
call sub.msvcrt.dll_strpbrk
jmp 0x49961b
lea eax, [edi + 1]
mov dword [esp + 4], 0x22
mov dword [esp], eax
mov dword [esp + 0x18], eax
call sub.msvcrt.dll_strchr
mov edi, eax
test eax, eax
je 0x499d68
lea edx, [eax + 1]
mov byte [eax], 0
mov dword [esp + 4], 0x5219f5
mov dword [esp], edx
call sub.msvcrt.dll_strpbrk
jmp 0x499ddc
mov eax, dword [esp + 0x2c]
mov dword [esp + ebp*4 + 0x170], eax
movzx eax, byte [esp + 0x20]
mov byte [esp + ebp + 0x6c], al
mov eax, dword [esp + 0x18]
mov dword [esp + 4], eax
lea eax, [ebp + ebp*4]
add ebp, 1
lea eax, [esp + eax*8 + 0xb00]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
jmp 0x499d8b
mov dword [esp], 2
call dword [0x503f4c]
mov ecx, dword [esp + 0x18]
mov dword [esp + 4], str.Cant_find_song__s_n
mov dword [esp], eax
mov dword [esp + 8], ecx
call fcn.00498b90
jmp 0x499d8b
mov dword [esp], 2
call dword [0x503f4c]
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Music_event__s_not_in_audio.lua_n
mov dword [esp], eax
call fcn.00498b90
jmp 0x4999e0
mov dword [esp], 2
mov esi, dword [esp + 0x24]
call dword [0x503f4c]
mov dword [esp + 8], edi
mov dword [esp + 4], str.Sound_effect__s_not_in_audio.lua_n
mov dword [esp], eax
call fcn.00498b90
jmp 0x4991e0
movzx edi, byte [esp + 0x3f]
mov dword [esp + 0x34], ebp
mov eax, edi
test al, al
je 0x4999e0
imul eax, dword [esp + 0x2c], 0x38c
mov byte [eax + 0x1165ca8], 1
jmp 0x4999e0
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp], str.Failed_to_open_default_music_config___s_:_n_____s
mov dword [esp + 8], eax
lea eax, [esp + 0x300]
mov dword [esp + 4], eax
call fcn.00402570
xor eax, eax
jmp 0x49a293
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp], str.Failed_to_open_default_sound_config___s_:_n_____s
mov dword [esp + 8], eax
lea eax, [esp + 0x300]
mov dword [esp + 4], eax
call fcn.00402570
xor eax, eax
jmp 0x49a293
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp + 4], esi
mov dword [esp + 8], eax
mov dword [esp], str.Failed_to_write_sound_config___s_:_n_____s
call fcn.00402570
xor eax, eax
jmp 0x49a293
movzx edx, byte [ebx + 1]
mov byte [ebx], 0
lea eax, [ebx + 1]
cmp dl, 9
je 0x49a8b4
cmp dl, 0x20
jne 0x49a8c5
movzx edx, byte [eax + 1]
add eax, 1
cmp dl, 0x20
je 0x49a8b4
cmp dl, 9
je 0x49a8b4
mov ebx, eax
jmp 0x499d3a
add dword [esp + 0x1c], 1
mov eax, dword [esp + 0x1c]
mov dword [esp + 4], 0x22
mov dword [esp], eax
call sub.msvcrt.dll_strchr
movzx ecx, byte [esp + 0x24]
test eax, eax
mov ebp, eax
je 0x499536
add ebp, 1
mov byte [eax], 0
mov dword [esp], ebp
mov dword [esp + 4], 0x5219f5
call sub.msvcrt.dll_strpbrk
movzx ecx, byte [esp + 0x24]
mov ebp, eax
jmp 0x499512
add dword [esp + 0x18], 1
mov eax, dword [esp + 0x18]
mov dword [esp + 4], 0x22
mov dword [esp], eax
call sub.msvcrt.dll_strchr
mov ebx, eax
test eax, eax
je 0x499d3a
lea edx, [eax + 1]
mov byte [eax], 0
mov dword [esp + 4], 0x5219f5
mov dword [esp], edx
call sub.msvcrt.dll_strpbrk
mov ebx, eax
jmp 0x499d32
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp + 4], esi
mov dword [esp + 8], eax
mov dword [esp], str.Failed_to_write_music_config___s_:_n_____s
call fcn.00402570
xor eax, eax
jmp 0x49a293