Function at 0x406b58
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
push ebx
push esi
push edi
xor ebx, ebx
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
push dword [ebp + 8]
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0xc], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 8], eax
cmp eax, 0xffffffff
je 0x406e71
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
lea ecx, [ebp - 0xc]
push ecx
push 0xc
lea ecx, [ebp - 0x2c]
push ecx
push eax
call esi
mov eax, dword [ebp - 0x28]
movzx cx, byte [ebp - 0x2c]
movzx dx, byte [ebp - 0x2a]
shr eax, 8
movzx di, al
movzx ax, byte [ebp - 0x28]
shl ax, 8
or di, ax
mov eax, dword [ebp - 0x2c]
shr eax, 8
shl cx, 8
movzx ax, al
or ax, cx
mov word [ebp - 0x28], di
mov ecx, dword [ebp - 0x2a]
shr ecx, 8
movzx cx, cl
shl dx, 8
or cx, dx
mov word [ebp - 0x2c], ax
mov word [ebp - 0x2a], cx
cmp ax, 1
jne 0x406e76
cmp cx, bx
jne 0x406e76
xor eax, eax
mov dword [ebp - 4], ebx
cmp ax, di
jae 0x406e68
push ebx
lea eax, [ebp - 0xc]
push eax
push 0x10
lea eax, [ebp - 0x4c]
push eax
push dword [ebp - 8]
call esi
push 5
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
lea eax, [ebp - 0x18]
push eax
push str.name
mov byte [ebp - 0x14], bl
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x406c58
movzx eax, word [ebp - 0x28]
inc dword [ebp - 4]
cmp dword [ebp - 4], eax
jl 0x406c11
jmp 0x406e68
mov ecx, dword [ebp - 0x40]
movzx dx, cl
mov eax, ecx
shl dx, 8
movzx edx, dx
shr ecx, 8
movzx ecx, cl
or edx, ecx
shr eax, 0x10
movzx cx, al
shr eax, 8
shl cx, 8
shl edx, 0x10
movzx eax, al
movzx ecx, cx
or edx, ecx
or edx, eax
mov dword [ebp - 0x40], edx
mov edx, dword [ebp - 0x44]
movzx ax, dl
mov ecx, edx
shl ax, 8
shr edx, 8
movzx eax, ax
movzx edx, dl
or eax, edx
shr ecx, 0x10
movzx dx, cl
shl dx, 8
movzx edx, dx
shr ecx, 8
shl eax, 0x10
movzx ecx, cl
push ebx
or eax, edx
or eax, ecx
push ebx
push eax
push dword [ebp - 8]
mov dword [ebp - 0x44], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0xc]
push eax
push 6
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 8]
call esi
mov eax, dword [ebp - 0x1e]
movzx cx, byte [ebp - 0x1e]
movzx dx, byte [ebp - 0x1c]
shr eax, 8
shl cx, 8
movzx ax, al
or ax, cx
mov ecx, dword [ebp - 0x1c]
shr ecx, 8
movzx cx, cl
shl dx, 8
or cx, dx
mov word [ebp - 0x1c], cx
xor ecx, ecx
mov word [ebp - 0x1e], ax
mov dword [ebp - 4], ebx
cmp cx, ax
jae 0x406e68
push ebx
lea eax, [ebp - 0xc]
push eax
push 0xc
lea eax, [ebp - 0x3c]
push eax
push dword [ebp - 8]
call esi
mov eax, dword [ebp - 0x36]
movzx cx, byte [ebp - 0x36]
movzx dx, byte [ebp - 0x3c]
shl cx, 8
shr eax, 8
movzx ax, al
or ax, cx
mov ecx, dword [ebp - 0x3c]
shr ecx, 8
movzx cx, cl
shl dx, 8
or cx, dx
movzx dx, byte [ebp - 0x38]
movzx di, byte [ebp - 0x32]
mov word [ebp - 0x3c], cx
mov word [ebp - 0x36], ax
mov ecx, dword [ebp - 0x38]
shr ecx, 8
shl dx, 8
movzx cx, cl
or cx, dx
movzx dx, byte [ebp - 0x34]
mov word [ebp - 0x38], cx
mov ecx, dword [ebp - 0x34]
shr ecx, 8
shl dx, 8
movzx cx, cl
or cx, dx
mov edx, dword [ebp - 0x32]
shr edx, 8
movzx dx, dl
shl di, 8
movzx eax, ax
or dx, di
mov word [ebp - 0x34], cx
mov word [ebp - 0x32], dx
cmp eax, dword [ebp + 0xc]
jne 0x406dce
cmp word [ebp - 0x3c], 3
jne 0x406dce
mov eax, 0x409
cmp word [ebp - 0x38], ax
je 0x406de3
movzx eax, word [ebp - 0x1e]
inc dword [ebp - 4]
cmp dword [ebp - 4], eax
jl 0x406d22
jmp 0x406e68
movzx edi, cx
movzx ecx, word [ebp - 0x1c]
movzx eax, dx
add eax, dword [ebp - 0x44]
push ebx
push ebx
add ecx, eax
push ecx
push dword [ebp - 8]
shr edi, 1
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
movzx eax, word [ebp - 0x34]
inc eax
inc eax
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push ebx
lea ecx, [ebp - 0xc]
push ecx
movzx ecx, word [ebp - 0x34]
push ecx
push eax
push dword [ebp - 8]
mov dword [ebp - 4], eax
call esi
cmp edi, ebx
jle 0x406e44
mov eax, dword [ebp - 4]
lea eax, [eax + ebx*2]
movzx dx, byte [eax]
movzx cx, byte [eax + 1]
shl dx, 8
or cx, dx
inc ebx
cmp ebx, edi
mov word [eax], cx
jl 0x406e26
push dword [ebp + 0x14]
mov esi, dword [ebp - 4]
push esi
push dword [ebp + 0x10]
xor eax, eax
mov word [esi + edi*2], ax
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
push esi
mov dword [ebp - 0x10], 1
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x10]
jmp 0x406e78
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret