Function at 0x402100
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x42d9fc
mov eax, dword fs:[0]
push eax
sub esp, 0xa0
mov eax, dword [0x438300]
xor eax, esp
mov dword [esp + 0x98], eax
push ebx
push esi
push edi
mov eax, dword [0x438300]
xor eax, esp
push eax
lea eax, [esp + 0xb0]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov ebx, ecx
mov dword [esp + 0x20], eax
test eax, eax
je 0x402789
mov ecx, dword [eax + 0x10]
test ecx, ecx
je 0x402789
cmp dword [eax + 0x18], 0
je 0x402789
test ecx, ecx
jl 0x402179
mov eax, dword [ebx + 8]
push 0
push ecx
push eax
call fcn.00414d74
add esp, 0xc
mov ecx, dword [ebx + 8]
push ecx
push 1
lea edx, [esp + 0x50]
push 0x20
push edx
call fcn.004148a9
push 4
lea eax, [esp + 0x5c]
push str.NOD
push eax
call fcn.00413905
add esp, 0x1c
test eax, eax
jne 0x402444
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov ecx, dword [esp + 0x20]
mov dword [esp + 0xb8], eax
mov eax, dword [ecx + 0x10]
mov edi, dword [ebx + 8]
add eax, 0x20
lea esi, [esp + 0x10]
call fcn.00401080
mov ecx, dword [esp + 0x20]
mov eax, dword [ecx + 0x18]
sub eax, dword [ecx + 0x10]
mov edx, dword [esp + 0x10]
sub eax, 0x20
cmp dword [ebx + 0x10], 0
lea ecx, [edx + eax]
je 0x4021ec
movzx edx, word [ecx + 0x1a]
jmp 0x4021f0
movzx edx, word [ecx + 0x16]
mov edi, dword [esp + 0x10]
movzx esi, dx
add esi, dword [ebx + 0x44]
mov edx, 0xbe0
sub edx, esi
sub edx, eax
push edx
lea edx, [edi + esi]
add edx, eax
push edx
push ecx
call fcn.004135a0
add esp, 0xc
push esi
sub edi, esi
push 0
add edi, 0xbe0
push edi
call fcn.00415d50
mov cx, word [esp + 0x68]
add word [esp + 0x64], si
xor eax, eax
dec cx
xor edi, edi
xor edx, edx
add esp, 0xc
cmp ax, cx
mov word [esp + 0x5c], cx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], edi
mov word [esp + 0x5e], ax
mov word [esp + 0x5a], dx
mov dword [esp + 0x24], eax
jge 0x402325
lea ecx, [ecx]
mov ecx, dword [esp + 0x10]
lea esi, [ecx + edi]
add esi, dword [ebx + 0x44]
cmp dword [esp + 0x1c], 0
je 0x402296
cmp dword [ebx + 0x10], 0
je 0x402284
mov edx, dword [esp + 0x1c]
push edx
push esi
call fcn.00427f73
jmp 0x40228f
mov eax, dword [esp + 0x1c]
push eax
push esi
call fcn.0042514c
add esp, 8
test eax, eax
jg 0x4022aa
mov cx, word [ebx + 0x44]
add cx, di
add cx, 0x20
mov dword [esp + 0x1c], esi
mov word [esp + 0x5e], cx
cmp dword [esp + 0x18], 0
je 0x4022d6
cmp dword [ebx + 0x10], 0
je 0x4022c4
mov edx, dword [esp + 0x18]
push edx
push esi
call fcn.00427f73
jmp 0x4022cf
mov eax, dword [esp + 0x18]
push eax
push esi
call fcn.0042514c
add esp, 8
test eax, eax
jl 0x4022ea
mov cx, word [ebx + 0x44]
add cx, di
add cx, 0x20
mov dword [esp + 0x18], esi
mov word [esp + 0x5a], cx
cmp dword [ebx + 0x10], 0
je 0x4022fb
mov edx, dword [esp + 0x10]
movzx eax, word [edx + edi + 0x1a]
jmp 0x402304
mov eax, dword [esp + 0x10]
movzx eax, word [eax + edi + 0x16]
movzx ecx, ax
add ecx, dword [ebx + 0x44]
mov eax, dword [esp + 0x24]
add edi, ecx
mov cx, word [esp + 0x5c]
movsx edx, cx
inc eax
cmp eax, edx
mov dword [esp + 0x24], eax
jl 0x402260
test cx, cx
jne 0x402673
cmp dword [esp + 0x50], 0
mov eax, dword [esp + 0x54]
mov ecx, dword [esp + 0x4c]
jne 0x402349
test ecx, ecx
jne 0x402349
test eax, eax
je 0x402673
mov edx, dword [esp + 0x20]
mov edx, dword [edx + 0x10]
xor edi, edi
mov dword [esp + 0x24], edx
mov dword [esp + 0x1c], edi
test eax, eax
je 0x402396
mov edi, eax
mov dword [esp + 0x1c], edi
test ecx, ecx
je 0x4023a0
push eax
push ecx
mov ecx, ebx
call fcn.004027c0
mov dword [esp + 0x18], eax
test eax, eax
je 0x4023a0
lea esi, [esp + 0x10]
mov dword [esp + 0xb8], 0xffffffff
call fcn.00401000
mov eax, dword [esp + 0x18]
jmp 0x40278e
test ecx, ecx
je 0x4023da
mov edi, ecx
mov dword [esp + 0x1c], ecx
test edi, edi
je 0x4023da
push 0x20
lea eax, [esp + 0x6c]
push eax
mov eax, edi
mov esi, ebx
call fcn.00404180
mov dword [esp + 0x18], eax
test eax, eax
jne 0x402379
mov ecx, dword [esp + 0x50]
push 0x20
lea edx, [esp + 0x6c]
push edx
mov eax, edi
mov dword [esp + 0x78], ecx
call fcn.00404140
mov dword [esp + 0x18], eax
test eax, eax
jne 0x402379
mov eax, dword [esp + 0x50]
test eax, eax
je 0x4024aa
push 0x20
lea ecx, [esp + 0x2c]
push ecx
mov esi, ebx
call fcn.00404180
mov edi, eax
test edi, edi
jne 0x40248f
mov esi, str.NOD
lea eax, [esp + 0x28]
mov cl, byte [eax]
cmp cl, byte [esi]
jne 0x402427
test cl, cl
je 0x402423
mov cl, byte [eax + 1]
cmp cl, byte [esi + 1]
jne 0x402427
add eax, 2
add esi, 2
test cl, cl
jne 0x402407
xor eax, eax
jmp 0x40242c
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x40244e
lea esi, [esp + 0x10]
mov dword [esp + 0xb8], 0xffffffff
call fcn.00401000
mov eax, 2
jmp 0x40278e
mov edx, dword [esp + 0x20]
mov eax, dword [edx + 0x10]
cmp dword [esp + 0x2c], eax
jne 0x402465
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x2c], eax
jmp 0x402473
cmp dword [esp + 0x34], eax
jne 0x402430
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x34], ecx
mov eax, dword [esp + 0x50]
push 0x20
lea edx, [esp + 0x2c]
push edx
mov esi, ebx
call fcn.00404140
mov edi, eax
test edi, edi
je 0x4025f7
lea esi, [esp + 0x10]
mov dword [esp + 0xb8], 0xffffffff
call fcn.00401000
mov eax, edi
jmp 0x40278e
test edi, edi
je 0x4025f7
push 0xbe2
call fcn.00414fa9
mov edi, eax
add esp, 4
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], 0xbe0
mov eax, dword [esp + 0x1c]
push 0xbe0
add eax, 0x20
push edi
mov esi, ebx
call fcn.00404180
mov dword [esp + 0x18], eax
test eax, eax
je 0x4024ff
lea esi, [esp + 0x28]
mov byte [esp + 0xb8], 0
call fcn.00401000
jmp 0x402379
mov eax, dword [esp + 0x20]
mov eax, dword [eax + 0x10]
push 0xbe0
add eax, 0x20
push edi
mov esi, ebx
call fcn.00404140
mov edi, eax
test edi, edi
je 0x402532
lea esi, [esp + 0x28]
mov byte [esp + 0xb8], 0
call fcn.00401000
jmp 0x40248f
mov eax, dword [esp + 0x6c]
test eax, eax
je 0x402578
push 0x20
lea ecx, [esp + 0x8c]
push ecx
mov esi, ebx
call fcn.00404180
mov edi, eax
test edi, edi
jne 0x40251c
mov edx, dword [esp + 0x20]
mov eax, dword [edx + 0x10]
push 0x20
lea ecx, [esp + 0x8c]
mov dword [esp + 0x94], eax
mov eax, dword [esp + 0x70]
push ecx
call fcn.00404140
mov edi, eax
test edi, edi
jne 0x40251c
mov eax, dword [esp + 0x74]
test eax, eax
je 0x4025c2
push 0x20
lea edx, [esp + 0x8c]
push edx
mov esi, ebx
call fcn.00404180
mov edi, eax
test edi, edi
jne 0x40251c
mov eax, dword [esp + 0x20]
mov ecx, dword [eax + 0x10]
mov eax, dword [esp + 0x74]
push 0x20
lea edx, [esp + 0x8c]
push edx
mov dword [esp + 0x98], ecx
call fcn.00404140
mov edi, eax
test edi, edi
jne 0x40251c
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
push 0x20
lea edx, [esp + 0x6c]
mov dword [esp + 0x28], eax
mov eax, dword [ecx + 0x10]
push edx
mov esi, ebx
call fcn.00404140
lea esi, [esp + 0x28]
mov edi, eax
mov byte [esp + 0xb8], 0
call fcn.00401000
jmp 0x402487
cmp dword [esp + 0x24], 0
je 0x4026f2
lea esi, [esp + 0x28]
call fcn.00405920
mov eax, dword [esp + 0x24]
mov byte [esp + 0xb8], 2
mov esi, dword [esp + 0x28]
mov dword [esi], eax
lea ecx, [eax + 0x200]
lea edx, [eax + 0x400]
mov dword [esi + 4], ecx
mov dword [esi + 8], edx
lea ecx, [eax + 0x600]
lea edx, [eax + 0x800]
add eax, 0xa00
mov dword [esi + 0xc], ecx
mov dword [esi + 0x10], edx
mov dword [esi + 0x14], eax
lea eax, [esp + 0x28]
push eax
xor eax, eax
call fcn.00403f00
mov edi, eax
xor eax, eax
mov byte [esp + 0xb8], al
push esi
cmp edi, eax
jne 0x40272a
call fcn.004148f0
add esp, 4
jmp 0x4026f2
mov edi, dword [esp + 0x20]
mov eax, dword [edi + 0x10]
test eax, eax
jl 0x40268d
mov ecx, dword [ebx + 8]
push 0
push eax
push ecx
call fcn.00414d74
add esp, 0xc
mov edx, dword [ebx + 8]
push edx
push 1
lea eax, [esp + 0x50]
push 0x20
push eax
call fcn.00414a5d
dec eax
add esp, 0x10
neg eax
sbb eax, eax
and eax, 7
mov esi, eax
je 0x4026d1
mov dword [esp + 0xb8], 0xffffffff
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4026ca
push eax
call fcn.004148f0
add esp, 4
mov eax, esi
jmp 0x40278e
mov ecx, dword [esp + 0x14]
mov eax, dword [edi + 0x10]
mov edx, dword [esp + 0x10]
push ecx
add eax, 0x20
push edx
mov esi, ebx
call fcn.00404140
mov edi, eax
test edi, edi
jne 0x40248f
mov edi, dword [esp + 0x20]
cmp dword [edi + 0x14], 0
je 0x402771
lea esi, [esp + 0x28]
call fcn.004058f0
mov byte [esp + 0xb8], 3
mov ecx, dword [edi + 0x14]
mov edx, esi
call fcn.004029a0
mov edi, eax
test edi, edi
je 0x402737
mov byte [esp + 0xb8], 0
mov eax, dword [esp + 0x28]
push eax
call fcn.004148f0
add esp, 4
jmp 0x40248f
lea ecx, [esp + 0x28]
push ecx
xor eax, eax
call fcn.00403f00
mov edi, eax
xor eax, eax
mov byte [esp + 0xb8], al
cmp edi, eax
je 0x402764
mov edx, dword [esp + 0x28]
push edx
call fcn.004148f0
add esp, 4
jmp 0x40248f
mov eax, dword [esp + 0x28]
push eax
call fcn.004148f0
add esp, 4
lea esi, [esp + 0x10]
mov dword [esp + 0xb8], 0xffffffff
call fcn.00401000
xor eax, eax
jmp 0x40278e
mov eax, 6
mov ecx, dword [esp + 0xb0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x98]
xor ecx, esp
call fcn.0041358c
mov esp, ebp
pop ebp
ret 4