Function at 0x477b20
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34
push ebx
push esi
push edi
push 0x14e8
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, dword [ebp + 8]
mov esi, eax
xor ebx, ebx
cmp esi, ebx
mov dword [edi], esi
je 0x47843e
mov al, byte [ebp + 0x14]
test al, 1
mov dword [esi + 0x4d0], ebx
mov dword [esi + 0x4d4], 0xbff00000
mov dword [esi + 0x110], ebx
mov dword [esp + 0xc], ebx
jne 0x477d91
test al, 4
mov eax, dword [ebp + 0x10]
je 0x477bcf
mov dword [esi + 0x110], eax
push 0x2c
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push ebx
lea edx, [esp + 0x14]
push edx
mov edi, eax
mov eax, dword [esi + 0x110]
push 0x2c
push edi
push eax
mov dword [esp + 0x24], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x477c0c
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GlobalFree]
call edi
mov ecx, dword [esi + 0x110]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp + 8]
mov edx, dword [esi]
push edx
call edi
mov dword [esi], ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [eax], bl
je 0x47843e
push ebx
push 0x80
push 3
push ebx
push ebx
push DirectSoundCreate
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi + 0x110], eax
jne 0x477b7c
mov ecx, dword [edi]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [edi], ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
push esi
mov dword [edi + 4], 0x2c
call fcn.004778c0
add esp, 8
test eax, eax
jne 0x477c4a
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GlobalFree]
call edi
mov eax, dword [esi + 0x110]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp + 8]
mov ecx, dword [esi]
push ecx
call edi
mov dword [esi], ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esi + 0x124], ebx
je 0x477d38
mov edx, dword [esi + 0x110]
push 1
push ebx
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esi + 0x114], eax
jne 0x477c9b
mov eax, dword [esi + 0x110]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call esi
mov edi, dword [ebp + 8]
mov ecx, dword [edi]
push ecx
call esi
mov dword [edi], ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [esi + 0x4b8]
mov eax, dword [esi + 0x110]
push 1
push ebx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esi + 0x110]
push ebx
lea ecx, [esp + 0x14]
push ecx
push 8
push edi
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x477cf5
mov eax, dword [esi + 0x110]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call esi
mov edi, dword [ebp + 8]
mov ecx, dword [edi]
push ecx
call esi
mov dword [edi], ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [edi]
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], ebx
fild qword [esp + 0x14]
push ebx
push ebx
fmul qword [0x4a1558]
fstp qword [esi + 0x4d0]
mov ecx, dword [esi + 0x114]
mov edx, dword [esi + 0x110]
mov eax, dword [edi + 4]
push ecx
push edx
mov dword [esp + 0x1c], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov edi, dword [ebp + 8]
jmp 0x477db6
mov eax, dword [esi + 0x110]
push 2
push ebx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
push ebx
mov dword [esi + 0x4b8], eax
mov ecx, dword [esi + 0x110]
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [esi + 0x4b8], 0xffffffff
jne 0x477d2c
mov edx, dword [esi + 0x110]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call esi
mov edi, dword [ebp + 8]
mov eax, dword [edi]
push eax
call esi
mov dword [edi], ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x10]
push ecx
push esi
call fcn.004778c0
add esp, 8
test eax, eax
jne 0x477db6
mov edx, dword [edi]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [edi], ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [esi + 4]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov dword [esi], 1
mov eax, dword [esi + 0x114]
mov dword [esi + 0x118], eax
mov ecx, dword [esi + 0x124]
mov dword [esi + 0x4dc], ecx
cmp dword [esi + 0x124], ebx
je 0x477e37
mov edx, dword [esi + 0x114]
mov eax, dword [esi + 0x4b8]
mov ecx, dword [esp + 0xc]
add eax, edx
cmp ecx, ebx
mov dword [esi + 0x4b8], eax
jne 0x477e09
mov ecx, dword [eax + 4]
mov dword [esp + 0xc], ecx
cmp dword [esi + 0x4d0], ebx
jne 0x477e37
cmp dword [esi + 0x4d4], 0xbff00000
jne 0x477e37
mov edx, dword [eax]
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], ebx
fild qword [esp + 0x14]
fmul qword [0x4a1558]
fstp qword [esi + 0x4d0]
lea ecx, [esi + 0x144]
lea eax, [esi + 0x178]
mov edx, 2
mov dword [eax + 0x10], ebx
mov dword [eax + 0x14], ebx
mov dword [eax], ebx
mov dword [eax + 4], ebx
mov dword [eax - 0x10], ebx
mov dword [eax - 0xc], ebx
mov dword [eax - 0x20], ebx
mov dword [eax - 0x1c], ebx
mov dword [ecx + 8], ebx
mov dword [ecx], ebx
mov dword [ecx - 8], ebx
mov dword [ecx - 0x10], ebx
add eax, 8
add ecx, 4
dec edx
jne 0x477e48
mov edx, dword [esi + 0x100]
mov dword [esi + 0xd4], 0x64
mov dword [esi + 0xec], 1
cmp dword [esi + 0x124], ebx
mov dword [esi + 0x198], ebx
mov dword [esi + 0x19c], ebx
mov dword [esi + 0x1a0], edx
mov dword [esi + 0x1a8], ebx
mov dword [esi + 0x1ac], ebx
mov dword [esi + 0x1b0], ebx
mov dword [esi + 0x1b4], ebx
mov dword [esi + 0x1b8], ebx
mov dword [esi + 0x1bc], ebx
mov dword [esi + 0x1c4], ebx
mov dword [esi + 0xf0], ebx
mov dword [esi + 0x30], ebx
mov dword [esi + 0x4e0], ebx
je 0x477f17
xor ecx, ecx
mov cx, word [esi + 0x108]
mov eax, ecx
imul eax, edx
imul eax, dword [0x4e719c]
xor edx, edx
mov dword [esi + 0x24], eax
div dword [0x4e7198]
xor edx, edx
mov edi, eax
div ecx
mov dword [esi + 0x24], edi
cmp edx, ebx
je 0x477f14
sub ecx, edx
add ecx, edi
mov dword [esi + 0x24], ecx
mov edi, dword [ebp + 8]
cmp dword [esi + 0x1d4], ebx
je 0x4782a8
sub esp, 0x10
mov edx, esp
mov eax, 0x478fe0
mov dword [edx], eax
mov ecx, 0x4790b0
mov dword [edx + 4], ecx
mov eax, fcn.00479130
mov dword [edx + 8], eax
mov dword [esi + 0x4c0], ebx
mov eax, 0x479140
mov dword [edx + 0xc], eax
mov dword [esi + 0x4c4], ebx
mov eax, dword [edi]
push ebx
push ebx
add eax, 0x1e0
push eax
push edi
call fcn.0049cd70
add esp, 0x20
test eax, eax
jge 0x477f7e
mov ecx, dword [edi]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [edi], ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [edi]
add edx, 0x1e0
push 0xffffffffffffffff
push edx
call fcn.0049f420
add esp, 8
cmp eax, ebx
mov dword [esi + 0x4b0], eax
je 0x478279
cmp dword [esi + 0x124], ebx
jne 0x478261
lea eax, [esi + 0x1e0]
push 0xffffffffffffffff
push eax
call fcn.0049f460
mov edi, dword [eax]
mov ecx, dword [esi + 0x4b0]
mov eax, dword [ecx + 4]
shl eax, 4
cdq
and edx, 7
add eax, edx
sar eax, 3
mov word [esi + 0x108], ax
lea eax, [esi + 0x1e0]
push 0xffffffffffffffff
push eax
call fcn.0049de80
xor edx, edx
mov dx, word [esi + 0x108]
add esp, 0x10
mov dword [esp + 0x10], ebx
imul eax, edx
mov dword [esi + 0x4dc], eax
mov eax, dword [edi]
cmp eax, ebx
je 0x4781be
push str.LoopStart
push eax
call fcn.0044f530
add esp, 8
cmp eax, ebx
je 0x47803f
add eax, 0xa
push eax
call fcn.0045a8ec
mov dword [esp + 0x18], eax
fild dword [esp + 0x18]
add esp, 4
fmul qword [0x4a1558]
fstp qword [esi + 0x4d0]
jmp 0x4781b0
mov eax, dword [edi]
push str.LOOPSTART
push eax
call fcn.0044f530
add esp, 8
cmp eax, ebx
je 0x478088
add eax, 0xa
push eax
call fcn.0045a8ec
push ebx
push eax
mov dword [esp + 0x1c], eax
lea eax, [esi + 0x1e0]
push eax
call fcn.0049eb40
lea eax, [esi + 0x1e0]
push eax
call fcn.0049f340
fstp qword [esi + 0x4d0]
add esp, 0x14
jmp 0x4781b0
mov ecx, dword [edi]
push str.LoopEnd
push ecx
call fcn.0044f530
add esp, 8
cmp eax, ebx
je 0x4780e9
add eax, 8
push eax
call fcn.0045a8ec
mov dword [esp + 0x18], eax
fild dword [esp + 0x18]
push ecx
lea eax, [esi + 0x1e0]
fmul qword [0x4a1558]
fstp qword [esp]
push eax
call fcn.0049f230
lea eax, [esi + 0x1e0]
push eax
call fcn.0049f320
xor edx, edx
mov dx, word [esi + 0x108]
add esp, 0x10
imul eax, edx
mov dword [esi + 0x4dc], eax
jmp 0x4781b0
mov eax, dword [edi]
push str.LOOPEND
push eax
call fcn.0044f530
add esp, 8
cmp eax, ebx
je 0x478138
add eax, 8
push eax
call fcn.0045a8ec
cdq
push edx
push eax
lea eax, [esi + 0x1e0]
push eax
call fcn.0049eb40
lea eax, [esi + 0x1e0]
push eax
call fcn.0049f320
xor ecx, ecx
mov cx, word [esi + 0x108]
add esp, 0x14
imul eax, ecx
mov dword [esi + 0x4dc], eax
jmp 0x4781b0
mov edx, dword [edi]
push str.LOOPLENGTH
push edx
call fcn.0044f530
add esp, 8
cmp eax, ebx
je 0x47818a
add eax, 0xb
push eax
call fcn.0045a8ec
add eax, dword [esp + 0x14]
push ebx
push eax
lea eax, [esi + 0x1e0]
push eax
call fcn.0049eb40
lea eax, [esi + 0x1e0]
push eax
call fcn.0049f320
xor ecx, ecx
mov cx, word [esi + 0x108]
add esp, 0x14
imul eax, ecx
mov dword [esi + 0x4dc], eax
jmp 0x4781b0
mov edx, dword [edi]
push str.LoopCount
push edx
call fcn.0044f530
add esp, 8
cmp eax, ebx
je 0x4781b0
add eax, 0xa
push eax
call fcn.0045a8ec
add esp, 4
mov dword [esi + 0x1bc], eax
mov eax, dword [edi + 4]
add edi, 4
cmp eax, ebx
jne 0x478008
mov eax, dword [esi + 0x4b0]
mov word [esi + 0xfc], 1
mov cx, word [eax + 4]
mov word [esi + 0xfe], cx
xor ecx, ecx
mov cx, word [esi + 0x108]
mov word [esi + 0x10a], 0x10
mov edx, dword [eax + 8]
mov dword [esi + 0x100], edx
mov word [esi + 0x10c], bx
push 0xffffffffffffffff
xor edi, edi
imul ecx, dword [eax + 8]
mov di, word [esi + 0x108]
lea eax, [esi + 0x1e0]
push eax
mov dword [esi + 0x104], ecx
call fcn.0049de80
imul eax, edi
mov ecx, dword [esi + 0x100]
mov dword [esi + 0x124], eax
mov eax, edi
imul eax, ecx
mov dword [esi + 0x1a0], ecx
imul eax, dword [0x4e719c]
xor edx, edx
mov dword [esi + 0x24], eax
div dword [0x4e7198]
xor edx, edx
add esp, 8
mov ecx, eax
div edi
mov dword [esi + 0x24], ecx
cmp edx, ebx
je 0x47825e
sub edi, edx
add edi, ecx
mov dword [esi + 0x24], edi
mov edi, dword [ebp + 8]
mov edx, dword [esi + 0x24]
shl edx, 1
push edx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
cmp eax, ebx
mov dword [esi + 0x4e0], eax
jne 0x47829c
mov eax, dword [edi]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
add esi, 0x1e0
push esi
mov dword [edi], ebx
call fcn.0049cc70
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x4c8], ebx
mov dword [esi + 0x4cc], ebx
mov eax, dword [esp + 0xc]
cmp eax, ebx
je 0x478324
cmp dword [esi + 0x1d4], ebx
je 0x4782f3
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ebx
fild qword [esp + 0x14]
sub esp, 8
lea edi, [esi + 0x1e0]
fmul qword [0x4a1558]
fstp qword [esp]
push edi
call fcn.0049f230
push edi
call fcn.0049f320
xor ecx, ecx
mov cx, word [esi + 0x108]
add esp, 0x10
imul eax, ecx
jmp 0x47831e
mov edx, dword [esi + 0x104]
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], ebx
fild qword [esp + 0x14]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ebx
fild qword [esp + 0x14]
fmulp st(1)
fmul qword [0x4a1558]
call fcn.00408160
mov dword [esi + 0x4dc], eax
cmp dword [esi + 0xf8], ebx
je 0x478360
mov eax, dword [esi + 0x24]
xor ecx, ecx
mov cx, word [esi + 0xfe]
xor edx, edx
lea edi, [ecx*8]
sub edi, ecx
shl edi, 3
div edi
mov dword [esi + 0x1a4], eax
imul eax, ecx
lea ecx, [eax*8]
sub ecx, eax
shl ecx, 3
mov dword [esi + 0x24], ecx
mov edx, dword [esi + 0x24]
imul edx, dword [0x4e7198]
xor eax, eax
mov dword [esi + 0x28], edx
mov ecx, 9
lea edi, [esp + 0x1c]
rep stosd dword es:[edi], eax
mov al, byte [ebp + 0x14]
test al, 8
mov ecx, 0x181e0
mov dword [esp + 0x1c], 0x24
mov dword [esp + 0x20], ecx
je 0x478396
mov dword [esp + 0x20], ecx
test al, 0x10
je 0x4783a2
mov dword [esp + 0x20], 0x181e8
mov eax, dword [esi + 0x28]
lea ecx, [esi + 0xfc]
mov dword [esp + 0x24], eax
mov dword [esp + 0x2c], ecx
cmp dword [esi], ebx
je 0x4783c1
lea eax, [esi + 4]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp + 0xc]
mov edx, dword [eax]
push ebx
lea edi, [esi + 0x1c]
push edi
lea ecx, [esp + 0x24]
push ecx
push eax
call dword [edx + 0xc]
test eax, eax
je 0x4783ee
cmp dword [esi], ebx
je 0x4783e6
lea eax, [esi + 4]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edi, dword [ebp + 8]
mov edx, dword [edi]
push edx
jmp 0x478425
test byte [ebp + 0x14], 0x20
je 0x4783fb
mov dword [esi + 0x20], ebx
xor edi, edi
jmp 0x47840d
mov eax, dword [edi]
mov ecx, dword [eax]
lea edx, [esi + 0x20]
push edx
push 0x4a89f0
push eax
call dword [ecx]
mov edi, eax
cmp dword [esi], ebx
je 0x47841b
lea eax, [esi + 4]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp edi, ebx
je 0x478447
mov edi, dword [ebp + 8]
mov eax, dword [edi]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [edi], ebx
mov esi, dword [esi + 0x4e0]
cmp esi, ebx
je 0x47843e
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x18]
pop edi
mov dword [esi + 0x1cc], ecx
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret