Function at 0x40b320
Capabilities:
Read file on windows

Disassembly:
xor edx, edx
sub esp, 8
cmp word [0x431448], dx
jne 0x40b357
mov eax, 0x413248
mov ecx, 0x190
jmp 0x40b340
mov dword [eax], 0xffffffff
add eax, 0x120
dec ecx
jne 0x40b340
mov word [0x431448], 1
mov eax, dword [esp + 0x20]
xor ecx, ecx
mov dword [eax], 0xffffffff
mov dword [esp], ecx
mov eax, 0x413368
push esi
lea esp, [esp]
cmp dword [eax - 0x120], edx
jl 0x40b3c1
cmp dword [eax], edx
jl 0x40b3b1
cmp dword [eax + 0x120], edx
jl 0x40b3b4
cmp dword [eax + 0x240], edx
jl 0x40b3b9
cmp dword [eax + 0x360], edx
jl 0x40b3be
add eax, 0x5a0
add ecx, 5
cmp eax, 0x42f568
jl 0x40b370
mov dword [esp + 4], ecx
mov eax, 0xb
pop esi
add esp, 8
ret
inc ecx
jmp 0x40b3c1
add ecx, 2
jmp 0x40b3c1
add ecx, 3
jmp 0x40b3c1
add ecx, 4
cmp ecx, 0x190
mov dword [esp + 4], ecx
jl 0x40b3d7
mov eax, 0xb
pop esi
add esp, 8
ret
push edi
mov di, word [esp + 0x18]
lea esi, [ecx + ecx*8]
shl esi, 5
cmp di, dx
mov word [esi + 0x413350], dx
mov word [esi + 0x413352], dx
mov word [esi + 0x413354], dx
jne 0x40b404
mov edi, 0x10
jmp 0x40b411
dec di
neg di
sbb edi, edi
and edi, 0xffffffe0
add edi, 0x40
mov eax, dword [esp + 0x24]
cmp word [eax], dx
push ebx
mov ebx, dword [sym.imp.MSVCR71.dll__sopen]
push ebp
mov ebp, dword [esp + 0x1c]
jne 0x40b444
movsx ecx, di
push ecx
push 0x8002
push ebp
call ebx
add esp, 0xc
test eax, eax
jge 0x40b44a
mov edx, dword [esp + 0x2c]
mov word [edx], 1
jmp 0x40b458
mov eax, dword [esp + 0x30]
jmp 0x40b44e
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x2c]
cmp word [edx], 1
jne 0x40b472
or byte [esi + 0x413351], 0x40
movsx eax, di
push eax
push 0x8000
push ebp
call ebx
mov ecx, dword [esp + 0x1c]
add esp, 0xc
test eax, eax
jge 0x40b483
pop ebp
pop ebx
pop edi
mov eax, 2
pop esi
add esp, 8
ret
mov edx, dword [esp + 0x30]
mov dword [esi + 0x413248], eax
push 0x104
lea eax, [esi + 0x41324c]
push ebp
push eax
mov dword [edx], ecx
call dword [sym.imp.MSVCR71.dll_strncpy]
mov ecx, dword [esi + 0x413248]
mov edi, dword [sym.imp.MSVCR71.dll__lseek]
push 2
push 0
push ecx
call edi
mov dword [esi + 0x41335c], eax
mov ax, word [esp + 0x38]
add esp, 0x18
cmp ax, 2
jne 0x40b4d7
mov edx, dword [esp + 0x2c]
xor eax, eax
cmp word [edx], ax
sete al
jmp 0x40b4e2
xor ecx, ecx
cmp ax, 1
sete cl
mov eax, ecx
test ax, ax
je 0x40b527
mov edx, dword [esi + 0x413248]
push 0
push 0x18
push edx
call edi
mov eax, dword [esi + 0x413248]
mov ebp, dword [sym.imp.MSVCR71.dll__locking]
push 1
push 2
push eax
call ebp
add esp, 0x18
test eax, eax
jl 0x40b527
mov ecx, dword [esi + 0x413248]
push 1
push 0
push ecx
call ebp
add esp, 0xc
or word [esi + 0x413350], 0x8000
mov edx, dword [esi + 0x413248]
push 0
push 0
push edx
call edi
mov ecx, dword [esi + 0x413248]
push 2
lea eax, [esp + 0x24]
push eax
push ecx
call dword [sym.imp.MSVCR71.dll__read]
add esp, 0x18
cmp eax, 2
je 0x40b55d
pop ebp
pop ebx
pop edi
mov eax, 5
pop esi
add esp, 8
ret
mov eax, dword [esp + 0x14]
test al, al
jne 0x40b571
test ah, 0xff
je 0x40b571
or byte [esi + 0x413350], 1
mov edx, dword [esi + 0x413248]
push 0
push 0
push edx
call edi
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x1c]
push eax
push ecx
push edx
mov dword [esi + 0x413360], 0
call fcn.0040ad30
add esp, 0x18
pop ebp
pop ebx
pop edi
pop esi
add esp, 8
ret