Function at 0x4222c0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [0x4544f0]
xor eax, ebp
mov dword [ebp - 0x18], eax
cmp dword [ebp + 8], 0
jne 0x4222de
or eax, 0xffffffff
jmp 0x4228b8
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x3c]
and ecx, 0x8000
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x3c]
and eax, 0xffff7fff
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x3c], eax
cmp dword [ebp + 0xc], 0
jne 0x42230c
or eax, 0xffffffff
jmp 0x4228b8
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x3c]
and eax, 0x100
je 0x42243f
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x3c]
and edx, 2
jne 0x42233f
mov eax, dword [ebp + 8]
movzx ecx, word [eax + 0x14]
and ecx, 3
cmp ecx, 3
je 0x42233f
or eax, 0xffffffff
jmp 0x4228b8
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
cmp eax, dword [edx]
je 0x422368
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x48], 0
je 0x422360
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x48]
add eax, 8
cmp eax, dword [ebp + 0xc]
je 0x422368
or eax, 0xffffffff
jmp 0x4228b8
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x3c]
and edx, 0xfffffeff
mov eax, dword [ebp + 8]
mov dword [eax + 0x3c], edx
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x3c]
and edx, 0x200
je 0x42241e
mov eax, dword [ebp + 0x10]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jle 0x4223e5
mov ecx, dword [ebp - 4]
mov dword [ebp - 0x2c], ecx
cmp dword [ebp - 0x2c], 0x10
jbe 0x4223ab
mov dword [ebp - 0x2c], 0x10
mov edx, dword [ebp - 0x2c]
push edx
lea eax, [ebp - 0x28]
push eax
mov ecx, dword [ebp + 8]
movsx edx, word [ecx + 0x16]
push edx
call dword [sym.imp.MSVCR90.dll__read]
add esp, 0xc
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jg 0x4223da
mov eax, dword [ebp + 0x10]
sub eax, dword [ebp - 4]
mov dword [ebp + 0x10], eax
jmp 0x4223e5
mov ecx, dword [ebp - 4]
sub ecx, dword [ebp - 0x2c]
mov dword [ebp - 4], ecx
jmp 0x422392
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x3c]
and eax, 0xfffffdff
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x3c], eax
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x18]
add eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0xc], eax
mov edx, dword [ebp + 0x10]
xor eax, eax
mov ecx, dword [ebp + 8]
add edx, dword [ecx + 0x30]
mov ecx, dword [ecx + 0x34]
adc ecx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x30], edx
mov dword [eax + 0x34], ecx
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x3c]
and edx, 1
je 0x42243f
mov eax, dword [ebp + 8]
cmp dword [eax + 0x4c], 0
je 0x42243f
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
add edx, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
mov dword [eax], edx
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0xc]
mov dword [ebp - 8], edx
jmp 0x42245c
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x3c]
and ecx, 0xffffffdf
mov edx, dword [ebp + 8]
mov dword [edx + 0x3c], ecx
mov eax, dword [ebp - 0x14]
neg eax
sbb eax, eax
and eax, 0x20
or eax, 0x18
not eax
mov ecx, dword [ebp + 8]
and eax, dword [ecx + 0x3c]
cmp eax, 2
je 0x4224b4
mov edx, dword [ebp - 0x14]
push edx
push 2
mov eax, dword [ebp + 8]
push eax
call fcn.0042ad60
add esp, 0xc
test eax, eax
jge 0x4224b4
mov ecx, dword [ebp - 8]
cmp ecx, dword [ebp - 0xc]
jbe 0x42249f
mov edx, dword [ebp - 8]
sub edx, dword [ebp - 0xc]
mov dword [ebp - 0x30], edx
jmp 0x4224a6
mov dword [ebp - 0x30], 0xffffffff
mov eax, dword [ebp - 0x30]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
jmp 0x4228b8
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x3c]
or edx, 0x20
mov eax, dword [ebp + 8]
mov dword [eax + 0x3c], edx
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x18]
mov dword [ecx + 4], eax
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 8]
mov eax, dword [edx + 4]
mov dword [ecx + 8], eax
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 8]
mov eax, dword [ecx + 0xc]
sub eax, dword [edx]
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 8]
cmp edx, dword [ecx]
jne 0x422520
mov eax, dword [ebp - 4]
cmp eax, dword [ebp + 0x10]
jle 0x422501
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 8]
add edx, dword [ebp - 4]
mov dword [ebp - 8], edx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
mov dword [eax], ecx
mov edx, dword [ebp + 0x10]
sub edx, dword [ebp - 4]
mov dword [ebp + 0x10], edx
jmp 0x4226ce
cmp dword [ebp - 4], 0
je 0x422545
mov eax, dword [ebp + 8]
movzx ecx, word [eax + 0x14]
and ecx, 0x2000
je 0x422600
mov edx, dword [ebp - 4]
cmp edx, dword [ebp + 0x10]
jge 0x422600
mov eax, dword [ebp + 8]
movzx ecx, word [eax + 0x14]
and ecx, 4
je 0x42259d
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x3c]
or eax, 0x8000
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x3c], eax
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x40]
push eax
mov ecx, dword [ebp + 0x10]
sub ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.0042b880
add esp, 0x10
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 8]
mov eax, dword [ecx + 0xc]
sub eax, dword [edx]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp + 0x10]
jge 0x42259b
jmp 0x4226ce
jmp 0x422600
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 8]
mov ecx, dword [edx]
cmp ecx, dword [eax + 0x18]
jbe 0x422600
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x3c]
or eax, 0x8000
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x3c], eax
push 0xffffffffffffffff
mov edx, dword [ebp + 8]
push edx
call fcn.00420380
add esp, 8
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [eax + 0xc]
sub edx, dword [ecx]
mov dword [ebp - 4], edx
mov eax, dword [ebp - 4]
cmp eax, dword [ebp + 0x10]
jge 0x422600
mov ecx, dword [ebp + 8]
movzx edx, word [ecx + 0x14]
and edx, 0x2000
je 0x422600
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [eax]
cmp edx, dword [ecx + 0x18]
jbe 0x422600
jmp 0x4226ce
mov eax, dword [ebp + 8]
movzx ecx, word [eax + 0x14]
and ecx, 4
jne 0x42267a
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 8]
mov ecx, dword [edx]
cmp ecx, dword [eax + 0x18]
jne 0x42267a
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0x10]
cmp eax, dword [edx + 0x1c]
jge 0x422641
cmp dword [ebp + 0x10], 0x400
jb 0x42267a
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x1c]
cdq
and edx, 0xf
add eax, edx
sar eax, 4
cmp dword [ebp + 0x10], eax
jl 0x42267a
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x3c]
or eax, 0x8000
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x3c], eax
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x40]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.0042b880
add esp, 0x10
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jg 0x422678
jmp 0x4226ce
jmp 0x4226b3
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp + 0x10]
jle 0x422688
mov edx, dword [ebp + 0x10]
mov dword [ebp - 4], edx
cmp dword [ebp - 4], 0
jg 0x422690
jmp 0x4226ce
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
call sub.MSVCR90.dll_memcpy
add esp, 0xc
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
add edx, dword [ebp - 4]
mov eax, dword [ebp + 8]
mov dword [eax], edx
mov ecx, dword [ebp - 8]
add ecx, dword [ebp - 4]
mov dword [ebp - 8], ecx
mov edx, dword [ebp + 0x10]
sub edx, dword [ebp - 4]
mov dword [ebp + 0x10], edx
jne 0x4226c9
jmp 0x4226ce
jmp 0x42244d
mov eax, dword [ebp + 8]
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
cmp dword [ecx + 0x2c], 0
jg 0x422727
jl 0x4226e8
mov edx, dword [ebp - 0x34]
cmp dword [edx + 0x28], 0
jae 0x422727
mov eax, dword [ebp + 8]
movzx ecx, word [eax + 0x14]
and ecx, 0x40
je 0x422727
mov edx, dword [ebp + 8]
movzx eax, word [edx + 0x14]
and eax, 0x800
jne 0x422727
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x3c]
or edx, 0x8000
mov eax, dword [ebp + 8]
mov dword [eax + 0x3c], edx
push 0xffffffffffffffff
mov ecx, dword [ebp + 8]
push ecx
call fcn.00420380
add esp, 8
jmp 0x4227e9
cmp dword [ebp + 0x10], 0
jne 0x4227e9
mov edx, dword [ebp + 8]
movzx eax, word [edx + 0x14]
and eax, 0x20
je 0x4227e9
mov ecx, dword [ebp + 8]
movzx edx, word [ecx + 0x14]
and edx, 4
jne 0x4227e9
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [eax]
sub edx, dword [ecx + 0x18]
mov dword [ebp + 0x10], edx
mov eax, dword [ebp - 8]
sub eax, dword [ebp - 0xc]
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0x10]
cmp ecx, dword [ebp - 4]
jle 0x422776
mov edx, dword [ebp - 4]
mov dword [ebp + 0x10], edx
cmp dword [ebp + 0x10], 0
jbe 0x4227c0
cmp dword [ebp + 0x10], 0x80
jae 0x4227c0
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
sub ecx, 1
mov dword [ebp - 0x10], ecx
jmp 0x4227a4
mov edx, dword [ebp + 0x10]
sub edx, 1
mov dword [ebp + 0x10], edx
mov eax, dword [ebp - 0x10]
sub eax, 1
mov dword [ebp - 0x10], eax
cmp dword [ebp + 0x10], 0
jbe 0x4227c0
mov ecx, dword [ebp - 0x10]
movzx edx, byte [ecx]
cmp edx, 0xa
jne 0x4227be
mov dword [ebp + 0x10], 0x80
jmp 0x4227c0
jmp 0x422792
cmp dword [ebp + 0x10], 0x80
jb 0x4227e9
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x3c]
or ecx, 0x8000
mov edx, dword [ebp + 8]
mov dword [edx + 0x3c], ecx
push 0xffffffffffffffff
mov eax, dword [ebp + 8]
push eax
call fcn.00420380
add esp, 8
cmp dword [ebp - 0x14], 0
je 0x4227fb
mov dword [ebp - 0x38], 0
jmp 0x4228ac
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x3c]
and edx, 0xffffffc7
mov eax, dword [ebp + 8]
mov dword [eax + 0x3c], edx
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x3c], 1
jne 0x422844
mov edx, dword [ebp + 8]
movzx eax, word [edx + 0x14]
and eax, 0
je 0x42282a
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x18]
mov dword [ebp - 0x3c], edx
jmp 0x422833
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xc]
mov dword [ebp - 0x3c], ecx
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x3c]
mov dword [edx + 8], eax
mov ecx, dword [ebp - 0x3c]
mov dword [ebp - 0x40], ecx
jmp 0x4228a5
mov edx, dword [ebp + 8]
cmp dword [edx + 0x3c], 2
jne 0x42287e
mov eax, dword [ebp + 8]
movzx ecx, word [eax + 0x14]
and ecx, 0x20
je 0x422864
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x18]
mov dword [ebp - 0x44], eax
jmp 0x42286d
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0xc]
mov dword [ebp - 0x44], edx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x44]
mov dword [eax + 4], ecx
mov edx, dword [ebp - 0x44]
mov dword [ebp - 0x48], edx
jmp 0x42289f
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x18]
mov dword [eax + 8], edx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 8]
mov dword [eax + 4], edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 4]
mov dword [ebp - 0x48], ecx
mov edx, dword [ebp - 0x48]
mov dword [ebp - 0x40], edx
mov dword [ebp - 0x38], 0
mov eax, dword [ebp - 8]
sub eax, dword [ebp - 0xc]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x18]
xor ecx, ebp
call fcn.0043618e
mov esp, ebp
pop ebp
ret