Function at 0x100040a8
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x54
mov eax, dword [ecx + 8]
shr eax, 1
and eax, 1
mov dword [esp + 4], ecx
push ebx
mov dword [esp + 0x38], eax
mov eax, dword [ecx + 0xc]
push esi
push edi
test eax, eax
je 0x10004318
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esp + 0x54], eax
cmp eax, 0xffffffff
je 0x10004318
push 4
push 0x3000
push 0x11300
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [esp + 0x14], eax
test eax, eax
je 0x10004308
lea edx, [eax + 0x1000]
mov dword [esp + 0x30], 0
mov ebx, edx
mov dword [esp + 0x44], edx
xor edi, edi
mov dword [esp + 0x48], ebx
mov ecx, edx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x24], ecx
lea esi, [ebx + 0x100]
mov dword [esp + 0x2c], 0
lea eax, [esi + 0x200]
mov dword [esp + 0x4c], esi
mov dword [esp + 0x1c], esi
mov ebx, eax
xor esi, esi
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x18], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x38], edi
mov dword [esp + 0x3c], 2
mov dword [esp + 0x20], esi
jmp 0x10004000
cmp dword [esp + 0x20], 0
jne 0x100042fa
cmp ecx, edx
jb 0x10004050
push 0
lea ecx, [esp + 0x5c]
push ecx
push 0x1000
push eax
push dword [esp + 0x64]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10004040
mov edx, dword [esp + 0x14]
mov ecx, edx
mov eax, dword [esp + 0x58]
add eax, edx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x44], eax
jmp 0x10004048
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x44]
cmp ecx, eax
jb 0x10004050
xor dl, dl
jmp 0x10004057
mov dl, byte [ecx]
inc ecx
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x3c]
movzx eax, dl
mov byte [esp + 0xe], dl
lea ecx, [ecx + ecx*8]
mov al, byte [eax + 0x1003cd40]
movzx eax, al
mov dh, byte [ecx + eax + 0x1003cce0]
mov al, byte [ecx + eax + 0x1003ce40]
mov byte [esp + 0xf], dh
cmp dh, 0xff
je 0x10004094
test dh, dh
jns 0x10004094
cmp dword [esp + 0x40], 0
je 0x100042f6
movzx eax, al
dec eax
cmp eax, 9
ja case.default.0x100040a1
jmp dword [eax*4 + 0x10004320]
mov eax, dword [esp + 0x48]
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], 0
mov dword [esp + 0x18], 0
jmp case.default.0x100040a1
mov ecx, dword [esp + 0x18]
cmp ecx, 0xff
jb 0x100040de
mov dword [esp + 0x2c], 1
jmp case.default.0x100040a1
mov eax, dword [esp + 0x28]
mov byte [eax], dl
inc eax
inc ecx
mov dword [esp + 0x28], eax
mov dword [esp + 0x18], ecx
jmp case.default.0x100040a1
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x10004123
cmp dword [esp + 0x2c], 0
jne 0x10004123
mov eax, dword [esp + 0x48]
mov edx, eax
push 1
mov byte [ecx + eax], 0
mov ecx, dword [esp + 0x14]
call fcn.10003c80
add esp, 4
mov dword [esp + 0x30], eax
jmp case.default.0x100040a1
mov dword [esp + 0x30], 0
jmp case.default.0x100040a1
mov edx, dword [esp + 0x4c]
xor edi, edi
mov al, byte [esp + 0xe]
mov dword [esp + 0x34], 0
mov byte [edx], al
inc edx
mov dword [esp + 0x1c], edx
inc edi
jmp case.default.0x100040a1
cmp edi, 0x1ff
jb 0x10004164
mov dword [esp + 0x34], 1
jmp case.default.0x100040a1
mov edx, dword [esp + 0x1c]
mov al, byte [esp + 0xe]
mov byte [edx], al
inc edx
mov dword [esp + 0x1c], edx
inc edi
jmp case.default.0x100040a1
test edi, edi
je 0x1000419a
mov edx, dword [esp + 0x1c]
movsx ecx, byte [edx - 1]
lea eax, [edx - 1]
cmp byte [ecx + 0x1003cd40], 8
jne 0x1000419a
mov edx, eax
mov dword [esp + 0x1c], edx
dec edi
jne 0x10004181
mov ebx, dword [esp + 0x50]
xor esi, esi
mov dword [esp + 0x38], 0
jmp case.default.0x100040a1
cmp esi, 0xffff
jb 0x100041c2
mov dword [esp + 0x38], 1
jmp case.default.0x100040a1
mov byte [ebx], dl
inc ebx
inc esi
jmp case.default.0x100040a1
test esi, esi
je case.0x100040a1.10
nop
movsx eax, byte [ebx - 1]
cmp byte [eax + 0x1003cd40], 8
jne case.0x100040a1.10
dec ebx
dec esi
jne 0x100041d0
mov eax, dword [esp + 0x30]
test eax, eax
je 0x100042b6
cmp dword [esp + 0x34], 0
jne 0x100042b6
cmp dword [esp + 0x38], 0
jne 0x100042b6
mov ecx, dword [esp + 0x4c]
mov edx, ecx
push 1
mov byte [edi + ecx], 0
mov byte [esi + ecx + 0x200], 0
mov ecx, eax
call fcn.10003df0
add esp, 4
mov dword [esp + 0x3c], eax
test eax, eax
je case.default.0x100040a1
test esi, esi
je 0x1000428b
mov eax, dword [esp + 0x10]
push dword [esp + 0x50]
push dword [eax]
call fcn.10002780
add esp, 8
mov dword [esp + 0x5c], eax
test eax, eax
je 0x1000427a
mov eax, dword [esp + 0x3c]
mov edx, dword [eax + 0x20]
test edx, edx
je 0x1000426a
mov eax, dword [esp + 0x10]
push 1
mov ecx, dword [eax]
call fcn.10002320
mov eax, dword [esp + 0x40]
add esp, 4
mov ecx, dword [esp + 0x5c]
mov dword [eax + 0x20], ecx
mov ecx, dword [esp + 0x10]
inc dword [ecx + 4]
jmp case.default.0x100040a1
cmp dword [esp + 0x40], 0
jne case.default.0x100040a1
mov dword [esp + 0x20], 1
jmp case.default.0x100040a1
mov edx, dword [eax + 0x20]
test edx, edx
je 0x100042ad
mov eax, dword [esp + 0x10]
push 1
mov ecx, dword [eax]
call fcn.10002320
mov eax, dword [esp + 0x40]
add esp, 4
mov dword [eax + 0x20], 0
mov eax, dword [esp + 0x10]
inc dword [eax + 4]
jmp case.default.0x100040a1
mov ecx, dword [esp + 0x20]
mov eax, 1
cmp dword [esp + 0x40], 0
cmove ecx, eax
mov dword [esp + 0x20], ecx
mov al, byte [esp + 0xf]
cmp al, 0xff
je 0x100042f6
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x44]
movzx eax, al
and eax, 0xffffff7f
mov dword [esp + 0x3c], eax
cmp eax, 0xffffffff
mov eax, dword [esp + 0x14]
jne 0x10004000
jmp 0x100042fa
mov eax, dword [esp + 0x14]
push 0x8000
push 0
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [esp + 0x54]
cmp eax, 0xffffffff
je 0x10004318
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret