Function at 0x1012f790
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov dword [ebp - 0xc], esi
mov esi, dword [ebp + 8]
mov dword [ebp - 8], ebx
push 0
mov eax, dword [esi + 0xec]
mov ebx, dword [esi + 0x98]
mov dword [ebp - 4], eax
mov eax, ebx
add eax, 0xffffffff
mov edx, dword [esi + 0x9c]
mov ecx, dword [esi + 0xf8]
mov dword [ebp - 0x1c], edx
adc edx, 0xffffffff
push ecx
push edx
push eax
mov dword [ebp - 0x10], edi
mov dword [ebp - 0x20], ecx
call fcn.100ff090
mov ecx, eax
mov edi, edx
test byte [esi + 0x171], 0x40
je 0x1012f840
mov edx, dword [esi + 0xa0]
mov dword [ebp - 0x24], ebx
sub ebx, edx
mov dword [ebp - 0x2c], edx
mov eax, dword [esi + 0xa4]
mov edx, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x24]
sbb edx, eax
mov dword [ebp - 0x28], eax
jl 0x1012f840
mov edx, ebx
sub edx, dword [esi + 0xa8]
mov edx, dword [ebp - 0x1c]
sbb edx, dword [esi + 0xac]
jge 0x1012f840
mov dword [esi + 0xe8], 0
sub ebx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x1c]
push 0
sbb eax, dword [ebp - 0x28]
push dword [ebp - 0x20]
push eax
push ebx
call fcn.100ff090
add eax, dword [esi + 0x38]
mov dword [esi + 0x50], eax
jmp 0x1012fc47
push 0
mov dword [ebp - 0x18], ecx
lea edx, [ebp - 0x14]
push edx
push ecx
push dword [esi + 0xe4]
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x14], edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
je 0x1012fd95
mov ebx, dword [ebp - 0x14]
mov edx, 0xffffffff
sub eax, edx
sub ebx, edx
or eax, ebx
je 0x1012fd77
mov edx, 0xffffffff
sub ecx, edx
sub edi, edx
mov dword [esi + 0xe8], 0
or ecx, edi
je 0x1012fd48
movzx eax, byte [esi + 0x16a]
test eax, 0x80
movzx edx, byte [esi + 0x170]
jne 0x1012f8bd
test dl, 1
jne 0x1012f8bd
test dl, 2
je 0x1012fa58
mov ebx, dword [esi + 0x80]
test ebx, ebx
je 0x1012fa58
mov eax, dword [ebp - 4]
cmp eax, dword [esi + 0x134]
jne 0x1012fa58
and edx, 0x80
movzx ecx, byte [esi + 0x171]
mov eax, dword [esi + 0xe4]
shr edx, 7
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], eax
mov ecx, dword [esi + 0x140]
cmp dword [0x1034450c], 0
je 0x1012f9a4
cmp ecx, 2
je 0x1012f913
cmp ecx, 1
jne 0x1012f91f
xor edi, edi
mov eax, 0xffffffff
jmp 0x1012fa47
test edx, edx
je 0x1012f92c
cmp ecx, 0xfffffffa
je 0x1012fc60
test ecx, ecx
je 0x1012fc76
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x24], eax
test edx, edx
je 0x1012f961
test byte [ebp - 0x1c], 1
je 0x1012f961
push dword [ebp - 0x24]
mov dword [ebp - 0x28], ecx
call fcn.1013cd60
push dword [ebp - 0x24]
call fcn.1013cd80
mov ecx, dword [ebp - 0x28]
add esp, 8
cmp dword [ebp - 0x2c], 0
je 0x1012f9a4
push dword [ebp - 0x24]
push dword [ebp - 4]
push ebx
call fcn.1013cd60
add esp, 0xc
mov edi, eax
cmp edi, 0xffffffff
je 0x1012fc6f
push 0
push dword [ebp - 0x24]
push 2
push 0x10189b24
call fcn.1013cd60
add esp, 0x10
mov byte [edi + ebx], 0xa
inc edi
mov eax, 1
jmp 0x1012fa47
mov dword [ebp - 0x28], ecx
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esi + 0x13c]
test eax, eax
mov ecx, dword [ebp - 0x28]
jne 0x1012f9c1
mov eax, 0x20000
cmp eax, dword [ebp - 4]
jae 0x1012f9ca
test ecx, ecx
jne 0x1012f9e2
push 0
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 4]
push ebx
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, dword [ebp - 0x28]
jmp 0x1012fa47
xor edi, edi
mov dword [ebp - 0x2c], edi
mov edi, ebx
mov ebx, eax
push 0
mov esi, ebx
lea edx, [ebp - 0x28]
push edx
push ebx
push edi
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1012fa2a
mov ecx, dword [ebp - 0x28]
add edi, ecx
mov edx, dword [ebp - 4]
add dword [ebp - 0x2c], ecx
sub edx, ecx
mov ecx, dword [ebp + 8]
mov dword [ebp - 4], edx
mov ecx, dword [ecx + 0x13c]
test ecx, ecx
jne 0x1012fa24
mov ecx, 0x20000
cmp edx, ecx
ja 0x1012fa2a
mov ebx, edx
cmp dword [ebp - 4], 0
je 0x1012fca3
cmp esi, dword [ebp - 0x28]
jne 0x1012fca3
test eax, eax
jne 0x1012f9eb
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebp + 8]
or byte [esi + 0x16f], 0x40
mov edx, 1
jmp 0x1012fbbe
and edx, 0x80
mov ebx, dword [esi + 0xe4]
movzx eax, byte [esi + 0x171]
shr edx, 7
mov dword [ebp - 0x20], ebx
mov ebx, dword [esi + 0x38]
mov dword [ebp - 0x24], eax
mov edi, dword [esi + 0x140]
cmp dword [0x1034450c], 0
je 0x1012fb1f
cmp edi, 2
je 0x1012fa94
cmp edi, 1
jne 0x1012faa0
xor edi, edi
mov eax, 0xffffffff
jmp 0x1012fbbc
test edx, edx
je 0x1012faad
cmp edi, 0xfffffffa
je 0x1012fcae
test edi, edi
je 0x1012fcc7
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], eax
test edx, edx
je 0x1012fadc
test byte [ebp - 0x24], 1
je 0x1012fadc
push dword [ebp - 0x28]
call fcn.1013cd60
push dword [ebp - 0x28]
call fcn.1013cd80
add esp, 8
cmp dword [ebp - 0x2c], 0
je 0x1012fb1f
push dword [ebp - 0x28]
push dword [ebp - 4]
push ebx
call fcn.1013cd60
add esp, 0xc
mov edi, eax
cmp edi, 0xffffffff
je 0x1012fcc0
push 0
push dword [ebp - 0x28]
push 2
push 0x10189b24
call fcn.1013cd60
add esp, 0x10
mov byte [edi + ebx], 0xa
inc edi
mov eax, 1
jmp 0x1012fbbc
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esi + 0x13c]
test eax, eax
jne 0x1012fb36
mov eax, 0x20000
cmp eax, dword [ebp - 4]
jae 0x1012fb3f
test edi, edi
jne 0x1012fb57
push 0
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 4]
push ebx
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, dword [ebp - 0x24]
jmp 0x1012fbbc
xor edi, edi
mov dword [ebp - 0x2c], edi
mov edi, ebx
mov ebx, eax
push 0
mov esi, ebx
lea edx, [ebp - 0x24]
push edx
push ebx
push edi
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1012fb9f
mov ecx, dword [ebp - 0x24]
add edi, ecx
mov edx, dword [ebp - 4]
add dword [ebp - 0x2c], ecx
sub edx, ecx
mov ecx, dword [ebp + 8]
mov dword [ebp - 4], edx
mov ecx, dword [ecx + 0x13c]
test ecx, ecx
jne 0x1012fb99
mov ecx, 0x20000
cmp edx, ecx
ja 0x1012fb9f
mov ebx, edx
cmp dword [ebp - 4], 0
je 0x1012fd3d
cmp esi, dword [ebp - 0x24]
jne 0x1012fd3d
test eax, eax
jne 0x1012fb60
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebp + 8]
xor edx, edx
test eax, eax
je 0x1012fd13
test edi, edi
je 0x1012fd01
test byte [esi + 0x168], 1
je 0x1012fbe4
cmp byte [esi + 0x155], 2
je 0x1012fcee
test edx, edx
jne 0x1012fc47
mov eax, dword [esi + 0xf8]
xor edx, edx
mov dword [ebp - 0x2c], eax
mov eax, edi
mov edi, dword [ebp - 0x2c]
div edi
mov ecx, dword [esi + 0x38]
mov dword [esi + 0x50], ecx
mov ecx, dword [esi + 0x98]
add eax, ecx
mov ebx, dword [esi + 0x9c]
mov edx, ebx
adc edx, 0
mov dword [esi + 0xa0], ecx
sub ecx, eax
mov dword [esi + 0xa4], ebx
sub ebx, edx
or ecx, ebx
jne 0x1012fc3b
add eax, 1
mov dword [esi + 0xa8], eax
adc edx, 0
mov dword [esi + 0xac], edx
jmp 0x1012fc47
mov dword [esi + 0xa8], eax
mov dword [esi + 0xac], edx
xor eax, eax
mov dword [esi + 0x108], 0
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x2c], 1
jmp 0x1012f942
xor eax, eax
jmp 0x1012fa47
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x2c], edx
call fcn.1013cd80
mov edx, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x24], eax
cmp dword [0x1034450c], 0
je 0x1012f967
mov dword [ebp - 0x2c], 1
jmp 0x1012f93e
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebp + 8]
jmp 0x1012fa47
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x2c], 1
jmp 0x1012fac3
xor eax, eax
jmp 0x1012fbbc
mov dword [ebp - 0x2c], edx
call fcn.1013cd80
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x28], eax
cmp dword [0x1034450c], 0
je 0x1012fae2
mov dword [ebp - 0x2c], 1
jmp 0x1012fabf
mov eax, dword [esi + 0x38]
movsx eax, byte [eax]
test eax, eax
je 0x1012fd01
cmp eax, 0x40
jne 0x1012fbe4
mov eax, 0x24
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, 0x24
cmp eax, 0x26
mov dword [esi + 0xe8], eax
je 0x1012fd2e
mov edx, 0x27
mov eax, edx
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebp + 8]
jmp 0x1012fbbc
mov eax, dword [esi + 0x9c]
mov ecx, dword [esi + 0xa0]
mov edi, dword [esi + 0xa4]
mov edx, dword [esi + 0xf8]
mov ebx, dword [esi + 0x98]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], edi
jmp 0x1012f820
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0xe8], eax
mov eax, 0x27
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x24]
test eax, eax
je 0x1012fdb2
mov eax, 0xffffffff
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
jmp 0x1012fd77
mov eax, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x14]
jmp 0x1012f86e