Function at 0x436070
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34
push ebx
push esi
push edi
push 0x14c8
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 0x436611
mov al, byte [ebp + 0x14]
test al, 1
mov dword [esi + 0x4b0], ebx
mov dword [esi + 0x4b4], 0xbff00000
mov dword [esi + 0x10c], ebx
jne 0x4362e0
test al, 4
mov eax, dword [ebp + 0x10]
je 0x43611b
mov dword [esi + 0x10c], 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 + 0x10c]
push 0x2c
push edi
push eax
mov dword [esp + 0x24], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x436158
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GlobalFree]
call edi
mov ecx, dword [esi + 0x10c]
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 0x436611
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 + 0x10c], eax
jne 0x4360c8
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.00435f50
add esp, 8
test eax, eax
jne 0x436196
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GlobalFree]
call edi
mov eax, dword [esi + 0x10c]
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
mov edx, dword [esi + 0x10c]
push 1
push ebx
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esi + 0x110], eax
jne 0x4361db
mov eax, dword [esi + 0x10c]
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
cmp dword [esi + 0x1c4], ebx
je 0x436271
mov edx, dword [esi + 0x4a4]
mov eax, dword [esi + 0x10c]
push 1
push ebx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esi + 0x10c]
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 0x436241
mov eax, dword [esi + 0x10c]
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 eax, dword [esi + 0x110]
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], ebx
fild qword [esp + 0x14]
push ebx
push ebx
push eax
fmul qword [0x458498]
fstp qword [esi + 0x4b0]
mov ecx, dword [esi + 0x10c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp dword [esi + 0x1c4], ebx
mov eax, dword [esi + 0x110]
mov dword [esi + 0x114], eax
je 0x4362cc
mov edi, dword [esi + 0x4a4]
mov edx, dword [esi + 0x4b0]
add edi, eax
cmp edx, ebx
mov dword [esi + 0x4a4], edi
mov ecx, edi
jne 0x4362cc
cmp dword [esi + 0x4b4], 0xbff00000
jne 0x4362cc
mov ecx, dword [ecx]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], ebx
fild qword [esp + 0x14]
fmul qword [0x458498]
fstp qword [esi + 0x4b0]
mov cl, byte [ebp + 0x14]
mov edx, 2
test dl, cl
je 0x436305
mov dword [esi + 0x118], eax
jmp 0x43630b
mov edx, dword [ebp + 0x10]
push edx
push esi
call fcn.00435f50
add esp, 8
test eax, eax
jne 0x436278
mov eax, dword [edi]
push eax
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 dword [esi + 0x118], ebx
lea ecx, [esi + 0x148]
lea eax, [esi + 0x178]
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 0x436317
mov edx, dword [esi + 0xfc]
xor ecx, ecx
mov cx, word [esi + 0x104]
mov dword [esi + 0x1a0], edx
mov dword [esi + 0xd0], 0x64
mov dword [esi + 0xe8], 1
mov dword [esi + 0x198], ebx
mov dword [esi + 0x19c], ebx
mov dword [esi + 0x1a8], ebx
mov eax, ecx
imul eax, edx
mov dword [esi + 0x1ac], ebx
mov dword [esi + 0x1b0], ebx
mov dword [esi + 0x1b8], ebx
mov dword [esi + 0xec], ebx
mov dword [esi + 0x30], ebx
mov dword [esi + 0x4c0], ebx
imul eax, dword [0x47362c]
xor edx, edx
mov dword [esi + 0x24], eax
div dword [0x473628]
xor edx, edx
mov edi, eax
div ecx
mov dword [esi + 0x24], edi
cmp edx, ebx
je 0x4363c9
sub edi, edx
add edi, ecx
mov dword [esi + 0x24], edi
cmp dword [esi + 0x1c4], ebx
je 0x4364f7
sub esp, 0x10
mov edi, esp
mov eax, 0x437150
mov dword [edi], eax
mov ecx, 0x437220
mov dword [edi + 4], ecx
mov edx, 0x4372a0
mov dword [edi + 8], edx
mov eax, 0x4372b0
mov dword [esi + 0x4a8], ebx
mov dword [edi + 0xc], eax
mov edi, dword [ebp + 8]
mov dword [esi + 0x4ac], ebx
mov edx, dword [edi]
push ebx
push ebx
add edx, 0x1d0
push edx
push edi
call fcn.00454dd0
add esp, 0x20
test eax, eax
jge 0x436434
mov eax, dword [edi]
push eax
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 ecx, dword [edi]
add ecx, 0x1d0
push 0xffffffffffffffff
push ecx
call fcn.00456b20
add esp, 8
cmp eax, ebx
mov dword [esi + 0x4a0], eax
jne 0x436474
mov edx, dword [edi]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
add esi, 0x1d0
push esi
mov dword [edi], ebx
call fcn.00454cd0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x24]
shl eax, 1
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
cmp eax, ebx
mov dword [esi + 0x4c0], eax
jne 0x4364af
mov ecx, dword [edi]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
add esi, 0x1d0
push esi
mov dword [edi], ebx
call fcn.00454cd0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [esi + 0x4a4]
mov eax, dword [edx + 4]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ebx
fild qword [esp + 0x14]
sub esp, 8
lea edi, [esi + 0x1d0]
fmul qword [0x458498]
fstp qword [esp]
push edi
call fcn.00456a00
push edi
call fcn.00456b00
xor ecx, ecx
mov cx, word [esi + 0x104]
add esp, 0x10
imul eax, ecx
mov dword [esi + 0x4bc], eax
cmp dword [esi + 0xf4], ebx
je 0x436533
mov eax, dword [esi + 0x24]
xor ecx, ecx
mov cx, word [esi + 0xfa]
xor edx, edx
lea edi, [ecx*8]
sub edi, ecx
shl edi, 3
div edi
mov dword [esi + 0x1a4], eax
imul eax, ecx
lea edx, [eax*8]
sub edx, eax
shl edx, 3
mov dword [esi + 0x24], edx
mov eax, dword [esi + 0x24]
imul eax, dword [0x473628]
mov dword [esi + 0x28], eax
xor eax, eax
mov ecx, 9
lea edi, [esp + 0x1c]
rep stosd dword es:[edi], eax
mov al, byte [ebp + 0x14]
test al, 8
mov dword [esp + 0x1c], 0x24
mov dword [esp + 0x20], 0x101e0
je 0x43656c
mov dword [esp + 0x20], 0x181e0
test al, 0x10
je 0x436575
or dword [esp + 0x20], 8
mov ecx, dword [esi + 0x28]
lea edx, [esi + 0xf8]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x2c], edx
cmp dword [esi], ebx
je 0x436594
lea eax, [esi + 4]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
push ebx
lea edi, [esi + 0x1c]
push edi
lea edx, [esp + 0x24]
push edx
push eax
call dword [ecx + 0xc]
test eax, eax
je 0x4365c1
cmp dword [esi], ebx
je 0x4365b9
lea eax, [esi + 4]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edi, dword [ebp + 8]
mov ecx, dword [edi]
push ecx
jmp 0x4365f8
test byte [ebp + 0x14], 0x20
je 0x4365ce
mov dword [esi + 0x20], ebx
xor edi, edi
jmp 0x4365e0
mov eax, dword [edi]
mov edx, dword [eax]
lea ecx, [esi + 0x20]
push ecx
push 0x45b348
push eax
call dword [edx]
mov edi, eax
cmp dword [esi], ebx
je 0x4365ee
lea edx, [esi + 4]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp edi, ebx
je 0x43661a
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 + 0x4c0]
cmp esi, ebx
je 0x436611
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 + 0x1c0], ecx
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret