Function at 0x409170
Capabilities:
Read file on windows

Disassembly:
push ebp
xor ebp, ebp
push edi
mov edx, ebp
push esi
push ebx
sub esp, 0x4c
imul eax, dword [esp + 0x60], 0xa48
lea ecx, [eax + 0x248]
lea ebx, [eax + 0x4529d8]
mov dword [esp + 0x24], ecx
lea esi, [eax + 0x4527c0]
lea esi, [esi]
mov eax, dword [esp + 0x24]
mov dword [esp + 0x28], edx
lea ebp, [edx + eax + 0x4527c0]
mov dword [ebx], 0
mov dword [ebx + 4], 0
mov dword [ebx + 8], 0
mov dword [ebx + 0xc], 0
mov dword [ebx + 0x10], 0
mov eax, dword [esi + 0x210]
mov dword [esi + 0x228], eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], ebp
mov eax, dword [esi + 0x20c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
test eax, eax
jne 0x40921c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x409440
lea edi, [esp + 0x3c]
mov dword [esp + 0xc], 1
mov dword [esp + 8], edi
mov dword [esp + 4], ebx
mov eax, dword [esi + 0x20c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
sub esp, 0x10
cmp dword [esp + 0x3c], 1
jne 0x4091af
mov eax, dword [esi + 0x210]
mov edx, dword [esp + 0x28]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x28], eax
call eax
sub esp, 4
mov edx, dword [esp + 0x2c]
test edx, edx
je 0x4092e0
cmp edx, 1
je 0x4092c0
movzx eax, byte [esi + 0x24a]
cmp al, 1
je 0x409450
cmp al, 0xb
ja 0x4092f8
mov dword [esp + 0xc], 1
mov eax, dword [0x45b0dc]
mov dword [esp + 8], 9
mov dword [esp + 4], 0x8000
mov dword [esp], eax
call dword [sym.imp.USER32.dll_PostMessageW]
xor edx, edx
sub esp, 0x10
jmp 0x4091a0
movzx eax, byte [esi + 0x249]
mov edx, 2
cmp al, 0xaa
je 0x4091a0
xor edx, edx
cmp al, 0x55
sete dl
jmp 0x4091a0
xor edx, edx
cmp byte [esi + 0x248], 0x55
sete dl
jmp 0x4091a0
mov ebp, 3
lea esi, [esi]
mov dword [ebx], 0
mov dword [ebx + 4], 0
mov dword [ebx + 8], 0
mov dword [ebx + 0xc], 0
mov dword [ebx + 0x10], 0
mov eax, dword [esi + 0x210]
mov dword [esi + 0x228], eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 0
movzx eax, byte [esi + 0x24a]
sub eax, ebp
mov dword [esp + 8], eax
mov eax, dword [esp + 0x24]
lea eax, [ebp + eax + 0x4527c0]
mov dword [esp + 4], eax
mov eax, dword [esi + 0x20c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
test eax, eax
jne 0x40937d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x409440
mov dword [esp + 0xc], 1
mov dword [esp + 8], edi
mov dword [esp + 4], ebx
mov eax, dword [esi + 0x20c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov eax, dword [esi + 0x210]
sub esp, 0x10
mov dword [esp], eax
mov eax, dword [esp + 0x28]
call eax
movzx eax, byte [esi + 0x24a]
sub esp, 4
add ebp, dword [esp + 0x3c]
cmp eax, ebp
jg 0x409300
mov dword [esp + 0x28], eax
movzx eax, word [0x452060]
movzx edx, word [0x452062]
mov dword [esp + 8], 4
shl eax, 0x10
mov dword [esp + 4], edi
or eax, edx
mov dword [esp], 0xffffffff
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x24]
lea ebp, [eax + 0x4527c0]
call fcn.00401f50
mov ecx, dword [esp + 0x28]
mov dword [esp + 4], ebp
mov dword [esp], eax
sub ecx, 4
mov dword [esp + 8], ecx
call fcn.00401f50
mov edx, eax
movzx eax, byte [esi + 0x24a]
shr al, 2
movzx eax, al
cmp dword [ebp + eax*4 - 4], edx
je 0x40958f
mov dword [esp + 0xc], 2
jmp 0x409294
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
imul edx, dword [esp + 0x60], 0xa48
mov ecx, 3
mov dword [esp + 0x2c], esi
mov esi, ecx
lea ebp, [edx + 0x4527c0]
mov eax, ebp
mov ebp, ebx
mov ebx, eax
nop
mov dword [ebp], 0
mov dword [ebp + 4], 0
mov dword [ebp + 8], 0
mov dword [ebp + 0xc], 0
mov dword [ebp + 0x10], 0
mov eax, dword [ebx + 0x210]
mov dword [ebx + 0x228], eax
mov eax, 0x4c8
sub eax, esi
mov dword [esp + 0x10], ebp
mov dword [esp + 8], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0xc], 0
lea eax, [esi + eax + 0x4527c0]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x20c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
test eax, eax
jne 0x4094ec
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x409440
mov dword [esp + 0xc], 1
mov dword [esp + 8], edi
mov dword [esp + 4], ebp
mov eax, dword [ebx + 0x20c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov eax, dword [ebx + 0x210]
sub esp, 0x10
mov dword [esp], eax
mov eax, dword [esp + 0x28]
call eax
sub esp, 4
add esi, dword [esp + 0x3c]
cmp esi, 0x4c7
jle 0x409470
movzx eax, word [0x452060]
movzx edx, word [0x452062]
mov dword [esp + 4], edi
mov ebx, ebp
mov dword [esp + 8], 4
mov esi, dword [esp + 0x2c]
shl eax, 0x10
mov dword [esp], 0xffffffff
or eax, edx
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x24]
lea ebp, [eax + 0x4527c0]
call fcn.00401f50
mov dword [esp + 8], 0x4c4
mov dword [esp + 4], ebp
mov dword [esp], eax
call fcn.00401f50
cmp dword [ebp + 0x4c4], eax
jne 0x409431
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call fcn.00408770
xor edx, edx
jmp 0x4091a0