Function at 0x10008140
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14c
mov eax, dword [0x1001a004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, ecx
mov dword [ebp - 0x144], 0
mov dword [ebp - 0x114], eax
mov dword [ebp - 0x124], 0
mov dword [ebp - 0x110], 0
cmp eax, 0xffffffff
je 0x10008949
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [ebp - 0x100]
push 0
push ecx
push 0x40
lea ecx, [ebp - 0xfc]
push ecx
push eax
call ebx
test eax, eax
je 0x10008808
cmp dword [ebp - 0x100], 0x40
jb 0x10008808
movzx eax, byte [ebp - 0xbe]
push esi
mov esi, dword [ebp - 0x114]
push edi
movzx edi, byte [ebp - 0xbd]
shl edi, 8
or edi, eax
movzx eax, byte [ebp - 0xbf]
shl edi, 8
or edi, eax
movzx eax, byte [ebp - 0xc0]
push 0
shl edi, 8
push 0
or edi, eax
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x10008806
push 0
lea eax, [ebp - 0x100]
push eax
push 0xf8
lea eax, [ebp - 0xfc]
push eax
push esi
call ebx
test eax, eax
je 0x10008806
cmp dword [ebp - 0x100], 0xf8
jb 0x10008806
lea ecx, [ebp - 0xfc]
call fcn.10008120
cmp eax, 0x4550
jne 0x10008806
movzx ecx, byte [ebp - 0xf5]
movzx eax, byte [ebp - 0xf6]
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0xe8]
mov dword [ebp - 0x120], ecx
movzx ecx, byte [ebp - 0xe7]
shl ecx, 8
or ecx, eax
mov dword [ebp - 0x118], ecx
lea ecx, [ebp - 0xd4]
call fcn.10008120
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0x148], eax
call fcn.10008120
lea ecx, [ebp - 0xac]
mov dword [ebp - 0x10c], eax
call fcn.10008120
lea ecx, [ebp - 0xa8]
mov esi, eax
call fcn.10008120
mov ebx, eax
lea ecx, [ebp - 0x84]
mov dword [ebp - 0x108], ebx
call fcn.10008120
lea ecx, [ebp - 0x7c]
mov dword [ebp - 0x104], eax
call fcn.10008120
lea ecx, [ebp - 0x5c]
mov dword [ebp - 0x13c], eax
call fcn.10008120
lea ecx, [ebp - 0x58]
mov dword [ebp - 0x130], eax
call fcn.10008120
push 1
mov dword [ebp - 0x134], eax
lea eax, [ebx + esi]
push 0x2000
push eax
push 0
mov dword [ebp - 0x140], eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
mov dword [ebp - 0x14c], ebx
test ebx, ebx
je 0x10008806
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push 0
push dword [ebp - 0x114]
call esi
cmp eax, 0xffffffff
je 0x100087d5
push 4
push 0x1000
push dword [ebp - 0x108]
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
cmp eax, ebx
jne 0x100087d5
push 0
lea eax, [ebp - 0x100]
push eax
push dword [ebp - 0x108]
push ebx
push dword [ebp - 0x114]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100087d5
mov eax, dword [ebp - 0x108]
cmp dword [ebp - 0x100], eax
jb 0x100087d5
add edi, dword [ebp - 0x118]
push 0
push 0
lea eax, [edi + 0x18]
push eax
push dword [ebp - 0x114]
call esi
cmp eax, 0xffffffff
je 0x100087d5
mov edx, dword [ebp - 0x120]
lea esi, [ebx + 0x18]
add esi, edi
mov dword [ebp - 0x138], esi
lea eax, [edx + edx*4]
lea ecx, [esi + eax*8]
mov eax, dword [ebp - 0x108]
add eax, ebx
mov dword [ebp - 0x12c], ecx
cmp ecx, eax
jae 0x100087d5
xor edi, edi
test edx, edx
je 0x100084ac
mov edi, edi
lea ecx, [esi + 8]
call fcn.10008120
lea ecx, [esi + 0x10]
mov dword [ebp - 0x11c], eax
call fcn.10008120
lea ecx, [esi + 0x14]
mov dword [ebp - 0x118], eax
call fcn.10008120
lea ecx, [esi + 0xc]
mov dword [ebp - 0x128], eax
call fcn.10008120
push 4
push 0x1000
push dword [ebp - 0x11c]
add eax, ebx
push eax
mov dword [ebp - 0x108], eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
je 0x100084a6
push dword [ebp - 0x11c]
push 0
push dword [ebp - 0x108]
call fcn.1000b420
add esp, 0xc
push 0
push 0
push dword [ebp - 0x128]
push dword [ebp - 0x114]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x100084a6
push 0
lea eax, [ebp - 0x100]
push eax
push dword [ebp - 0x118]
push dword [ebp - 0x108]
push dword [ebp - 0x114]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100084a6
mov eax, dword [ebp - 0x118]
cmp dword [ebp - 0x100], eax
jb 0x100084a6
inc edi
add esi, 0x28
cmp edi, dword [ebp - 0x120]
jb 0x100083e0
mov ecx, dword [ebp - 0x12c]
cmp esi, ecx
jne 0x100087d5
mov ecx, dword [ebp - 0x130]
test ecx, ecx
je 0x10008605
xor eax, eax
lea esi, [ecx + ebx]
mov dword [ebp - 0x118], eax
mov eax, dword [ebp - 0x134]
add eax, ecx
mov dword [ebp - 0x108], esi
add eax, ebx
mov dword [ebp - 0x128], eax
cmp esi, eax
jae 0x10008605
jmp 0x100084f0
mov ecx, esi
call fcn.10008120
lea ecx, [esi + 4]
mov dword [ebp - 0x134], eax
call fcn.10008120
mov dword [ebp - 0x12c], eax
mov edi, 4
shr eax, 1
mov dword [ebp - 0x130], eax
cmp eax, edi
jbe 0x100085e0
movzx ecx, byte [esi + edi*2 + 1]
movzx eax, byte [esi + edi*2]
shl ecx, 8
or ecx, eax
mov esi, ecx
shr ecx, 0xc
and esi, 0xfff
add esi, dword [ebp - 0x134]
add esi, ebx
cmp ecx, 3
ja case.default.0x10008546
jmp dword [ecx*4 + 0x1000895c]
mov ecx, esi
call fcn.10008120
mov ecx, eax
mov eax, ebx
sub eax, dword [ebp - 0x10c]
add ecx, eax
mov eax, ecx
mov byte [esi], cl
shr eax, 8
mov byte [esi + 1], al
mov eax, ecx
shr eax, 0x10
shr ecx, 0x18
mov byte [esi + 2], al
mov byte [esi + 3], cl
jmp case.0x10008546.0
movzx ecx, byte [esi + 1]
movzx eax, byte [esi]
shl ecx, 8
or ecx, eax
shl ecx, 0x10
sub ecx, dword [ebp - 0x10c]
add ecx, ebx
shr ecx, 0x10
mov byte [esi], cl
shr ecx, 8
mov byte [esi + 1], cl
jmp case.0x10008546.0
movzx ecx, byte [esi + 1]
movzx eax, byte [esi]
shl cx, 8
or cx, ax
sub cx, word [ebp - 0x10c]
add cx, bx
movzx eax, cx
mov byte [esi], al
shr eax, 8
mov byte [esi + 1], al
jmp case.0x10008546.0
mov dword [ebp - 0x118], 1
mov esi, dword [ebp - 0x108]
inc edi
cmp edi, dword [ebp - 0x130]
jb 0x10008520
add esi, dword [ebp - 0x12c]
mov dword [ebp - 0x108], esi
cmp esi, dword [ebp - 0x128]
jb 0x100084f0
cmp dword [ebp - 0x118], 0
jne 0x100087d5
mov eax, dword [ebp - 0x13c]
test eax, eax
je 0x10008829
lea esi, [eax + 0xc]
mov dword [ebp - 0x11c], 0
add esi, ebx
xor edi, edi
mov ecx, esi
mov dword [ebp - 0x10c], esi
call fcn.10008120
test eax, eax
je 0x10008656
lea ecx, [esi + 4]
call fcn.10008120
test eax, eax
je 0x10008650
add esi, 0x14
inc edi
mov ecx, esi
call fcn.10008120
test eax, eax
jne 0x10008635
mov esi, dword [ebp - 0x10c]
xor ecx, ecx
lea eax, [edi + 1]
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.1000d699
add esp, 4
mov dword [ebp - 0x110], eax
test eax, eax
je 0x100087d5
xor edi, edi
mov ecx, esi
mov dword [ebp - 0x108], edi
call fcn.10008120
test eax, eax
je 0x1000877e
lea ecx, [esi + 4]
call fcn.10008120
test eax, eax
je 0x10008763
mov ecx, dword [ebp - 0x10c]
call fcn.10008120
lea ecx, [esi + 4]
lea edi, [ebx + eax]
call fcn.10008120
push edi
lea esi, [ebx + eax]
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
test edi, edi
je 0x10008771
mov eax, dword [ebp - 0x108]
mov ecx, dword [ebp - 0x110]
mov dword [ecx + eax*4], edi
inc eax
mov ecx, esi
mov dword [ebp - 0x108], eax
call fcn.10008120
test eax, eax
je 0x10008745
mov ecx, esi
call fcn.10008120
test eax, eax
jns 0x10008702
movzx eax, ax
jmp 0x10008707
add eax, 2
add eax, ebx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, eax
test ecx, ecx
je 0x1000872d
shr eax, 8
mov byte [esi + 1], al
mov eax, ecx
shr eax, 0x10
mov byte [esi], cl
shr ecx, 0x18
mov byte [esi + 2], al
mov byte [esi + 3], cl
jmp 0x10008737
mov dword [ebp - 0x11c], 1
add esi, 4
mov ecx, esi
call fcn.10008120
test eax, eax
jne 0x100086f2
mov esi, dword [ebp - 0x10c]
add esi, 0x14
mov ecx, esi
mov dword [ebp - 0x10c], esi
call fcn.10008120
test eax, eax
jne 0x10008697
mov eax, dword [ebp - 0x11c]
mov edi, dword [ebp - 0x108]
jmp 0x10008780
mov edi, dword [ebp - 0x108]
mov eax, 1
jmp 0x10008780
xor eax, eax
mov esi, dword [ebp - 0x110]
mov dword [esi + edi*4], 0
test eax, eax
je 0x1000882b
test esi, esi
je 0x100087d5
mov eax, dword [ebp - 0x110]
xor esi, esi
mov eax, dword [eax]
test eax, eax
je 0x100087c7
mov edi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov ebx, dword [ebp - 0x110]
push eax
call edi
mov eax, dword [ebx + esi*4 + 4]
lea esi, [esi + 1]
test eax, eax
jne 0x100087b3
mov ebx, dword [ebp - 0x14c]
push dword [ebp - 0x110]
call fcn.1000d694
add esp, 4
mov esi, dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0x4000
push dword [ebp - 0x140]
push ebx
call esi
push 0x8000
push 0
push ebx
call esi
mov eax, dword [ebp - 0x124]
test eax, eax
je 0x10008806
push eax
call fcn.1000d694
add esp, 4
pop edi
pop esi
push dword [ebp - 0x114]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x144]
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10009f20
mov esp, ebp
pop ebp
ret
xor esi, esi
push 0x18
call fcn.1000d699
mov edi, eax
add esp, 4
mov dword [ebp - 0x124], edi
test edi, edi
je 0x10008795
mov ecx, dword [ebp - 0x148]
mov edx, dword [ebp - 0x13c]
mov dword [edi], ebx
mov dword [edi + 0x14], esi
lea eax, [ecx + ebx]
neg ecx
sbb ecx, ecx
and ecx, eax
lea eax, [edx + ebx]
neg edx
mov dword [edi + 8], ecx
sbb edx, edx
and edx, eax
mov eax, dword [ebp - 0x140]
mov dword [edi + 0xc], edx
mov edx, dword [ebp - 0x104]
mov dword [edi + 4], eax
lea eax, [edx + ebx]
neg edx
sbb edx, edx
and edx, eax
cmp dword [ebp - 0x120], 0
mov dword [edi + 0x10], edx
jbe 0x1000892a
mov esi, dword [ebp - 0x138]
add esi, 0xc
nop
lea ecx, [esi - 4]
call fcn.10008120
mov ecx, esi
mov edi, eax
call fcn.10008120
lea ecx, [esi + 0x18]
mov dword [ebp - 0x138], eax
call fcn.10008120
shr eax, 0x1d
dec eax
cmp eax, 6
ja case.default.0x100088c8
jmp dword [eax*4 + 0x1000896c]
mov eax, 0x10
jmp 0x100088f7
mov eax, 2
jmp 0x100088f7
mov eax, 0x20
jmp 0x100088f7
mov eax, 4
jmp 0x100088f7
mov eax, 0x40
jmp 0x100088f7
mov eax, 1
lea ecx, [ebp - 0x104]
push ecx
push eax
mov eax, dword [ebp - 0x138]
push edi
add eax, ebx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
add esi, 0x28
sub dword [ebp - 0x120], 1
jne 0x100088a0
mov edi, dword [ebp - 0x124]
mov esi, dword [ebp - 0x110]
mov ecx, dword [edi + 8]
test ecx, ecx
je 0x1000893e
push 0
push 1
push dword [edi]
call ecx
test eax, eax
je 0x10008795
mov dword [ebp - 0x144], edi
jmp 0x10008806
mov ecx, dword [ebp - 4]
xor eax, eax
xor ecx, ebp
call fcn.10009f20
mov esp, ebp
pop ebp
ret